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

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

Issue 698363002: webcrypto: Add ECDSA algorithm (chromium-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extract_more
Patch Set: rebase + add another test Created 6 years, 1 month 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/structured_clone.cc
diff --git a/content/child/webcrypto/structured_clone.cc b/content/child/webcrypto/structured_clone.cc
index 68d449a065ecf7186b4ba17e587a9293aeb7ee57..f4c0b205a6f6801729d7326a39c0e145547662c4 100644
--- a/content/child/webcrypto/structured_clone.cc
+++ b/content/child/webcrypto/structured_clone.cc
@@ -44,11 +44,15 @@ blink::WebCryptoAlgorithm KeyAlgorithmToImportAlgorithm(
case blink::WebCryptoKeyAlgorithmParamsTypeRsaHashed:
return CreateRsaHashedImportAlgorithm(
algorithm.id(), algorithm.rsaHashedParams()->hash().id());
+ case blink::WebCryptoKeyAlgorithmParamsTypeEc:
+ return CreateEcImportAlgorithm(algorithm.id(),
+ algorithm.ecParams()->namedCurve());
case blink::WebCryptoKeyAlgorithmParamsTypeNone:
break;
default:
break;
}
+ NOTREACHED();
return blink::WebCryptoAlgorithm::createNull();
}
@@ -87,10 +91,14 @@ bool ValidateDeserializedKey(const blink::WebCryptoKey& key,
0)
return false;
break;
+ case blink::WebCryptoKeyAlgorithmParamsTypeEc:
+ return algorithm.ecParams()->namedCurve() ==
+ key.algorithm().ecParams()->namedCurve();
case blink::WebCryptoKeyAlgorithmParamsTypeNone:
case blink::WebCryptoKeyAlgorithmParamsTypeHmac:
break;
default:
+ NOTREACHED();
return false;
}

Powered by Google App Engine
This is Rietveld 408576698