[webkit-changes] [WebKit/WebKit] bdf80b: [GTK] Implement the Ed25519 algorithm
Javier Fernandez Garcia-Boente
noreply at github.com
Fri Aug 4 12:35:05 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bdf80b88c96dac5fb3603260a5ca57d87eee401f
https://github.com/WebKit/WebKit/commit/bdf80b88c96dac5fb3603260a5ca57d87eee401f
Author: Javier Fernandez <jfernandez at igalia.com>
Date: 2023-08-04 (Fri, 04 Aug 2023)
Changed paths:
M LayoutTests/platform/glib/TestExpectations
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/PAL/pal/crypto/tasn1/Utilities.cpp
M Source/WebCore/PAL/pal/crypto/tasn1/WebCrypto.asn
M Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.cpp
A Source/WebCore/crypto/gcrypt/CryptoAlgorithmEd25519GCrypt.cpp
M Source/WebCore/crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp
A Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp
M Source/WebCore/crypto/gcrypt/GCryptUtilities.h
M Source/WebCore/crypto/keys/CryptoKeyOKP.cpp
M Source/WebCore/platform/SourcesGCrypt.txt
Log Message:
-----------
[GTK] Implement the Ed25519 algorithm
https://bugs.webkit.org/show_bug.cgi?id=259663
Reviewed by Žan Doberšek.
This change implements all the Ed25519's operations defined in the
WebCrypto Secure Curves specification. These operations include the
key generation, import/export in spki, pkcs8 and jwk formats and the
sign and verify methods that are the key operations of this algorithm.
It's worth mentioning that the basic support for the OKP key format
has been already introduced by the Cocoa implementation of this
algorithm (see bug 246145 for details).
The implementation of the Ed25519 algorithm for the GTK+ port is done
with the Libgcrypt primitives, as it's the case of the post's most
complete and mature implementation of the WebCrypto APIs. There is an
ongoing effort to implement it in OpenSSL (see bug 248980 for details)
but it won't be an option for the GTK+ port in the short term.
* LayoutTests/platform/glib/TestExpectations: All the Ed25519 tests should pass now.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Feature enabled for GTK and WPE ports
* Source/WebCore/PAL/pal/crypto/tasn1/Utilities.cpp:
(PAL::TASN1::asn1Definitions):
* Source/WebCore/PAL/pal/crypto/tasn1/WebCrypto.asn:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmEd25519GCrypt.cpp: Added.
(WebCore::extractEDDSASignatureInteger): Extract the 'r' and 's' integers of the Elliptic curve
(WebCore::signEd25519): Gcrypt sign operation
(WebCore::verifyEd25519): Gcrypt verify operation
(WebCore::CryptoAlgorithmEd25519::platformSign): Generic implementation of the abstract method.
(WebCore::CryptoAlgorithmEd25519::platformVerify): Generic implementation of the abstract method.
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Registration of the Ed25519 alg
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Generci implementation of the abstract method
* Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp: Added.
(WebCore::CryptoKeyOKP::isPlatformSupportedCurve):
(WebCore::CryptoKeyOKPImpl::supportedAlgorithmIdentifier):
(WebCore::CryptoKeyOKP::platformGeneratePair):
(WebCore::CryptoKeyOKP::importSpki):
(WebCore::CryptoKeyOKP::exportSpki const):
(WebCore::CryptoKeyOKP::importPkcs8):
(WebCore::CryptoKeyOKP::exportPkcs8 const):
(WebCore::CryptoKeyOKP::generateJwkD const):
(WebCore::CryptoKeyOKP::generateJwkX const):
(WebCore::CryptoKeyOKP::platformExportRaw const):
* Source/WebCore/crypto/gcrypt/GCryptUtilities.h:
* Source/WebCore/crypto/keys/CryptoKeyOKP.cpp:
(WebCore::CryptoKeyOKP::importJwk):
* Source/WebCore/platform/SourcesGCrypt.txt:
Canonical link: https://commits.webkit.org/266599@main
More information about the webkit-changes
mailing list