haikuwebkit/LayoutTests/crypto/crypto-key-usages-gc-expect...

14 lines
304 B
Plaintext
Raw Permalink Normal View History

WebCrypto algorithms should be exposed via KeyAlgorithm dictionary https://bugs.webkit.org/show_bug.cgi?id=128748 <rdar://problem/27359438> Reviewed by Brent Fulgham and Chris Dumez. Source/WebCore: Replace custom CryptoAlgorithmBuilder/buildAlgorithmDescription with KeyAlgorithm dictionary which is defined by the spec: https://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary. Moreover, mark CryptoKey.usages as CachedAttribute. Tests: crypto/subtle/crypto-key-algorithm-gc.html crypto/subtle/crypto-key-usages-gc.html * PlatformEfl.cmake: * PlatformGTK.cmake: * PlatformMac.cmake: Remove CryptoAlgorithmDescriptionBuilder.cpp. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCryptoAlgorithmBuilder.cpp: (WebCore::JSCryptoAlgorithmBuilder::add): (WebCore::JSCryptoAlgorithmBuilder::createEmptyClone): Deleted. * bindings/js/JSCryptoAlgorithmBuilder.h: * bindings/js/JSCryptoKeyCustom.cpp: (WebCore::JSCryptoKey::algorithm): Get rid of dependency on CryptoAlgorithmDescriptionBuilder. * crypto/CryptoAlgorithmDescriptionBuilder.cpp: Removed. * crypto/CryptoAlgorithmDescriptionBuilder.h: Removed. Replace it with KeyAlgorithm. * crypto/CryptoKey.cpp: (WebCore::CryptoKey::CryptoKey): (WebCore::CryptoKey::buildAlgorithmDescription): Deleted. * crypto/CryptoKey.h: (WebCore::KeyAlgorithm::KeyAlgorithm): (WebCore::KeyAlgorithm::~KeyAlgorithm): (WebCore::CryptoKey::algorithmIdentifier): * crypto/CryptoKey.idl: Add KeyAlgorithm dictionary which is returned via CryptoKey.buildAlgorithm() method, and rename m_algorithm to m_algorithmIdentifier to distingush it with newly added KeyAlgorithm dictionary. * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp: (WebCore::buildAlgorithm): (WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted. * crypto/keys/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::buildAlgorithm): (WebCore::CryptoKeyAES::buildAlgorithmDescription): Deleted. * crypto/keys/CryptoKeyAES.h: (WebCore::AesKeyAlgorithm::AesKeyAlgorithm): (WebCore::AesKeyAlgorithm::~AesKeyAlgorithm): * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::buildAlgorithm): (WebCore::CryptoKeyHMAC::buildAlgorithmDescription): Deleted. * crypto/keys/CryptoKeyHMAC.h: (WebCore::HmacKeyAlgorithm::HmacKeyAlgorithm): (WebCore::HmacKeyAlgorithm::~HmacKeyAlgorithm): * crypto/keys/CryptoKeyRSA.h: (WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm): (WebCore::RsaKeyAlgorithm::~RsaKeyAlgorithm): (WebCore::RsaHashedKeyAlgorithm::RsaHashedKeyAlgorithm): (WebCore::RsaHashedKeyAlgorithm::~RsaHashedKeyAlgorithm): * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::buildAlgorithm): (WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted. LayoutTests: * crypto/subtle/crypto-key-algorithm-gc-expected.txt: Added. * crypto/subtle/crypto-key-algorithm-gc.html: Added. * crypto/subtle/crypto-key-usages-gc-expected.txt: Added. * crypto/subtle/crypto-key-usages-gc.html: Added. * crypto/subtle/hmac-generate-key-expected.txt: * crypto/subtle/hmac-generate-key.html: Canonical link: https://commits.webkit.org/180131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-09-15 00:19:12 +00:00
Test that CryptoKey.usages preserves custom properties.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Generating a HMAC key with default length...
PASS key.usages === key.usages is true
PASS key.usages.foo is "bar"
PASS successfullyParsed is true
TEST COMPLETE