Changeset 159068 in webkit
- Timestamp:
- Nov 11, 2013 1:20:20 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r159001 r159068 282 282 283 283 crypto/CryptoKey.idl 284 crypto/CryptoKeyPair.idl 284 285 crypto/SubtleCrypto.idl 285 286 -
trunk/Source/WebCore/ChangeLog
r159065 r159068 1 2013-11-11 Alexey Proskuryakov <ap@apple.com> 2 3 Support WebCrypto KeyPair interface 4 https://bugs.webkit.org/show_bug.cgi?id=124161 5 6 Reviewed by Geoffrey Garen. 7 8 No new tests yet, will be tested once generateKey is implemented for any RSA algorithms. 9 10 * CMakeLists.txt: 11 * DerivedSources.make: 12 * GNUmakefile.list.am: 13 * WebCore.xcodeproj/project.pbxproj: 14 Added new files. 15 16 * bindings/js/JSDOMPromise.h: Support returning a key pair via a promise. 17 18 * bindings/js/JSCryptoKeyPairCustom.cpp: Added. 19 (WebCore::JSCryptoKeyPair::visitChildren): 20 * crypto/CryptoKey.idl: 21 CryptoKey wrapper is reachable through KeyPair, but it doesn't have (or need) 22 a back pointer. 23 24 * crypto/CryptoKeyPair.cpp: Added. 25 (WebCore::CryptoKeyPair::CryptoKeyPair): 26 (WebCore::CryptoKeyPair::~CryptoKeyPair): 27 * crypto/CryptoKeyPair.h: Added. 28 (WebCore::CryptoKeyPair::create): 29 (WebCore::CryptoKeyPair::publicKey): 30 (WebCore::CryptoKeyPair::privateKey): 31 * crypto/CryptoKeyPair.idl: Added. 32 1 33 2013-11-11 Nick Diego Yamane <nick.yamane@openbossa.org> 2 34 -
trunk/Source/WebCore/DerivedSources.make
r158821 r159068 200 200 $(WebCore)/Modules/websockets/WebSocket.idl \ 201 201 $(WebCore)/crypto/CryptoKey.idl \ 202 $(WebCore)/crypto/CryptoKeyPair.idl \ 202 203 $(WebCore)/crypto/SubtleCrypto.idl \ 203 204 $(WebCore)/css/CSSCharsetRule.idl \ -
trunk/Source/WebCore/GNUmakefile.list.am
r159001 r159068 153 153 DerivedSources/WebCore/JSCryptoKey.cpp \ 154 154 DerivedSources/WebCore/JSCryptoKey.h \ 155 DerivedSources/WebCore/JSCryptoKeyPair.cpp \ 156 DerivedSources/WebCore/JSCryptoKeyPair.h \ 155 157 DerivedSources/WebCore/JSCustomEvent.cpp \ 156 158 DerivedSources/WebCore/JSCustomEvent.h \ … … 1292 1294 $(WebCore)/Modules/websockets/WebSocket.idl \ 1293 1295 $(WebCore)/crypto/CryptoKey.idl \ 1296 $(WebCore)/crypto/CryptoKeyPair.idl \ 1294 1297 $(WebCore)/crypto/SubtleCrypto.idl \ 1295 1298 $(WebCore)/css/CSSCharsetRule.idl \ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r159001 r159068 5699 5699 E1F1E82F0C3C2BB9006DB391 /* XSLTExtensions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F1E82D0C3C2BB9006DB391 /* XSLTExtensions.cpp */; }; 5700 5700 E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */; }; 5701 E1F80B8718317252007885C3 /* CryptoKeyPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F80B8518317252007885C3 /* CryptoKeyPair.cpp */; }; 5702 E1F80B8818317252007885C3 /* CryptoKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F80B8618317252007885C3 /* CryptoKeyPair.h */; }; 5703 E1F80B8A183172A2007885C3 /* JSCryptoKeyPairCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F80B89183172A2007885C3 /* JSCryptoKeyPairCustom.cpp */; }; 5704 E1F80B8D183172B5007885C3 /* JSCryptoKeyPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */; }; 5705 E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */; }; 5701 5706 E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5702 5707 E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; }; … … 12781 12786 E1F1E82D0C3C2BB9006DB391 /* XSLTExtensions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTExtensions.cpp; sourceTree = "<group>"; }; 12782 12787 E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLTExtensions.h; sourceTree = "<group>"; }; 12788 E1F80B8418317247007885C3 /* CryptoKeyPair.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoKeyPair.idl; sourceTree = "<group>"; }; 12789 E1F80B8518317252007885C3 /* CryptoKeyPair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyPair.cpp; sourceTree = "<group>"; }; 12790 E1F80B8618317252007885C3 /* CryptoKeyPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyPair.h; sourceTree = "<group>"; }; 12791 E1F80B89183172A2007885C3 /* JSCryptoKeyPairCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyPairCustom.cpp; sourceTree = "<group>"; }; 12792 E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyPair.cpp; sourceTree = "<group>"; }; 12793 E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoKeyPair.h; sourceTree = "<group>"; }; 12783 12794 E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGlobalData.h; sourceTree = "<group>"; }; 12784 12795 E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGlobalData.cpp; sourceTree = "<group>"; }; … … 19583 19594 209B456A16796A7E00E54E4E /* JSCryptoCustom.cpp */, 19584 19595 E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */, 19596 E1F80B89183172A2007885C3 /* JSCryptoKeyPairCustom.cpp */, 19585 19597 BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */, 19586 19598 AD726FE916D9F40A003A4E6D /* JSCSSRuleCustom.h */, … … 20486 20498 E157A8E318173A3A009F821D /* CryptoKey.h */, 20487 20499 E125F85D182C2DF600D84CD9 /* CryptoKeyData.h */, 20500 E1F80B8518317252007885C3 /* CryptoKeyPair.cpp */, 20501 E1F80B8618317252007885C3 /* CryptoKeyPair.h */, 20502 E1F80B8418317247007885C3 /* CryptoKeyPair.idl */, 20488 20503 E125F855182C0F8300D84CD9 /* CryptoKeySerialization.h */, 20489 20504 E19727151820549E00592D51 /* CryptoKeyType.h */, … … 20501 20516 E157A8DE1817331C009F821D /* JSCryptoKey.cpp */, 20502 20517 E157A8DF1817331C009F821D /* JSCryptoKey.h */, 20518 E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */, 20519 E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */, 20503 20520 E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */, 20504 20521 E1FF8F63180745D800132674 /* JSSubtleCrypto.h */, … … 22181 22198 BC772B3C0C4EA91E0083285F /* CSSHelper.h in Headers */, 22182 22199 FB49C39D16784947007FFB5D /* CSSHostRule.h in Headers */, 22200 E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */, 22183 22201 BC23EE920DAED2BC009FDC91 /* CSSImageGeneratorValue.h in Headers */, 22184 22202 9393E600151A99F200066F06 /* CSSImageSetValue.h in Headers */, … … 24216 24234 BCEA488C097D93020094C9E4 /* RenderText.h in Headers */, 24217 24235 AB67D1A9097F3AE300F9392E /* RenderTextControl.h in Headers */, 24236 E1F80B8818317252007885C3 /* CryptoKeyPair.h in Headers */, 24218 24237 083DAEA70F01A7FB00342754 /* RenderTextControlMultiLine.h in Headers */, 24219 24238 083DAEA90F01A7FB00342754 /* RenderTextControlSingleLine.h in Headers */, … … 25845 25864 85CA96B90A9621A600690CCF /* DOMEntity.mm in Sources */, 25846 25865 85089CDE0A98C42800A275AA /* DOMEntityReference.mm in Sources */, 25866 E1F80B8D183172B5007885C3 /* JSCryptoKeyPair.cpp in Sources */, 25847 25867 BC1BDF24156C1883001C1243 /* DOMError.cpp in Sources */, 25848 25868 85AFA8230AAF528A00E84305 /* DOMEvent.mm in Sources */, … … 26378 26398 4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */, 26379 26399 7AA51B6F1483B61600AD2752 /* InspectorBaseAgent.cpp in Sources */, 26400 E1F80B8A183172A2007885C3 /* JSCryptoKeyPairCustom.cpp in Sources */, 26380 26401 AAD766EB157E502F00E85423 /* InspectorCanvasAgent.cpp in Sources */, 26381 26402 7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */, … … 27476 27497 51D719E9181106E00016DC51 /* IDBPendingTransactionMonitor.cpp in Sources */, 27477 27498 FD3160AC12B026F700C1A359 /* ReverbInputBuffer.cpp in Sources */, 27499 E1F80B8718317252007885C3 /* CryptoKeyPair.cpp in Sources */, 27478 27500 BC74DA381013F3F7007987AD /* RGBColor.cpp in Sources */, 27479 27501 A8CFF5E70A155A05000A4234 /* RootInlineBox.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/JSCryptoKeyPairCustom.cpp
r159067 r159068 24 24 */ 25 25 26 enum KeyType { 27 "secret", 28 "public", 29 "private" 30 }; 26 #include "config.h" 27 #include "JSCryptoKeyPair.h" 31 28 32 enum KeyUsage { 33 "encrypt", 34 "decrypt", 35 "sign", 36 "verify", 37 "deriveKey", 38 "deriveBits", 39 "wrapKey", 40 "unwrapKey" 41 }; 29 #if ENABLE(SUBTLE_CRYPTO) 42 30 43 [ 44 Conditional=SUBTLE_CRYPTO, 45 InterfaceName=Key, 46 NoInterfaceObject, 47 SkipVTableValidation 48 ] interface CryptoKey { 49 readonly attribute KeyType type; 50 readonly attribute boolean extractable; 51 [Custom] readonly attribute Algorithm algorithm; 52 readonly attribute KeyUsage[] usages; 53 }; 31 using namespace JSC; 32 33 namespace WebCore { 34 35 void JSCryptoKeyPair::visitChildren(JSCell* cell, SlotVisitor& visitor) 36 { 37 JSCryptoKeyPair* thisObject = jsCast<JSCryptoKeyPair*>(cell); 38 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 39 COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); 40 ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); 41 Base::visitChildren(thisObject, visitor); 42 43 visitor.addOpaqueRoot(thisObject->m_impl->publicKey()); 44 visitor.addOpaqueRoot(thisObject->m_impl->privateKey()); 45 } 46 47 } // namespace WebCore 48 49 #endif // ENABLE(SUBTLE_CRYPTO) -
trunk/Source/WebCore/bindings/js/JSDOMPromise.h
r158485 r159068 28 28 29 29 #include "JSCryptoKey.h" 30 #include "JSCryptoKeyPair.h" 30 31 #include "JSDOMBinding.h" 31 32 #include <runtime/JSGlobalObject.h> -
trunk/Source/WebCore/crypto/CryptoKey.idl
r159061 r159068 43 43 [ 44 44 Conditional=SUBTLE_CRYPTO, 45 GenerateIsReachable=Impl, 45 46 InterfaceName=Key, 46 47 NoInterfaceObject, -
trunk/Source/WebCore/crypto/CryptoKeyPair.cpp
r159067 r159068 24 24 */ 25 25 26 enum KeyType { 27 "secret", 28 "public", 29 "private" 30 }; 26 #include "config.h" 27 #include "CryptoKeyPair.h" 31 28 32 enum KeyUsage { 33 "encrypt", 34 "decrypt", 35 "sign", 36 "verify", 37 "deriveKey", 38 "deriveBits", 39 "wrapKey", 40 "unwrapKey" 41 }; 29 #if ENABLE(SUBTLE_CRYPTO) 42 30 43 [ 44 Conditional=SUBTLE_CRYPTO, 45 InterfaceName=Key, 46 NoInterfaceObject, 47 SkipVTableValidation 48 ] interface CryptoKey { 49 readonly attribute KeyType type; 50 readonly attribute boolean extractable; 51 [Custom] readonly attribute Algorithm algorithm; 52 readonly attribute KeyUsage[] usages; 53 }; 31 namespace WebCore { 32 33 CryptoKeyPair::CryptoKeyPair(PassRefPtr<CryptoKey> publicKey, PassRefPtr<CryptoKey> privateKey) 34 : m_publicKey(publicKey) 35 , m_privateKey(privateKey) 36 { 37 } 38 39 CryptoKeyPair::~CryptoKeyPair() 40 { 41 } 42 43 } // namespace WebCore 44 45 #endif // ENABLE(SUBTLE_CRYPTO) -
trunk/Source/WebCore/crypto/CryptoKeyPair.h
r159067 r159068 24 24 */ 25 25 26 enum KeyType { 27 "secret", 28 "public", 29 "private" 26 #ifndef CryptoKeyPair_h 27 #define CryptoKeyPair_h 28 29 #include "CryptoKey.h" 30 #include <wtf/PassRefPtr.h> 31 #include <wtf/RefCounted.h> 32 #include <wtf/RefPtr.h> 33 34 #if ENABLE(SUBTLE_CRYPTO) 35 36 namespace WebCore { 37 38 class CryptoKeyPair : public RefCounted<CryptoKeyPair> { 39 public: 40 static PassRefPtr<CryptoKeyPair> create(PassRefPtr<CryptoKey> publicKey, PassRefPtr<CryptoKey> privateKey) 41 { 42 return adoptRef(new CryptoKeyPair(publicKey, privateKey)); 43 } 44 ~CryptoKeyPair(); 45 46 CryptoKey* publicKey() { return m_publicKey.get(); } 47 CryptoKey* privateKey() { return m_privateKey.get(); } 48 49 private: 50 CryptoKeyPair(PassRefPtr<CryptoKey> publicKey, PassRefPtr<CryptoKey> privateKey); 51 52 RefPtr<CryptoKey> m_publicKey; 53 RefPtr<CryptoKey> m_privateKey; 30 54 }; 31 55 32 enum KeyUsage { 33 "encrypt", 34 "decrypt", 35 "sign", 36 "verify", 37 "deriveKey", 38 "deriveBits", 39 "wrapKey", 40 "unwrapKey" 41 }; 56 } // namespace WebCore 42 57 43 [ 44 Conditional=SUBTLE_CRYPTO, 45 InterfaceName=Key, 46 NoInterfaceObject, 47 SkipVTableValidation 48 ] interface CryptoKey { 49 readonly attribute KeyType type; 50 readonly attribute boolean extractable; 51 [Custom] readonly attribute Algorithm algorithm; 52 readonly attribute KeyUsage[] usages; 53 }; 58 #endif // ENABLE(SUBTLE_CRYPTO) 59 #endif // CryptoKeyPair_h -
trunk/Source/WebCore/crypto/CryptoKeyPair.idl
r159067 r159068 24 24 */ 25 25 26 enum KeyType {27 "secret",28 "public",29 "private"30 };31 32 enum KeyUsage {33 "encrypt",34 "decrypt",35 "sign",36 "verify",37 "deriveKey",38 "deriveBits",39 "wrapKey",40 "unwrapKey"41 };42 43 26 [ 44 27 Conditional=SUBTLE_CRYPTO, 45 InterfaceName=Key, 28 ImplementationLacksVTable, 29 InterfaceName=KeyPair, 30 JSCustomMarkFunction, 46 31 NoInterfaceObject, 47 SkipVTableValidation 48 ] interface CryptoKey { 49 readonly attribute KeyType type; 50 readonly attribute boolean extractable; 51 [Custom] readonly attribute Algorithm algorithm; 52 readonly attribute KeyUsage[] usages; 32 OperationsNotDeletable 33 ] interface CryptoKeyPair { 34 readonly attribute CryptoKey publicKey; 35 readonly attribute CryptoKey privateKey; 53 36 };
Note: See TracChangeset
for help on using the changeset viewer.