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

Unified Diff: Source/testing/runner/MockWebCrypto.cpp

Issue 23617006: WebCrypto: Add the KeyPair interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 7 years, 4 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 | « Source/modules/modules.gypi ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/testing/runner/MockWebCrypto.cpp
diff --git a/Source/testing/runner/MockWebCrypto.cpp b/Source/testing/runner/MockWebCrypto.cpp
index 7e90909c52f7da81ef090ba294abffcacd95cf74..48e9a2209f7058e2ca53d6f47d613aa98d7f0a54 100644
--- a/Source/testing/runner/MockWebCrypto.cpp
+++ b/Source/testing/runner/MockWebCrypto.cpp
@@ -104,7 +104,11 @@ void MockWebCrypto::digest(const WebKit::WebCryptoAlgorithm& algorithm, const un
void MockWebCrypto::generateKey(const WebKit::WebCryptoAlgorithm& algorithm, bool extractable, WebKit::WebCryptoKeyUsageMask usages, WebKit::WebCryptoResult result)
{
- result.completeWithKey(WebKit::WebCryptoKey::create(0, WebKit::WebCryptoKeyTypePrivate, extractable, algorithm, usages));
+ if (algorithm.id() == WebKit::WebCryptoAlgorithmIdRsaSsaPkcs1v1_5) {
+ result.completeWithKeyPair(WebKit::WebCryptoKey::create(0, WebKit::WebCryptoKeyTypePublic, extractable, algorithm, usages), WebKit::WebCryptoKey::create(0, WebKit::WebCryptoKeyTypePrivate, extractable, algorithm, usages));
+ } else {
+ result.completeWithKey(WebKit::WebCryptoKey::create(0, WebKit::WebCryptoKeyTypePrivate, extractable, algorithm, usages));
+ }
}
void MockWebCrypto::importKey(WebKit::WebCryptoKeyFormat, const unsigned char* keyData, size_t keyDataSize, const WebKit::WebCryptoAlgorithm& algorithm, bool extractable, WebKit::WebCryptoKeyUsageMask usages, WebKit::WebCryptoResult result)
« no previous file with comments | « Source/modules/modules.gypi ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698