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

Unified Diff: Source/modules/crypto/Key.cpp

Issue 295423004: Expose WebCrypto's algorithm normalization. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
Index: Source/modules/crypto/Key.cpp
diff --git a/Source/modules/crypto/Key.cpp b/Source/modules/crypto/Key.cpp
index f15c557fd5f97d1cd76b128390fcb528c77cafc8..89b61789d14716441bcc36ea3a5f2547d6efa4f9 100644
--- a/Source/modules/crypto/Key.cpp
+++ b/Source/modules/crypto/Key.cpp
@@ -95,28 +95,28 @@ blink::WebCryptoKeyUsageMask keyUsageStringToMask(const String& usageString)
return 0;
}
-blink::WebCryptoKeyUsageMask toKeyUsage(AlgorithmOperation operation)
+blink::WebCryptoKeyUsageMask toKeyUsage(blink::AlgorithmOperation operation)
{
switch (operation) {
- case Encrypt:
+ case blink::Encrypt:
return blink::WebCryptoKeyUsageEncrypt;
- case Decrypt:
+ case blink::Decrypt:
return blink::WebCryptoKeyUsageDecrypt;
- case Sign:
+ case blink::Sign:
return blink::WebCryptoKeyUsageSign;
- case Verify:
+ case blink::Verify:
return blink::WebCryptoKeyUsageVerify;
- case DeriveKey:
+ case blink::DeriveKey:
return blink::WebCryptoKeyUsageDeriveKey;
- case DeriveBits:
+ case blink::DeriveBits:
return blink::WebCryptoKeyUsageDeriveBits;
- case WrapKey:
+ case blink::WrapKey:
return blink::WebCryptoKeyUsageWrapKey;
- case UnwrapKey:
+ case blink::UnwrapKey:
return blink::WebCryptoKeyUsageUnwrapKey;
- case Digest:
- case GenerateKey:
- case ImportKey:
+ case blink::Digest:
+ case blink::GenerateKey:
+ case blink::ImportKey:
break;
}
@@ -168,7 +168,7 @@ Vector<String> Key::usages() const
return result;
}
-bool Key::canBeUsedForAlgorithm(const blink::WebCryptoAlgorithm& algorithm, AlgorithmOperation op, CryptoResult* result) const
+bool Key::canBeUsedForAlgorithm(const blink::WebCryptoAlgorithm& algorithm, blink::AlgorithmOperation op, CryptoResult* result) const
{
if (!(m_key.usages() & toKeyUsage(op))) {
result->completeWithError(blink::WebCryptoErrorTypeInvalidAccess, "key.usages does not permit this operation");

Powered by Google App Engine
This is Rietveld 408576698