haikuwebkit/LayoutTests/crypto/subtle/hkdf-import-key-expected.txt

15 lines
375 B
Plaintext
Raw Permalink Normal View History

[WebCrypto] Support HKDF https://bugs.webkit.org/show_bug.cgi?id=170636 <rdar://problem/23539827> Reviewed by Brent Fulgham. LayoutTests/imported/w3c: * web-platform-tests/WebCryptoAPI/derive_bits_keys/hkdf.worker-expected.txt: * web-platform-tests/WebCryptoAPI/derive_bits_keys/test_hkdf-expected.txt: * web-platform-tests/WebCryptoAPI/import_export/symmetric_importKey.worker-expected.txt: * web-platform-tests/WebCryptoAPI/import_export/test_symmetric_importKey-expected.txt: Source/WebCore: This patch implements HKDF according to the spec: https://www.w3.org/TR/WebCryptoAPI/#hkdf. Supported operations include deriveKey, deriveBits, importKey and getKeyLength. Tests: crypto/subtle/ecdh-import-key-derive-hkdf-key.html crypto/subtle/hkdf-derive-bits-malformed-parametrs.html crypto/subtle/hkdf-import-key-derive-bits.html crypto/subtle/hkdf-import-key-derive-hmac-key.html crypto/subtle/hkdf-import-key-malformed-parameters.html crypto/subtle/hkdf-import-key.html crypto/workers/subtle/hkdf-import-key-derive-bits.html crypto/workers/subtle/hkdf-import-key-derive-hmac-key.html crypto/workers/subtle/hkdf-import-key.html * CMakeLists.txt: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCryptoAlgorithmDictionary.cpp: (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign): (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest): (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits): (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Rename HKDF_CTR to HKDF. * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::normalizeCryptoAlgorithmParameters): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::write): (WebCore::CloneDeserializer::read): Rename HKDF_CTR to HKDF. * crypto/CommonCryptoUtilities.h: * crypto/CryptoAlgorithmIdentifier.h: * crypto/CryptoAlgorithmParameters.h: * crypto/algorithms/CryptoAlgorithmHKDF.cpp: Added. (WebCore::CryptoAlgorithmHKDF::create): (WebCore::CryptoAlgorithmHKDF::identifier): (WebCore::CryptoAlgorithmHKDF::deriveBits): (WebCore::CryptoAlgorithmHKDF::importKey): (WebCore::CryptoAlgorithmHKDF::getKeyLength): * crypto/algorithms/CryptoAlgorithmHKDF.h: Added. * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp: Added. (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): * crypto/mac/CryptoAlgorithmHKDFMac.cpp: Added. (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): * crypto/mac/CryptoAlgorithmRegistryMac.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): * crypto/parameters/CryptoAlgorithmHkdfParams.h: Added. * crypto/parameters/HkdfParams.idl: Added. LayoutTests: * TestExpectations: * crypto/subtle/ecdh-import-key-derive-hkdf-key-expected.txt: Added. * crypto/subtle/ecdh-import-key-derive-hkdf-key.html: Added. * crypto/subtle/hkdf-derive-bits-malformed-parametrs-expected.txt: Added. * crypto/subtle/hkdf-derive-bits-malformed-parametrs.html: Added. * crypto/subtle/hkdf-import-key-derive-bits-expected.txt: Added. * crypto/subtle/hkdf-import-key-derive-bits.html: Added. * crypto/subtle/hkdf-import-key-derive-hmac-key-expected.txt: Added. * crypto/subtle/hkdf-import-key-derive-hmac-key.html: Added. * crypto/subtle/hkdf-import-key-expected.txt: Added. * crypto/subtle/hkdf-import-key-malformed-parameters-expected.txt: Added. * crypto/subtle/hkdf-import-key-malformed-parameters.html: Added. * crypto/subtle/hkdf-import-key.html: Added. * crypto/workers/subtle/hkdf-import-key-derive-bits-expected.txt: Added. * crypto/workers/subtle/hkdf-import-key-derive-bits.html: Added. * crypto/workers/subtle/hkdf-import-key-derive-hmac-key-expected.txt: Added. * crypto/workers/subtle/hkdf-import-key-derive-hmac-key.html: Added. * crypto/workers/subtle/hkdf-import-key-expected.txt: Added. * crypto/workers/subtle/hkdf-import-key.html: Added. * crypto/workers/subtle/resources/hkdf-import-key-derive-bits.js: Added. * crypto/workers/subtle/resources/hkdf-import-key-derive-hmac-key.js: Added. * crypto/workers/subtle/resources/hkdf-import-key.js: Added. Canonical link: https://commits.webkit.org/187799@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-15 00:17:09 +00:00
Test importing a HKDF raw key
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS publicKey.toString() is '[object CryptoKey]'
PASS publicKey.type is 'secret'
PASS publicKey.extractable is false
PASS publicKey.algorithm.name is 'HKDF'
PASS publicKey.usages is ['deriveBits', 'deriveKey']
PASS successfullyParsed is true
TEST COMPLETE