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

Unified Diff: content/child/webcrypto/shared_crypto.cc

Issue 272033003: [refactor] Change ordering of wrapkey parameters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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: content/child/webcrypto/shared_crypto.cc
diff --git a/content/child/webcrypto/shared_crypto.cc b/content/child/webcrypto/shared_crypto.cc
index 81c66cf983f80d3d7444f09624cf21b77fe41b14..7d4704fc656ec7aca87fdefa3ffe22201bd70608 100644
--- a/content/child/webcrypto/shared_crypto.cc
+++ b/content/child/webcrypto/shared_crypto.cc
@@ -375,8 +375,8 @@ Status UnwrapKeyRaw(const CryptoData& wrapped_key_data,
}
}
-Status WrapKeyRaw(const blink::WebCryptoKey& wrapping_key,
- const blink::WebCryptoKey& key_to_wrap,
+Status WrapKeyRaw(const blink::WebCryptoKey& key_to_wrap,
+ const blink::WebCryptoKey& wrapping_key,
const blink::WebCryptoAlgorithm& wrapping_algorithm,
std::vector<uint8>* buffer) {
// A raw key is always a symmetric key.
@@ -393,7 +393,7 @@ Status WrapKeyRaw(const blink::WebCryptoKey& wrapping_key,
if (status.IsError())
return status;
return platform::WrapSymKeyAesKw(
- platform_wrapping_key, platform_key, buffer);
+ platform_key, platform_wrapping_key, buffer);
}
case blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5: {
platform::PublicKey* platform_wrapping_key;
@@ -401,7 +401,7 @@ Status WrapKeyRaw(const blink::WebCryptoKey& wrapping_key,
if (status.IsError())
return status;
return platform::WrapSymKeyRsaEs(
- platform_wrapping_key, platform_key, buffer);
+ platform_key, platform_wrapping_key, buffer);
}
default:
return Status::ErrorUnsupported();
@@ -484,8 +484,8 @@ Status UnwrapKeyDecryptAndImport(
Status WrapKeyExportAndEncrypt(
blink::WebCryptoKeyFormat format,
- const blink::WebCryptoKey& wrapping_key,
const blink::WebCryptoKey& key_to_wrap,
+ const blink::WebCryptoKey& wrapping_key,
const blink::WebCryptoAlgorithm& wrapping_algorithm,
std::vector<uint8>* buffer) {
std::vector<uint8> exported_data;
@@ -751,8 +751,8 @@ Status VerifySignature(const blink::WebCryptoAlgorithm& algorithm,
}
Status WrapKey(blink::WebCryptoKeyFormat format,
- const blink::WebCryptoKey& wrapping_key,
const blink::WebCryptoKey& key_to_wrap,
+ const blink::WebCryptoKey& wrapping_key,
const blink::WebCryptoAlgorithm& wrapping_algorithm,
std::vector<uint8>* buffer) {
if (!KeyUsageAllows(wrapping_key, blink::WebCryptoKeyUsageWrapKey))
@@ -762,10 +762,10 @@ Status WrapKey(blink::WebCryptoKeyFormat format,
switch (format) {
case blink::WebCryptoKeyFormatRaw:
- return WrapKeyRaw(wrapping_key, key_to_wrap, wrapping_algorithm, buffer);
+ return WrapKeyRaw(key_to_wrap, wrapping_key, wrapping_algorithm, buffer);
case blink::WebCryptoKeyFormatJwk:
return WrapKeyExportAndEncrypt(
- format, wrapping_key, key_to_wrap, wrapping_algorithm, buffer);
+ format, key_to_wrap, wrapping_key, wrapping_algorithm, buffer);
case blink::WebCryptoKeyFormatSpki:
case blink::WebCryptoKeyFormatPkcs8:
return Status::ErrorUnsupported(); // TODO(padolph)

Powered by Google App Engine
This is Rietveld 408576698