haikuwebkit/LayoutTests/platform/wincairo/crypto
Yoshiaki Jitsukawa d19031cbc6 [OpenSSL] Implement CryptoAlgorithmEC*
https://bugs.webkit.org/show_bug.cgi?id=227655

Reviewed by Don Olmstead.

Source/WebCore:

Implement elliptic curve support in WebCrypto. This patch enables ECDH
and ECDSA algorithms as well as EC key import, export, and generation.

Note that low level ASN1 API is used in CryptoKeyEC.cpp to import
public EC keys in the SPKI format because currently OpenSSL doesn't
have the Object ID of the ecDH algorithm and it fails to load ecDH
keys with d2iPUBKEY().

* crypto/keys/CryptoKeyEC.h:
* crypto/openssl/CryptoAlgorithmECDHOpenSSL.cpp:
(WebCore::CryptoAlgorithmECDH::platformDeriveBits):
* crypto/openssl/CryptoAlgorithmECDSAOpenSSL.cpp:
(WebCore::CryptoAlgorithmECDSA::platformSign):
(WebCore::CryptoAlgorithmECDSA::platformVerify):
* crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/openssl/CryptoKeyECOpenSSL.cpp:
(WebCore::curveIdentifier):
(WebCore::curveSize):
(WebCore::createECKey):
(WebCore::verifyCurve):
(WebCore::CryptoKeyEC::keySizeInBits const):
(WebCore::CryptoKeyEC::platformSupportedCurve):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::ecPublicKeyIdentifier):
(WebCore::ecDHIdentifier):
(WebCore::supportedAlgorithmIdentifier):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::CryptoKeyEC::platformExportRaw const):
(WebCore::CryptoKeyEC::platformAddFieldElements const):
(WebCore::CryptoKeyEC::platformExportSpki const):
(WebCore::CryptoKeyEC::platformExportPkcs8 const):
* crypto/openssl/CryptoKeyRSAOpenSSL.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportSpki const):
(WebCore::CryptoKeyRSA::exportPkcs8 const):
(WebCore::CryptoKeyRSA::algorithm const):
(WebCore::CryptoKeyRSA::exportData const):
* crypto/openssl/OpenSSLCryptoUniquePtr.h:
(WebCore::OpenSSLCryptoPtrDeleter<EC_KEY>::operator() const):
(WebCore::OpenSSLCryptoPtrDeleter<EC_POINT>::operator() const):
(WebCore::OpenSSLCryptoPtrDeleter<ECDSA_SIG>::operator() const):
(WebCore::OpenSSLCryptoPtrDeleter<ASN1_SEQUENCE_ANY>::operator() const):
* crypto/openssl/OpenSSLUtilities.cpp:
(WebCore::convertToBytes):
(WebCore::convertToBytesExpand):
(WebCore::convertToBigNumber):
* crypto/openssl/OpenSSLUtilities.h:

LayoutTests:

Update test expectations of wincairo to enable ec* tests.

* platform/wincairo/TestExpectations:

Add expected results thats support the P-521 elliptic curve. Generic test
results expect that P-521 is unsupported.

* platform/wincairo/crypto/subtle/ec-generate-key-malformed-parameters-expected.txt: Added.
* platform/wincairo/crypto/subtle/ecdh-derive-bits-length-limits-expected.txt: Added.
* platform/wincairo/crypto/subtle/ecdh-import-spki-key-ecdh-identifier-expected.txt: Added.

Use shouldRejectWithErrorName after r260579.

* crypto/subtle/ecdh-import-pkcs8-key-p521-validate-ecprivatekey-parameters-publickey.html:
* crypto/subtle/ecdsa-import-pkcs8-key-p521-validate-ecprivatekey-parameters-publickey.html:


Canonical link: https://commits.webkit.org/239487@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-07 22:52:36 +00:00
..
subtle [OpenSSL] Implement CryptoAlgorithmEC* 2021-07-07 22:52:36 +00:00