Changeset 160547 in webkit
- Timestamp:
- Dec 13, 2013 11:10:54 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r160544 r160547 1 2013-12-13 Alexey Proskuryakov <ap@apple.com> 2 3 WebCrypto Key.usages should be ordered alphabetically 4 https://bugs.webkit.org/show_bug.cgi?id=125696 5 6 Reviewed by Darin Adler. 7 8 * crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt: 9 * crypto/subtle/aes-cbc-192-encrypt-decrypt.html: 10 * crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt: 11 * crypto/subtle/aes-cbc-256-encrypt-decrypt.html: 12 * crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt: 13 * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt: 14 * crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html: 15 * crypto/subtle/aes-cbc-encrypt-decrypt.html: 16 * crypto/subtle/aes-cbc-generate-key-expected.txt: 17 * crypto/subtle/aes-cbc-generate-key.html: 18 * crypto/subtle/aes-cbc-invalid-length-expected.txt: 19 * crypto/subtle/aes-cbc-invalid-length.html: 20 * crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt: 21 * crypto/subtle/aes-kw-wrap-unwrap-aes.html: 22 * crypto/subtle/aes-postMessage-expected.txt: 23 * crypto/subtle/aes-postMessage.html: 24 * crypto/subtle/hmac-postMessage-expected.txt: 25 * crypto/subtle/hmac-postMessage.html: 26 * crypto/subtle/jwk-import-use-values-expected.txt: 27 * crypto/subtle/jwk-import-use-values.html: 28 * crypto/subtle/postMessage-worker-expected.txt: 29 * crypto/subtle/postMessage-worker.html: 30 * crypto/subtle/resources/postMessage-worker.js: 31 (onmessage): 32 * crypto/subtle/rsa-oaep-key-manipulation-expected.txt: 33 * crypto/subtle/rsa-oaep-key-manipulation.html: 34 * crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt: 35 * crypto/subtle/rsa-oaep-wrap-unwrap-aes.html: 36 * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: 37 * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: 38 1 39 2013-12-13 Rob Buis <rob.buis@samsung.com> 2 40 -
trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt
r160491 r160547 9 9 PASS key.algorithm.name is 'AES-CBC' 10 10 PASS key.algorithm.length is 192 11 PASS key.usages is [' encrypt', 'decrypt']11 PASS key.usages is ['decrypt', 'encrypt'] 12 12 Using the key to encrypt plaintext... 13 13 PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176' -
trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html
r160491 r160547 26 26 shouldBe("key.algorithm.name", "'AES-CBC'"); 27 27 shouldBe("key.algorithm.length", "192"); 28 shouldBe("key.usages", "[' encrypt', 'decrypt']");28 shouldBe("key.usages", "['decrypt', 'encrypt']"); 29 29 30 30 debug("Using the key to encrypt plaintext..."); -
trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt
r160491 r160547 9 9 PASS key.algorithm.name is 'AES-CBC' 10 10 PASS key.algorithm.length is 256 11 PASS key.usages is [' encrypt', 'decrypt']11 PASS key.usages is ['decrypt', 'encrypt'] 12 12 Using the key to encrypt plaintext... 13 13 PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644' -
trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html
r160491 r160547 26 26 shouldBe("key.algorithm.name", "'AES-CBC'"); 27 27 shouldBe("key.algorithm.length", "256"); 28 shouldBe("key.usages", "[' encrypt', 'decrypt']");28 shouldBe("key.usages", "['decrypt', 'encrypt']"); 29 29 30 30 debug("Using the key to encrypt plaintext..."); -
trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt
r160491 r160547 9 9 PASS key.algorithm.name is 'AES-CBC' 10 10 PASS key.algorithm.length is 128 11 PASS key.usages is [' encrypt', 'decrypt']11 PASS key.usages is ['decrypt', 'encrypt'] 12 12 Using the key to encrypt plaintext... 13 13 PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012' -
trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt
r160491 r160547 9 9 PASS key.algorithm.name is 'AES-CBC' 10 10 PASS key.algorithm.length is 128 11 PASS key.usages is [' encrypt', 'decrypt']11 PASS key.usages is ['decrypt', 'encrypt'] 12 12 Using the key to encrypt plaintext... 13 13 PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d' -
trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html
r160491 r160547 26 26 shouldBe("key.algorithm.name", "'AES-CBC'"); 27 27 shouldBe("key.algorithm.length", "128"); 28 shouldBe("key.usages", "[' encrypt', 'decrypt']");28 shouldBe("key.usages", "['decrypt', 'encrypt']"); 29 29 30 30 debug("Using the key to encrypt plaintext..."); -
trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html
r160491 r160547 26 26 shouldBe("key.algorithm.name", "'AES-CBC'"); 27 27 shouldBe("key.algorithm.length", "128"); 28 shouldBe("key.usages", "[' encrypt', 'decrypt']");28 shouldBe("key.usages", "['decrypt', 'encrypt']"); 29 29 30 30 debug("Using the key to encrypt plaintext..."); -
trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt
r160491 r160547 13 13 PASS key.algorithm.name is 'AES-CBC' 14 14 PASS key.algorithm.length is 128 15 PASS key.usages is [' encrypt', 'decrypt']15 PASS key.usages is ['decrypt', 'encrypt'] 16 16 PASS successfullyParsed is true 17 17 -
trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html
r160491 r160547 29 29 shouldBe("key.algorithm.name", "'AES-CBC'"); 30 30 shouldBe("key.algorithm.length", "128"); 31 shouldBe("key.usages", "[' encrypt', 'decrypt']");31 shouldBe("key.usages", "['decrypt', 'encrypt']"); 32 32 33 33 finishJSTest(); -
trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt
r160491 r160547 9 9 PASS key.algorithm.name is 'AES-CBC' 10 10 PASS key.algorithm.length is 176 11 PASS key.usages is [' encrypt', 'decrypt']11 PASS key.usages is ['decrypt', 'encrypt'] 12 12 Using the key to encrypt plaintext... 13 13 Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail. -
trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html
r160491 r160547 26 26 shouldBe("key.algorithm.name", "'AES-CBC'"); 27 27 shouldBe("key.algorithm.length", "176"); 28 shouldBe("key.usages", "[' encrypt', 'decrypt']");28 shouldBe("key.usages", "['decrypt', 'encrypt']"); 29 29 30 30 debug("Using the key to encrypt plaintext..."); -
trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt
r160491 r160547 14 14 PASS unwrappedKey.algorithm.name is 'AES-CBC' 15 15 PASS unwrappedKey.algorithm.length is 128 16 PASS unwrappedKey.usages is [' encrypt', 'decrypt', 'wrapKey', 'unwrapKey']16 PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey'] 17 17 Exporting it... 18 18 PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData) … … 25 25 PASS unwrappedKey.algorithm.name is 'AES-CBC' 26 26 PASS unwrappedKey.algorithm.length is 128 27 PASS unwrappedKey.usages is [' encrypt', 'decrypt', 'wrapKey', 'unwrapKey']27 PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey'] 28 28 Exporting it... 29 29 PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData) -
trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html
r160491 r160547 42 42 shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'"); 43 43 shouldBe("unwrappedKey.algorithm.length", "128"); 44 shouldBe("unwrappedKey.usages", "[' encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");44 shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']"); 45 45 46 46 debug("Exporting it..."); … … 64 64 shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'"); 65 65 shouldBe("unwrappedKey.algorithm.length", "128"); 66 shouldBe("unwrappedKey.usages", "[' encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");66 shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']"); 67 67 68 68 debug("Exporting it..."); -
trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt
r160491 r160547 8 8 PASS key.algorithm.name is 'AES-CBC' 9 9 PASS key.algorithm.length is 128 10 PASS key.usages is [" encrypt", "decrypt", "sign", "verify"]10 PASS key.usages is ["decrypt", "encrypt", "sign", "verify"] 11 11 PASS successfullyParsed is true 12 12 -
trunk/LayoutTests/crypto/subtle/aes-postMessage.html
r160491 r160547 19 19 shouldBe("key.algorithm.name", "'AES-CBC'"); 20 20 shouldBe("key.algorithm.length", "128"); 21 shouldBe("key.usages", '[" encrypt", "decrypt", "sign", "verify"]');21 shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]'); 22 22 23 23 finishJSTest(); -
trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt
r160491 r160547 8 8 PASS key.algorithm.name is 'HMAC' 9 9 PASS key.algorithm.length is 16 10 PASS key.usages is [" encrypt", "decrypt", "sign", "verify"]10 PASS key.usages is ["decrypt", "encrypt", "sign", "verify"] 11 11 PASS successfullyParsed is true 12 12 -
trunk/LayoutTests/crypto/subtle/hmac-postMessage.html
r160491 r160547 19 19 shouldBe("key.algorithm.name", "'HMAC'"); 20 20 shouldBe("key.algorithm.length", "16"); 21 shouldBe("key.usages", '[" encrypt", "decrypt", "sign", "verify"]');21 shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]'); 22 22 23 23 finishJSTest(); -
trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt
r160061 r160547 11 11 12 12 enconly,deconly: 13 PASS key.usages is [" encrypt","decrypt"]13 PASS key.usages is ["decrypt","encrypt"] 14 14 15 15 wrap: … … 20 20 21 21 wrap,unwrap: 22 PASS key.usages is [" wrapKey","unwrapKey"]22 PASS key.usages is ["unwrapKey","wrapKey"] 23 23 24 24 enconly,deconly,wrap: 25 PASS key.usages is [" encrypt","decrypt","wrapKey"]25 PASS key.usages is ["decrypt","encrypt","wrapKey"] 26 26 27 27 enc: 28 PASS key.usages is [" encrypt","decrypt","wrapKey","unwrapKey"]28 PASS key.usages is ["decrypt","encrypt","unwrapKey","wrapKey"] 29 29 30 30 sigonly: … … 50 50 51 51 enconly,,deconly: 52 PASS key.usages is [" encrypt","decrypt"]52 PASS key.usages is ["decrypt","encrypt"] 53 53 54 54 PASS successfullyParsed is true -
trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html
r160061 r160547 55 55 testWithAESCBC(["encrypt"], "enconly"), 56 56 testWithAESCBC(["decrypt"], "deconly"), 57 testWithAESCBC([" encrypt", "decrypt"], "enconly,deconly"),57 testWithAESCBC(["decrypt", "encrypt"], "enconly,deconly"), 58 58 testWithAESCBC(["wrapKey"], "wrap"), 59 59 testWithAESCBC(["unwrapKey"], "unwrap"), 60 testWithAESCBC([" wrapKey", "unwrapKey"], "wrap,unwrap"),61 testWithAESCBC([" encrypt", "decrypt", "wrapKey"], "enconly,deconly,wrap"),62 testWithAESCBC([" encrypt", "decrypt", "wrapKey", "unwrapKey"], "enc"),60 testWithAESCBC(["unwrapKey", "wrapKey"], "wrap,unwrap"), 61 testWithAESCBC(["decrypt", "encrypt", "wrapKey"], "enconly,deconly,wrap"), 62 testWithAESCBC(["decrypt", "encrypt", "unwrapKey", "wrapKey"], "enc"), 63 63 testWithHMAC(["sign"], "sigonly"), 64 64 testWithHMAC(["verify"], "vfyonly"), … … 70 70 testWithAESCBC([], "EncOnly"), 71 71 testWithAESCBC(["encrypt"], "enconly, deconly"), 72 testWithAESCBC([" encrypt", "decrypt"], "enconly,,deconly"),72 testWithAESCBC(["decrypt","encrypt"], "enconly,,deconly"), 73 73 74 74 ]).then(function() { finishJSTest(); } ); -
trunk/LayoutTests/crypto/subtle/postMessage-worker-expected.txt
r160491 r160547 9 9 PASS key.algorithm.name is 'HMAC' 10 10 PASS key.algorithm.length is 16 11 PASS key.usages is [" encrypt", "decrypt", "sign", "verify"]11 PASS key.usages is ["decrypt", "encrypt", "sign", "verify"] 12 12 PASS successfullyParsed is true 13 13 -
trunk/LayoutTests/crypto/subtle/postMessage-worker.html
r160491 r160547 25 25 shouldBe("key.algorithm.name", "'HMAC'"); 26 26 shouldBe("key.algorithm.length", "16"); 27 shouldBe("key.usages", '[" encrypt", "decrypt", "sign", "verify"]');27 shouldBe("key.usages", '["decrypt", "encrypt", "sign", "verify"]'); 28 28 } 29 29 finishJSTest(); -
trunk/LayoutTests/crypto/subtle/resources/postMessage-worker.js
r160491 r160547 8 8 else if (key.algorithm.name != "HMAC") 9 9 postMessage({ result:false, message:'key.algorithm.name should be "HMAC"' }); 10 else if (key.usages.toString() != " encrypt,decrypt,sign,verify")11 postMessage({ result:false, message:'key.usages should be [" encrypt", "decrypt", "sign", "verify"]' });10 else if (key.usages.toString() != "decrypt,encrypt,sign,verify") 11 postMessage({ result:false, message:'key.usages should be ["decrypt", "encrypt", "sign", "verify"]' }); 12 12 else 13 13 postMessage({ result:true, key:key }); -
trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt
r160491 r160547 39 39 PASS exportedPublicKey.algorithm.hash.name is 'SHA-1' 40 40 PASS exportedPublicKey.extractable is true 41 PASS exportedPublicKey.usages is [' encrypt','decrypt','wrapKey','unwrapKey']41 PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey'] 42 42 PASS successfullyParsed is true 43 43 -
trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html
r160491 r160547 71 71 shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'"); 72 72 shouldBe("exportedPublicKey.extractable", "true"); 73 shouldBe("exportedPublicKey.usages", "[' encrypt','decrypt','wrapKey','unwrapKey']");73 shouldBe("exportedPublicKey.usages", "['decrypt','encrypt','unwrapKey','wrapKey']"); 74 74 75 75 finishJSTest(); -
trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt
r160491 r160547 14 14 PASS unwrappedKey.algorithm.name is 'AES-CBC' 15 15 PASS unwrappedKey.algorithm.length is 256 16 PASS unwrappedKey.usages is [' encrypt', 'decrypt']16 PASS unwrappedKey.usages is ['decrypt', 'encrypt'] 17 17 Exporting it... 18 18 PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData) … … 26 26 PASS unwrappedKey.algorithm.name is 'AES-CBC' 27 27 PASS unwrappedKey.algorithm.length is 256 28 PASS unwrappedKey.usages is [' encrypt', 'decrypt']28 PASS unwrappedKey.usages is ['decrypt', 'encrypt'] 29 29 Exporting it... 30 30 PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData) -
trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html
r160491 r160547 65 65 shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'"); 66 66 shouldBe("unwrappedKey.algorithm.length", "256"); 67 shouldBe("unwrappedKey.usages", "[' encrypt', 'decrypt']");67 shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']"); 68 68 69 69 debug("Exporting it..."); … … 88 88 shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'"); 89 89 shouldBe("unwrappedKey.algorithm.length", "256"); 90 shouldBe("unwrappedKey.usages", "[' encrypt', 'decrypt']");90 shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']"); 91 91 92 92 debug("Exporting it..."); -
trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt
r160502 r160547 14 14 PASS unwrappedKey.algorithm.name is 'AES-CBC' 15 15 PASS unwrappedKey.algorithm.length is 256 16 PASS unwrappedKey.usages is [' encrypt', 'decrypt']16 PASS unwrappedKey.usages is ['decrypt', 'encrypt'] 17 17 Exporting it... 18 18 PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData) … … 26 26 PASS unwrappedKey.algorithm.name is 'AES-CBC' 27 27 PASS unwrappedKey.algorithm.length is 256 28 PASS unwrappedKey.usages is [' encrypt', 'decrypt']28 PASS unwrappedKey.usages is ['decrypt', 'encrypt'] 29 29 Exporting it... 30 30 PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData) -
trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
r160502 r160547 65 65 shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'"); 66 66 shouldBe("unwrappedKey.algorithm.length", "256"); 67 shouldBe("unwrappedKey.usages", "[' encrypt', 'decrypt']");67 shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']"); 68 68 69 69 debug("Exporting it..."); … … 88 88 shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'"); 89 89 shouldBe("unwrappedKey.algorithm.length", "256"); 90 shouldBe("unwrappedKey.usages", "[' encrypt', 'decrypt']");90 shouldBe("unwrappedKey.usages", "['decrypt', 'encrypt']"); 91 91 92 92 debug("Exporting it..."); -
trunk/Source/WebCore/ChangeLog
r160546 r160547 1 2013-12-13 Alexey Proskuryakov <ap@apple.com> 2 3 WebCrypto Key.usages should be ordered alphabetically 4 https://bugs.webkit.org/show_bug.cgi?id=125696 5 6 Reviewed by Darin Adler. 7 8 * crypto/CryptoKey.cpp: (WebCore::CryptoKey::usages): Do it. 9 1 10 2013-12-13 Darin Adler <darin@apple.com> 2 11 -
trunk/Source/WebCore/crypto/CryptoKey.cpp
r159390 r160547 68 68 Vector<String> CryptoKey::usages() const 69 69 { 70 // The result is ordered alphabetically. 70 71 Vector<String> result; 72 if (m_usages & CryptoKeyUsageDecrypt) 73 result.append(ASCIILiteral("decrypt")); 74 if (m_usages & CryptoKeyUsageDeriveBits) 75 result.append(ASCIILiteral("deriveBits")); 76 if (m_usages & CryptoKeyUsageDeriveKey) 77 result.append(ASCIILiteral("deriveKey")); 71 78 if (m_usages & CryptoKeyUsageEncrypt) 72 79 result.append(ASCIILiteral("encrypt")); 73 if (m_usages & CryptoKeyUsageDecrypt)74 result.append(ASCIILiteral("decrypt"));75 80 if (m_usages & CryptoKeyUsageSign) 76 81 result.append(ASCIILiteral("sign")); 82 if (m_usages & CryptoKeyUsageUnwrapKey) 83 result.append(ASCIILiteral("unwrapKey")); 77 84 if (m_usages & CryptoKeyUsageVerify) 78 85 result.append(ASCIILiteral("verify")); 79 if (m_usages & CryptoKeyUsageDeriveKey)80 result.append(ASCIILiteral("deriveKey"));81 if (m_usages & CryptoKeyUsageDeriveBits)82 result.append(ASCIILiteral("deriveBits"));83 86 if (m_usages & CryptoKeyUsageWrapKey) 84 87 result.append(ASCIILiteral("wrapKey")); 85 if (m_usages & CryptoKeyUsageUnwrapKey)86 result.append(ASCIILiteral("unwrapKey"));87 88 88 89 return result;
Note: See TracChangeset
for help on using the changeset viewer.