[WebCrypto] Get rid of CryptoKeyData class and all its subclasses
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Aug 2017 01:40:54 +0000 (01:40 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Aug 2017 01:40:54 +0000 (01:40 +0000)
commitfb23847709b1e585821d028d82f05eb32ac94fdf
tree118511ec598a37e6077bdfe33e7aa26cfb6613b3
parent627249f234f12b8a69eebcdf1db239a5b898f5bc
[WebCrypto] Get rid of CryptoKeyData class and all its subclasses
https://bugs.webkit.org/show_bug.cgi?id=169806

Reviewed by Chris Dumez.

- Replaces the CryptoKeyData type hierarchy

    CryptoKeyData
      - CryptoKeyDataOctetSequence
      - CryptoKeyDataRSAComponents

  with the renamed CryptoKeyRSAComponents.

- Removes pure virtual exportData function on CryptoKey, and all
  the implementations except the one on CryptoKeyRSA, which now is
  non-virtual, and returns a CryptoKeyRSAComponents. Update the one
  external caller, SerializedScriptValue, to handle this.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/SerializedScriptValue.cpp:
* crypto/CryptoAlgorithm.h:
* crypto/CryptoKey.h:
* crypto/CryptoKeyData.h: Removed.
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::create):
(WebCore::CryptoKeyRSA::exportData const):
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::exportData const): Deleted.
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyDataOctetSequence.cpp: Removed.
* crypto/keys/CryptoKeyDataOctetSequence.h: Removed.
* crypto/keys/CryptoKeyDataRSAComponents.cpp: Removed.
* crypto/keys/CryptoKeyDataRSAComponents.h: Removed.
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::CryptoKeyEC::exportData const): Deleted.
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::exportData const): Deleted.
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
(WebCore::CryptoKeyRSA::exportJwk const):
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeyRSAComponents.cpp: Copied from crypto/keys/CryptoKeyDataRSAComponents.cpp.
(WebCore::CryptoKeyRSAComponents::CryptoKeyRSAComponents):
(WebCore::CryptoKeyRSAComponents::~CryptoKeyRSAComponents):
(WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents): Deleted.
(WebCore::CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents): Deleted.
* crypto/keys/CryptoKeyRSAComponents.h: Copied from crypto/keys/CryptoKeyDataRSAComponents.h.
(WebCore::CryptoKeyRSAComponents::createPublic):
(WebCore::CryptoKeyRSAComponents::createPrivate):
(WebCore::CryptoKeyRSAComponents::createPrivateWithAdditionalData):
* crypto/keys/CryptoKeyRaw.cpp:
(WebCore::CryptoKeyRaw::exportData const): Deleted.
* crypto/keys/CryptoKeyRaw.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPrivateKeyComponents):
(WebCore::CryptoKeyRSA::create):
(WebCore::CryptoKeyRSA::exportData const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/crypto/CryptoAlgorithm.h
Source/WebCore/crypto/CryptoKey.h
Source/WebCore/crypto/CryptoKeyData.h [deleted file]
Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp
Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
Source/WebCore/crypto/keys/CryptoKeyAES.cpp
Source/WebCore/crypto/keys/CryptoKeyAES.h
Source/WebCore/crypto/keys/CryptoKeyDataOctetSequence.cpp [deleted file]
Source/WebCore/crypto/keys/CryptoKeyDataOctetSequence.h [deleted file]
Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.h [deleted file]
Source/WebCore/crypto/keys/CryptoKeyEC.cpp
Source/WebCore/crypto/keys/CryptoKeyEC.h
Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp
Source/WebCore/crypto/keys/CryptoKeyHMAC.h
Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
Source/WebCore/crypto/keys/CryptoKeyRSA.h
Source/WebCore/crypto/keys/CryptoKeyRSAComponents.cpp [moved from Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.cpp with 60% similarity]
Source/WebCore/crypto/keys/CryptoKeyRSAComponents.h [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoKeyRaw.cpp
Source/WebCore/crypto/keys/CryptoKeyRaw.h
Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp