[openssl/openssl] 1a8242: Add constant-time validation for CRYPTO_memcmp

"'David Foster' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 1a824261ef16231ea036b7935613ea4b219e3a42
      https://github.com/openssl/openssl/commit/1a824261ef16231ea036b7935613ea4b219e3a42
  Author: David Foster <[email protected]>
  Date:   2026-06-11 (Thu, 11 Jun 2026)

  Changed paths:
    M .github/workflows/ct-validation-daily.yml
    M crypto/cpuid.c
    M test/build.info
    A test/crypto_memcmp_test.c
    A test/recipes/90-test_crypto_memcmp.t

  Log Message:
  -----------
  Add constant-time validation for CRYPTO_memcmp

Add test/crypto_memcmp_test.c which provides functional coverage for
CRYPTO_memcmp under regular builds and constant-time coverage under
enable-ct-validation builds.

The added constant-time coverage checks:
- there are no data dependent branches or memory accesses,
  on x86_64 and aarch64 architectures

The added constant-time coverage does NOT check:
- there are no data-dependent variable-time instructions, such as
  instructions NOT on the x86 Data Operand Independent Timing list
  or NOT on the ARM Data-Independent Timing list
- any architectures beyond x86_64 and aarch64

New CONSTTIME_SECRET annotations live only in the test rather than in
the generic C version of CRYPTO_memcmp so that both the C and
assembler versions of CRYPTO_memcmp are constant-time covered.

CRYPTO_memcmp directly backs CPython's secrets.compare_digest() and
hmac.compare_digest(), so a timing leak in it is high impact, yet it had
essentially no direct test coverage.

References #15076.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Bob Beck <[email protected]>
MergeDate: Thu Jun 11 16:11:58 2026
(Merged from https://github.com/openssl/openssl/pull/31398)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/master/6c9015-1a8242%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.