haikuwebkit/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jw...

19 lines
593 B
Plaintext
Raw Permalink Normal View History

[WebCrypto] RSA algorithms should allow importing keys without usages https://bugs.webkit.org/show_bug.cgi?id=165680 <rdar://problem/29601354> Reviewed by Brent Fulgham. LayoutTests/imported/w3c: * WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt: Source/WebCore: Tests: crypto/subtle/rsa-oaep-import-jwk-public-key-empty-usages.html crypto/subtle/rsa-oaep-import-spki-key-empty-usages.html crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-empty-usages.html crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key-empty-usages.html crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-empty-usages.html crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key-empty-usages.html * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: (WebCore::CryptoAlgorithmRSA_OAEP::importKey): LayoutTests: * crypto/subtle/rsa-oaep-import-jwk-public-key-empty-usages-expected.txt: Added. * crypto/subtle/rsa-oaep-import-jwk-public-key-empty-usages.html: Added. * crypto/subtle/rsa-oaep-import-spki-key-empty-usages-expected.txt: Added. * crypto/subtle/rsa-oaep-import-spki-key-empty-usages.html: Added. * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-empty-usages-expected.txt: Added. * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-empty-usages.html: Added. * crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key-empty-usages-expected.txt: Added. * crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key-empty-usages.html: Added. * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-empty-usages-expected.txt: Added. * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-empty-usages.html: Added. * crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key-empty-usages-expected.txt: Added. * crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key-empty-usages.html: Added. Canonical link: https://commits.webkit.org/183313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-10 08:57:42 +00:00
Test importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-1 and empty usages
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Importing a key...
PASS publicKey.toString() is '[object CryptoKey]'
PASS publicKey.type is 'public'
PASS publicKey.extractable is true
PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
PASS publicKey.algorithm.modulusLength is 2048
PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
PASS publicKey.algorithm.hash.name is 'SHA-1'
PASS publicKey.usages is [ ]
PASS successfullyParsed is true
TEST COMPLETE