haikuwebkit/LayoutTests/crypto/subtle/ecdh-import-key-derive-bits...

11 lines
260 B
Plaintext
Raw Permalink Normal View History

[WebCrypto] Implement ECDH DeriveBits operation https://bugs.webkit.org/show_bug.cgi?id=169319 <rdar://problem/23789585> Reviewed by Brent Fulgham. Source/WebCore: This patch implements DeriveBits operation of ECDH according to the spec: https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations. Tests: crypto/subtle/derive-bits-malformed-parameters.html crypto/subtle/ecdh-derive-bits-malformed-parametrs.html crypto/subtle/ecdh-generate-key-derive-bits.html crypto/subtle/ecdh-import-key-derive-bits-custom-length.html crypto/subtle/ecdh-import-key-derive-bits-null-length.html crypto/workers/subtle/ecdh-import-key-derive-bits.html * CMakeLists.txt: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::normalizeCryptoAlgorithmParameters): (WebCore::jsSubtleCryptoFunctionDeriveKeyPromise): (WebCore::jsSubtleCryptoFunctionDeriveBitsPromise): (WebCore::JSSubtleCrypto::generateKey): Reorder a bit of the functions. * crypto/CommonCryptoUtilities.h: * crypto/CryptoAlgorithm.cpp: (WebCore::CryptoAlgorithm::deriveBits): * crypto/CryptoAlgorithm.h: * crypto/CryptoAlgorithmParameters.h: * crypto/algorithms/CryptoAlgorithmECDH.cpp: (WebCore::CryptoAlgorithmECDH::deriveBits): * crypto/algorithms/CryptoAlgorithmECDH.h: * crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp: Added. (WebCore::CryptoAlgorithmECDH::platformDeriveBits): * crypto/keys/CryptoKeyEC.h: * crypto/mac/CryptoAlgorithmECDHMac.cpp: Added. (WebCore::CryptoAlgorithmECDH::platformDeriveBits): * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h: Added. * crypto/parameters/EcdhKeyDeriveParams.idl: Added. LayoutTests: * TestExpectations: Refine some comments. * crypto/subtle/derive-bits-malformed-parameters-expected.txt: Renamed from LayoutTests/crypto/subtle/deriveBits-malformed-parameters-expected.txt. * crypto/subtle/derive-bits-malformed-parameters.html: Added. * crypto/subtle/deriveBits-malformed-parameters.html: Removed. * crypto/subtle/ecdh-derive-bits-malformed-parametrs-expected.txt: Added. * crypto/subtle/ecdh-derive-bits-malformed-parametrs.html: Added. * crypto/subtle/ecdh-generate-key-derive-bits-expected.txt: Added. * crypto/subtle/ecdh-generate-key-derive-bits.html: Added. * crypto/subtle/ecdh-import-key-derive-bits-custom-length-expected.txt: Added. * crypto/subtle/ecdh-import-key-derive-bits-custom-length.html: Added. * crypto/subtle/ecdh-import-key-derive-bits-null-length-expected.txt: Added. * crypto/subtle/ecdh-import-key-derive-bits-null-length.html: Added. * crypto/workers/subtle/ecdh-import-key-derive-bits-expected.txt: Added. * crypto/workers/subtle/ecdh-import-key-derive-bits.html: Added. * crypto/workers/subtle/resources/ecdh-import-key-derive-bits.js: Added. Canonical link: https://commits.webkit.org/186381@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-09 04:04:29 +00:00
Test ECDH deriveBits operation with imported base key and null length
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS bytesToHexString(derivedKey) is expectedDerivedKey
PASS successfullyParsed is true
TEST COMPLETE