Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e6eb9ebd41d6a54df8db2dc86603c3a8139abf5b
      
https://github.com/WebKit/WebKit/commit/e6eb9ebd41d6a54df8db2dc86603c3a8139abf5b
  Author: Claudio Saavedra <[email protected]>
  Date:   2026-10-09 (Fri, 09 Oct 2026)

  Changed paths:
    M LayoutTests/platform/glib/TestExpectations
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_bits_curve25519.https.any-expected.txt
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_bits_curve25519.https.any.worker-expected.txt
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_keys_curve25519.https.any-expected.txt
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_keys_curve25519.https.any.worker-expected.txt
    M Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp

  Log Message:
  -----------
  [GCrypt] Ed25519/X25519 keys with a leading zero byte are mishandled
https://bugs.webkit.org/show_bug.cgi?id=307095

Reviewed by Javier Fernandez.

mpiData() strips leading zero bytes, so generated keys starting with a
zero byte came out shorter than 32 bytes and generateKey() failed with
OperationError (~1/256 for X25519, ~1/128 for Ed25519, which converts
both q and d). Imported SPKI/PKCS#8 keys were truncated the same way and
then rejected. Use mpiZeroPrefixedData() to always get 32 bytes, and
check the SPKI key length up front, as PKCS#8 import already does, so
short keys aren't padded into valid ones.

This also fixes importing the all-zero X25519 public key, which used to
come out as 0 bytes, so the glib-specific baselines for the order 0
subtests can go.

* LayoutTests/platform/glib/TestExpectations: Remove flaky expectations
for b/307095, b/307140, b/306347 and b/309135, all caused by this.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_bits_curve25519.https.any-expected.txt:
 Removed.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_bits_curve25519.https.any.worker-expected.txt:
 Removed.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_keys_curve25519.https.any-expected.txt:
 Removed.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/cfrg_curves_keys_curve25519.https.any.worker-expected.txt:
 Removed.
* Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp:
(WebCore::gcryptGenerateEd25519Keys):
(WebCore::gcryptGenerateX25519Keys):
(WebCore::CryptoKeyOKP::importSpki):
(WebCore::CryptoKeyOKP::importPkcs8):
(WebCore::CryptoKeyOKP::generateJwkX const):

Canonical link: https://commits.webkit.org/323215@main



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

Reply via email to