Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: Source/bindings/v8/SerializedScriptValue.cpp

Issue 248963006: [webcrypto] Add key usage for 'deriveBits' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/modules/crypto/Key.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/SerializedScriptValue.cpp
diff --git a/Source/bindings/v8/SerializedScriptValue.cpp b/Source/bindings/v8/SerializedScriptValue.cpp
index 68fb3e3c9dadda4b3ad0a976433819ef78317c31..f71aa8a840771b7567a15b454e8e0bbed49fee84 100644
--- a/Source/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/bindings/v8/SerializedScriptValue.cpp
@@ -293,6 +293,7 @@ enum CryptoKeyUsage {
DeriveKeyUsage = 1 << 5,
WrapKeyUsage = 1 << 6,
UnwrapKeyUsage = 1 << 7,
+ DeriveBitsUsage = 1 << 8,
// Maximum allowed value is 1 << 31
};
@@ -793,7 +794,7 @@ private:
void doWriteKeyUsages(const blink::WebCryptoKeyUsageMask usages, bool extractable)
{
// Reminder to update this when adding new key usages.
- COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 6) + 1, UpdateMe);
+ COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 7) + 1, UpdateMe);
uint32_t value = 0;
@@ -814,6 +815,8 @@ private:
value |= WrapKeyUsage;
if (usages & blink::WebCryptoKeyUsageUnwrapKey)
value |= UnwrapKeyUsage;
+ if (usages & blink::WebCryptoKeyUsageDeriveBits)
+ value |= DeriveBitsUsage;
doWriteUint32(value);
}
@@ -2508,8 +2511,8 @@ private:
bool doReadKeyUsages(blink::WebCryptoKeyUsageMask& usages, bool& extractable)
{
// Reminder to update this when adding new key usages.
- COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 6) + 1, UpdateMe);
- const uint32_t allPossibleUsages = ExtractableUsage | EncryptUsage | DecryptUsage | SignUsage | VerifyUsage | DeriveKeyUsage | WrapKeyUsage | UnwrapKeyUsage;
+ COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 7) + 1, UpdateMe);
+ const uint32_t allPossibleUsages = ExtractableUsage | EncryptUsage | DecryptUsage | SignUsage | VerifyUsage | DeriveKeyUsage | WrapKeyUsage | UnwrapKeyUsage | DeriveBitsUsage;
uint32_t rawUsages;
if (!doReadUint32(&rawUsages))
@@ -2537,6 +2540,8 @@ private:
usages |= blink::WebCryptoKeyUsageWrapKey;
if (rawUsages & UnwrapKeyUsage)
usages |= blink::WebCryptoKeyUsageUnwrapKey;
+ if (rawUsages & DeriveBitsUsage)
+ usages |= blink::WebCryptoKeyUsageDeriveBits;
return true;
}
« no previous file with comments | « no previous file | Source/modules/crypto/Key.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698