Diff
Modified: trunk/Source/WebCore/ChangeLog (218029 => 218030)
--- trunk/Source/WebCore/ChangeLog 2017-06-10 00:00:25 UTC (rev 218029)
+++ trunk/Source/WebCore/ChangeLog 2017-06-10 00:08:28 UTC (rev 218030)
@@ -1,3 +1,37 @@
+2017-06-09 Jiewen Tan <[email protected]>
+
+ [WebCrypto] Remove unsupported CryptoAlgorithmIdentifier
+ https://bugs.webkit.org/show_bug.cgi?id=173128
+ <rdar://problem/32666826>
+
+ Reviewed by Brent Fulgham.
+
+ This patch remove AES_CMAC, DH and CONCAT as they are not implemented and not recommended
+ by the spec. Hence there is no plan to support them in short term.
+
+ No change of behaviour.
+
+ * bindings/js/JSCryptoAlgorithmDictionary.cpp:
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
+ (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey):
+ * bindings/js/JSSubtleCryptoCustom.cpp:
+ (WebCore::normalizeCryptoAlgorithmParameters):
+ (WebCore::supportExportKeyThrow):
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneSerializer::write):
+ (WebCore::CloneDeserializer::read):
+ * crypto/CryptoAlgorithmIdentifier.h:
+ * crypto/keys/CryptoKeyAES.cpp:
+ (WebCore::CryptoKeyAES::isValidAESAlgorithm):
+
2017-06-09 Daniel Bates <[email protected]>
Implement W3C Secure Contexts Draft Specification
Modified: trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp (218029 => 218030)
--- trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp 2017-06-10 00:00:25 UTC (rev 218029)
+++ trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp 2017-06-10 00:08:28 UTC (rev 218030)
@@ -316,7 +316,6 @@
return nullptr;
case CryptoAlgorithmIdentifier::AES_CBC:
return createAesCbcParams(state, value);
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
throwNotSupportedError(state, scope);
@@ -324,13 +323,11 @@
case CryptoAlgorithmIdentifier::AES_KW:
return adoptRef(*new CryptoAlgorithmParametersDeprecated);
case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -358,7 +355,6 @@
return nullptr;
case CryptoAlgorithmIdentifier::AES_CBC:
return createAesCbcParams(state, value);
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
throwNotSupportedError(state, scope);
@@ -366,13 +362,11 @@
case CryptoAlgorithmIdentifier::AES_KW:
return adoptRef(*new CryptoAlgorithmParametersDeprecated);
case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -396,7 +390,6 @@
case CryptoAlgorithmIdentifier::ECDH:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
@@ -404,13 +397,11 @@
return nullptr;
case CryptoAlgorithmIdentifier::HMAC:
return createHmacParams(state, value);
- case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -434,7 +425,6 @@
case CryptoAlgorithmIdentifier::ECDH:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
@@ -442,13 +432,11 @@
return nullptr;
case CryptoAlgorithmIdentifier::HMAC:
return createHmacParams(state, value);
- case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -469,12 +457,10 @@
case CryptoAlgorithmIdentifier::ECDH:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::DH:
throwNotSupportedError(state, scope);
return nullptr;
case CryptoAlgorithmIdentifier::SHA_1:
@@ -483,7 +469,6 @@
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
return adoptRef(*new CryptoAlgorithmParametersDeprecated);
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -507,7 +492,6 @@
return nullptr;
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
@@ -514,13 +498,11 @@
return createAesKeyGenParams(state, value);
case CryptoAlgorithmIdentifier::HMAC:
return createHmacKeyParams(state, value);
- case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -541,18 +523,15 @@
case CryptoAlgorithmIdentifier::ECDH:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -573,18 +552,15 @@
case CryptoAlgorithmIdentifier::ECDH:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::DH:
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -606,7 +582,6 @@
case CryptoAlgorithmIdentifier::ECDH:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
@@ -613,14 +588,11 @@
return adoptRef(*new CryptoAlgorithmParametersDeprecated);
case CryptoAlgorithmIdentifier::HMAC:
return createHmacParams(state, value);
- case CryptoAlgorithmIdentifier::DH:
- return adoptRef(*new CryptoAlgorithmParametersDeprecated);
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
@@ -641,12 +613,10 @@
case CryptoAlgorithmIdentifier::ECDH:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
case CryptoAlgorithmIdentifier::HMAC:
- case CryptoAlgorithmIdentifier::DH:
return adoptRef(*new CryptoAlgorithmParametersDeprecated);
case CryptoAlgorithmIdentifier::SHA_1:
case CryptoAlgorithmIdentifier::SHA_224:
@@ -653,7 +623,6 @@
case CryptoAlgorithmIdentifier::SHA_256:
case CryptoAlgorithmIdentifier::SHA_384:
case CryptoAlgorithmIdentifier::SHA_512:
- case CryptoAlgorithmIdentifier::CONCAT:
case CryptoAlgorithmIdentifier::HKDF:
case CryptoAlgorithmIdentifier::PBKDF2:
throwNotSupportedError(state, scope);
Modified: trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp (218029 => 218030)
--- trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp 2017-06-10 00:00:25 UTC (rev 218029)
+++ trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp 2017-06-10 00:08:28 UTC (rev 218030)
@@ -205,7 +205,6 @@
}
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW: {
@@ -287,7 +286,6 @@
}
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
@@ -332,7 +330,6 @@
switch (*identifier) {
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW: {
@@ -509,7 +506,6 @@
case CryptoAlgorithmIdentifier::RSA_OAEP:
case CryptoAlgorithmIdentifier::AES_CTR:
case CryptoAlgorithmIdentifier::AES_CBC:
- case CryptoAlgorithmIdentifier::AES_CMAC:
case CryptoAlgorithmIdentifier::AES_GCM:
case CryptoAlgorithmIdentifier::AES_CFB:
case CryptoAlgorithmIdentifier::AES_KW:
Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (218029 => 218030)
--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2017-06-10 00:00:25 UTC (rev 218029)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2017-06-10 00:08:28 UTC (rev 218030)
@@ -230,20 +230,17 @@
ECDH = 5,
AES_CTR = 6,
AES_CBC = 7,
- AES_CMAC = 8,
- AES_GCM = 9,
- AES_CFB = 10,
- AES_KW = 11,
- HMAC = 12,
- DH = 13,
- SHA_1 = 14,
- SHA_224 = 15,
- SHA_256 = 16,
- SHA_384 = 17,
- SHA_512 = 18,
- CONCAT = 19,
- HKDF = 20,
- PBKDF2 = 21,
+ AES_GCM = 8,
+ AES_CFB = 9,
+ AES_KW = 10,
+ HMAC = 11,
+ SHA_1 = 12,
+ SHA_224 = 13,
+ SHA_256 = 14,
+ SHA_384 = 15,
+ SHA_512 = 16,
+ HKDF = 17,
+ PBKDF2 = 18,
};
const uint8_t cryptoAlgorithmIdentifierTagMaximumValue = 21;
@@ -1137,9 +1134,6 @@
case CryptoAlgorithmIdentifier::AES_CBC:
write(CryptoAlgorithmIdentifierTag::AES_CBC);
break;
- case CryptoAlgorithmIdentifier::AES_CMAC:
- write(CryptoAlgorithmIdentifierTag::AES_CMAC);
- break;
case CryptoAlgorithmIdentifier::AES_GCM:
write(CryptoAlgorithmIdentifierTag::AES_GCM);
break;
@@ -1152,9 +1146,6 @@
case CryptoAlgorithmIdentifier::HMAC:
write(CryptoAlgorithmIdentifierTag::HMAC);
break;
- case CryptoAlgorithmIdentifier::DH:
- write(CryptoAlgorithmIdentifierTag::DH);
- break;
case CryptoAlgorithmIdentifier::SHA_1:
write(CryptoAlgorithmIdentifierTag::SHA_1);
break;
@@ -1170,9 +1161,6 @@
case CryptoAlgorithmIdentifier::SHA_512:
write(CryptoAlgorithmIdentifierTag::SHA_512);
break;
- case CryptoAlgorithmIdentifier::CONCAT:
- write(CryptoAlgorithmIdentifierTag::CONCAT);
- break;
case CryptoAlgorithmIdentifier::HKDF:
write(CryptoAlgorithmIdentifierTag::HKDF);
break;
@@ -2039,9 +2027,6 @@
case CryptoAlgorithmIdentifierTag::AES_CBC:
result = CryptoAlgorithmIdentifier::AES_CBC;
break;
- case CryptoAlgorithmIdentifierTag::AES_CMAC:
- result = CryptoAlgorithmIdentifier::AES_CMAC;
- break;
case CryptoAlgorithmIdentifierTag::AES_GCM:
result = CryptoAlgorithmIdentifier::AES_GCM;
break;
@@ -2054,9 +2039,6 @@
case CryptoAlgorithmIdentifierTag::HMAC:
result = CryptoAlgorithmIdentifier::HMAC;
break;
- case CryptoAlgorithmIdentifierTag::DH:
- result = CryptoAlgorithmIdentifier::DH;
- break;
case CryptoAlgorithmIdentifierTag::SHA_1:
result = CryptoAlgorithmIdentifier::SHA_1;
break;
@@ -2072,9 +2054,6 @@
case CryptoAlgorithmIdentifierTag::SHA_512:
result = CryptoAlgorithmIdentifier::SHA_512;
break;
- case CryptoAlgorithmIdentifierTag::CONCAT:
- result = CryptoAlgorithmIdentifier::CONCAT;
- break;
case CryptoAlgorithmIdentifierTag::HKDF:
result = CryptoAlgorithmIdentifier::HKDF;
break;
Modified: trunk/Source/WebCore/crypto/CryptoAlgorithmIdentifier.h (218029 => 218030)
--- trunk/Source/WebCore/crypto/CryptoAlgorithmIdentifier.h 2017-06-10 00:00:25 UTC (rev 218029)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithmIdentifier.h 2017-06-10 00:08:28 UTC (rev 218030)
@@ -38,18 +38,15 @@
ECDH,
AES_CTR,
AES_CBC,
- AES_CMAC,
AES_GCM,
AES_CFB,
AES_KW,
HMAC,
- DH,
SHA_1,
SHA_224,
SHA_256,
SHA_384,
SHA_512,
- CONCAT,
HKDF,
PBKDF2
};
Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp (218029 => 218030)
--- trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp 2017-06-10 00:00:25 UTC (rev 218029)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp 2017-06-10 00:08:28 UTC (rev 218030)
@@ -66,7 +66,6 @@
{
return algorithm == CryptoAlgorithmIdentifier::AES_CTR
|| algorithm == CryptoAlgorithmIdentifier::AES_CBC
- || algorithm == CryptoAlgorithmIdentifier::AES_CMAC
|| algorithm == CryptoAlgorithmIdentifier::AES_GCM
|| algorithm == CryptoAlgorithmIdentifier::AES_CFB
|| algorithm == CryptoAlgorithmIdentifier::AES_KW;