Changeset 159393 in webkit
- Timestamp:
- Nov 17, 2013, 5:18:43 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r159392 r159393 1 2013-11-17 Alexey Proskuryakov <ap@apple.com> 2 3 RSASSA-PKCS1-v1_5 JWK import doesn't check key size 4 https://bugs.webkit.org/show_bug.cgi?id=124472 5 6 Reviewed by Sam Weinig. 7 8 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt: Added. 9 * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html: Added. 10 1 11 2013-11-17 Alexey Proskuryakov <ap@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r159392 r159393 1 2013-11-17 Alexey Proskuryakov <ap@apple.com> 2 3 RSASSA-PKCS1-v1_5 JWK import doesn't check key size 4 https://bugs.webkit.org/show_bug.cgi?id=124472 5 6 Reviewed by Sam Weinig. 7 8 Test: crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html 9 10 * bindings/js/JSCryptoKeySerializationJWK.cpp: 11 (WebCore::JSCryptoKeySerializationJWK::keySizeIsValid): Added the checks. 12 (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents): Check key size when 13 importing. 14 (WebCore::JSCryptoKeySerializationJWK::serialize): Updated a comment. 15 16 * crypto/keys/CryptoKeySerializationRaw.cpp: (WebCore::CryptoKeySerializationRaw::serialize): 17 Updated a comment. 18 1 19 2013-11-17 Alexey Proskuryakov <ap@apple.com> 2 20 -
trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp
r159390 r159393 278 278 if (m_jwkAlgorithmName == "A256CBC") 279 279 return sizeInBits == 256; 280 if (m_jwkAlgorithmName == "RS256") 281 return sizeInBits >= 2048; 282 if (m_jwkAlgorithmName == "RS384") 283 return sizeInBits >= 2048; 284 if (m_jwkAlgorithmName == "RS512") 285 return sizeInBits >= 2048; 280 286 return true; 281 287 } … … 313 319 if (!m_exec->hadException()) 314 320 throwTypeError(m_exec, "Required JWK \"n\" member is missing"); 321 return nullptr; 322 } 323 324 if (!keySizeIsValid(modulus.size() * 8)) { 325 throwTypeError(m_exec, "Key size is not valid for " + m_jwkAlgorithmName); 315 326 return nullptr; 316 327 } … … 505 516 std::unique_ptr<CryptoKeyData> keyData = key.exportData(); 506 517 if (!keyData) { 507 // FIXME: Shouldn't happen once all key types implement exportData().508 throwTypeError(exec, " Key doesn't support exportKey");518 // This generally shouldn't happen as long as all key types implement exportData(), but as underlying libraries return errors, there may be some rare failure conditions. 519 throwTypeError(exec, "Couldn't export key material"); 509 520 return String(); 510 521 } -
trunk/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.cpp
r159390 r159393 66 66 std::unique_ptr<CryptoKeyData> keyData = key.exportData(); 67 67 if (!keyData) { 68 // FIXME: Shouldn't happen once all key types implement exportData().68 // This generally shouldn't happen as long as all key types implement exportData(), but as underlying libraries return errors, there may be some rare failure conditions. 69 69 return false; 70 70 }
Note:
See TracChangeset
for help on using the changeset viewer.