| Index: Source/platform/exported/WebCryptoAlgorithm.cpp
|
| diff --git a/Source/platform/exported/WebCryptoAlgorithm.cpp b/Source/platform/exported/WebCryptoAlgorithm.cpp
|
| index 35b1e0ac28a58c6093b3ce662be919c17a547d50..38333ff9d174de258bdc69c7d9782f13a2923b90 100644
|
| --- a/Source/platform/exported/WebCryptoAlgorithm.cpp
|
| +++ b/Source/platform/exported/WebCryptoAlgorithm.cpp
|
| @@ -239,6 +239,20 @@ const WebCryptoAlgorithmInfo algorithmIdToInfo[] = {
|
| WebCryptoAlgorithmParamsTypeNone, // WrapKey
|
| WebCryptoAlgorithmParamsTypeNone // UnwrapKey
|
| }
|
| + }, { // Index 14
|
| + "HKDF", {
|
| + WebCryptoAlgorithmInfo::Undefined, // Encrypt
|
| + WebCryptoAlgorithmInfo::Undefined, // Decrypt
|
| + WebCryptoAlgorithmInfo::Undefined, // Sign
|
| + WebCryptoAlgorithmInfo::Undefined, // Verify
|
| + WebCryptoAlgorithmInfo::Undefined, // Digest
|
| + WebCryptoAlgorithmInfo::Undefined, // GenerateKey
|
| + WebCryptoAlgorithmParamsTypeNone, // ImportKey
|
| + WebCryptoAlgorithmParamsTypeNone, // GetKeyLength
|
| + WebCryptoAlgorithmParamsTypeHkdfParams, // DeriveBits
|
| + WebCryptoAlgorithmInfo::Undefined, // WrapKey
|
| + WebCryptoAlgorithmInfo::Undefined // UnwrapKey
|
| + }
|
| },
|
| };
|
|
|
| @@ -259,7 +273,8 @@ static_assert(WebCryptoAlgorithmIdAesKw == 10, "AESKW id must match");
|
| static_assert(WebCryptoAlgorithmIdRsaPss == 11, "RSA-PSS id must match");
|
| static_assert(WebCryptoAlgorithmIdEcdsa == 12, "ECDSA id must match");
|
| static_assert(WebCryptoAlgorithmIdEcdh == 13, "ECDH id must match");
|
| -static_assert(WebCryptoAlgorithmIdLast == 13, "last id must match");
|
| +static_assert(WebCryptoAlgorithmIdHkdf == 14, "HKDF id must match");
|
| +static_assert(WebCryptoAlgorithmIdLast == 14, "last id must match");
|
| static_assert(10 == WebCryptoOperationLast, "the parameter mapping needs to be updated");
|
|
|
| } // namespace
|
| @@ -437,6 +452,14 @@ const WebCryptoAesDerivedKeyParams* WebCryptoAlgorithm::aesDerivedKeyParams() co
|
| return 0;
|
| }
|
|
|
| +const WebCryptoHkdfParams* WebCryptoAlgorithm::hkdfParams() const
|
| +{
|
| + ASSERT(!isNull());
|
| + if (paramsType() == WebCryptoAlgorithmParamsTypeHkdfParams)
|
| + return static_cast<WebCryptoHkdfParams*>(m_private->params.get());
|
| + return 0;
|
| +}
|
| +
|
| bool WebCryptoAlgorithm::isHash(WebCryptoAlgorithmId id)
|
| {
|
| switch (id) {
|
| @@ -455,6 +478,7 @@ bool WebCryptoAlgorithm::isHash(WebCryptoAlgorithmId id)
|
| case WebCryptoAlgorithmIdRsaPss:
|
| case WebCryptoAlgorithmIdEcdsa:
|
| case WebCryptoAlgorithmIdEcdh:
|
| + case WebCryptoAlgorithmIdHkdf:
|
| break;
|
| }
|
| return false;
|
|
|