Changeset 160502 in webkit
- Timestamp:
- Dec 12, 2013, 12:12:10 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r160496 r160502 1 2013-12-12 Alexey Proskuryakov <ap@apple.com> 2 3 Add support for RSAES-PKCS1-v1_5 4 https://bugs.webkit.org/show_bug.cgi?id=125647 5 6 Reviewed by Anders Carlsson. 7 8 * crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Added. 9 * crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html: Added. 10 * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Added. 11 * crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Added. 12 1 13 2013-12-12 Alexey Proskuryakov <ap@apple.com> 2 14 -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r160498 r160502 1 2013-12-12 Alexey Proskuryakov <ap@apple.com> 2 3 Add support for RSAES-PKCS1-v1_5 4 https://bugs.webkit.org/show_bug.cgi?id=125647 5 6 Reviewed by Anders Carlsson. 7 8 Tests: crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html 9 crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html 10 11 * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: 12 * crypto/algorithms/CryptoAlgorithmAES_KW.h: 13 Removed meaningless parameters arguments from private functions. The base arguments 14 class is always empty. 15 16 * WebCore.xcodeproj/project.pbxproj: 17 * bindings/js/JSCryptoAlgorithmDictionary.cpp: 18 (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): 19 (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): 20 * bindings/js/JSCryptoKeySerializationJWK.cpp: 21 (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm): 22 (WebCore::JSCryptoKeySerializationJWK::keySizeIsValid): 23 (WebCore::JSCryptoKeySerializationJWK::addJWKAlgorithmToJSON): 24 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: Added. 25 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5): 26 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5): 27 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::create): 28 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::identifier): 29 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::keyAlgorithmMatches): 30 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt): 31 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt): 32 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey): 33 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): 34 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: Added. 35 * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp: Added. 36 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): 37 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): 38 * crypto/mac/CryptoAlgorithmRegistryMac.cpp: 39 (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): 40 Added support for this algorithm. 41 1 42 2013-12-12 Andreas Kling <akling@apple.com> 2 43 -
TabularUnified trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj ¶
r160487 r160502 5556 5556 E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5557 5557 E11C9DB00EB3699500E409DB /* ScriptExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */; }; 5558 E1233F0C185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */; }; 5559 E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */ = {isa = PBXBuildFile; fileRef = E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */; }; 5560 E1233F10185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */; }; 5558 5561 E124748410AA161D00B79493 /* AuthenticationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E124748310AA161D00B79493 /* AuthenticationClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5559 5562 E125F82B1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F8291822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp */; }; … … 12698 12701 E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptExecutionContext.h; sourceTree = "<group>"; }; 12699 12702 E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptExecutionContext.cpp; sourceTree = "<group>"; }; 12703 E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSAES_PKCS1_v1_5.cpp; sourceTree = "<group>"; }; 12704 E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRSAES_PKCS1_v1_5.h; sourceTree = "<group>"; }; 12705 E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp; path = mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp; sourceTree = "<group>"; }; 12700 12706 E124748310AA161D00B79493 /* AuthenticationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationClient.h; sourceTree = "<group>"; }; 12701 12707 E125F8291822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmSHA1.cpp; sourceTree = "<group>"; }; … … 20503 20509 E1BB84AC1822CA7400525043 /* CryptoAlgorithmRegistryMac.cpp */, 20504 20510 E1C266D618317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp */, 20511 E1233F0E185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp */, 20505 20512 E1FE136E183FECF000892F13 /* CryptoAlgorithmRSA_OAEPMac.cpp */, 20506 20513 E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */, … … 20522 20529 E1FE1368183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.cpp */, 20523 20530 E1FE1369183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h */, 20531 E1233F0A185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp */, 20532 E1233F0B185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h */, 20524 20533 E1BD3317182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp */, 20525 20534 E1BD3318182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h */, … … 24422 24431 BCEA4880097D93020094C9E4 /* RenderObject.h in Headers */, 24423 24432 BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */, 24433 E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */, 24424 24434 A43BF59D1149292800C643CA /* RenderProgress.h in Headers */, 24425 24435 5A574F25131DB93900471B88 /* RenderQuote.h in Headers */, … … 27853 27863 14C9A5EA0B3D105F005A0232 /* Settings.cpp in Sources */, 27854 27864 E1C2F24A1533A2120083F974 /* SettingsMac.mm in Sources */, 27865 E1233F0C185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.cpp in Sources */, 27855 27866 0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */, 27856 27867 BC5EB8C30E82031B00B25965 /* ShadowData.cpp in Sources */, … … 28208 28219 B2AFFC990D00A5DF0030074D /* TextCodecMac.cpp in Sources */, 28209 28220 B2C3DA3F0D006C1D00EF6F26 /* TextCodecUserDefined.cpp in Sources */, 28221 E1233F10185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp in Sources */, 28210 28222 B2C3DA410D006C1D00EF6F26 /* TextCodecUTF16.cpp in Sources */, 28211 28223 E1FF8F6C180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp in Sources */, -
TabularUnified trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp ¶
r160455 r160502 302 302 switch (algorithm) { 303 303 case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: 304 return std::make_unique<CryptoAlgorithmParameters>(); 304 305 case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: 305 306 case CryptoAlgorithmIdentifier::RSA_PSS: … … 341 342 switch (algorithm) { 342 343 case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: 344 return std::make_unique<CryptoAlgorithmParameters>(); 343 345 case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: 344 346 case CryptoAlgorithmIdentifier::RSA_PSS: -
TabularUnified trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp ¶
r160061 r160502 191 191 algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5); 192 192 parameters = createRSAKeyParametersWithHash(CryptoAlgorithmIdentifier::SHA_512); 193 } else if (m_jwkAlgorithmName == "RSA1_5") { 194 algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5); 195 parameters = std::make_unique<CryptoAlgorithmParameters>(); 193 196 } else if (m_jwkAlgorithmName == "RSA-OAEP") { 194 197 algorithm = CryptoAlgorithmRegistry::shared().create(CryptoAlgorithmIdentifier::RSA_OAEP); … … 322 325 if (m_jwkAlgorithmName == "RS512") 323 326 return sizeInBits >= 2048; 327 if (m_jwkAlgorithmName == "RSA1_5") 328 return sizeInBits >= 2048; 324 329 if (m_jwkAlgorithmName == "RSA_OAEP") 325 330 return sizeInBits >= 2048; … … 592 597 break; 593 598 } 599 case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: { 600 const CryptoKeyRSA& rsaKey = toCryptoKeyRSA(key); 601 if (rsaKey.keySizeInBits() < 2048) 602 break; 603 jwkAlgorithm = "RSA1_5"; 604 break; 605 } 594 606 case CryptoAlgorithmIdentifier::RSA_OAEP: { 595 607 const CryptoKeyRSA& rsaKey = toCryptoKeyRSA(key); -
TabularUnified trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp ¶
r160491 r160502 56 56 } 57 57 58 bool CryptoAlgorithmAES_KW::keyAlgorithmMatches(const Crypto AlgorithmParameters&, const CryptoKey& key) const58 bool CryptoAlgorithmAES_KW::keyAlgorithmMatches(const CryptoKey& key) const 59 59 { 60 60 if (key.algorithmIdentifier() != s_identifier) … … 65 65 } 66 66 67 void CryptoAlgorithmAES_KW::encryptForWrapKey(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)67 void CryptoAlgorithmAES_KW::encryptForWrapKey(const CryptoAlgorithmParameters&, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec) 68 68 { 69 if (!keyAlgorithmMatches( parameters,key)) {69 if (!keyAlgorithmMatches(key)) { 70 70 ec = NOT_SUPPORTED_ERR; 71 71 return; … … 75 75 } 76 76 77 void CryptoAlgorithmAES_KW::decryptForUnwrapKey(const CryptoAlgorithmParameters& parameters, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec)77 void CryptoAlgorithmAES_KW::decryptForUnwrapKey(const CryptoAlgorithmParameters&, const CryptoKey& key, const CryptoOperationData& data, VectorCallback callback, VoidCallback failureCallback, ExceptionCode& ec) 78 78 { 79 if (!keyAlgorithmMatches( parameters,key)) {79 if (!keyAlgorithmMatches(key)) { 80 80 ec = NOT_SUPPORTED_ERR; 81 81 return; -
TabularUnified trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h ¶
r159966 r160502 53 53 virtual ~CryptoAlgorithmAES_KW(); 54 54 55 bool keyAlgorithmMatches(const Crypto AlgorithmParameters&, const CryptoKey&) const;55 bool keyAlgorithmMatches(const CryptoKey&) const; 56 56 void platformEncrypt(const CryptoKeyAES&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&); 57 57 void platformDecrypt(const CryptoKeyAES&, const CryptoOperationData&, VectorCallback, VoidCallback failureCallback, ExceptionCode&); -
TabularUnified trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp ¶
r159966 r160502 32 32 #include "CryptoAlgorithmAES_KW.h" 33 33 #include "CryptoAlgorithmHMAC.h" 34 #include "CryptoAlgorithmRSAES_PKCS1_v1_5.h" 34 35 #include "CryptoAlgorithmRSASSA_PKCS1_v1_5.h" 35 36 #include "CryptoAlgorithmRSA_OAEP.h" … … 47 48 registerAlgorithm<CryptoAlgorithmAES_KW>(); 48 49 registerAlgorithm<CryptoAlgorithmHMAC>(); 50 registerAlgorithm<CryptoAlgorithmRSAES_PKCS1_v1_5>(); 49 51 registerAlgorithm<CryptoAlgorithmRSASSA_PKCS1_v1_5>(); 50 52 registerAlgorithm<CryptoAlgorithmRSA_OAEP>();
Note:
See TracChangeset
for help on using the changeset viewer.