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

Unified Diff: Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.cpp

Issue 21044004: WebCrypto: Fix an un-initialized value in the mock implementation of importKey() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | « LayoutTests/crypto/importKey.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.cpp
index a7d2aca22db2cddd45aef084a3da749742eadcd3..56a46d0bccd1884aada261cac9baf3e6a0d37c2c 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebCrypto.cpp
@@ -117,17 +117,14 @@ void MockWebCrypto::importKey(WebKit::WebCryptoKeyFormat, const unsigned char* k
{
std::string keyDataString(reinterpret_cast<const char*>(keyData), keyDataSize);
- WebKit::WebCryptoKeyType type;
if (keyDataString == "reject") {
result.completeWithError();
} else if (keyDataString == "throw") {
result.initializationFailed();
} else {
- if (keyDataString == "public") {
+ WebKit::WebCryptoKeyType type = WebKit::WebCryptoKeyTypePrivate;
+ if (keyDataString == "public")
type = WebKit::WebCryptoKeyTypePublic;
- } else if (keyDataString == "private") {
- type = WebKit::WebCryptoKeyTypePrivate;
- }
result.completeWithKey(WebKit::WebCryptoKey::create(0, type, extractable, algorithm, usages));
}
}
« no previous file with comments | « LayoutTests/crypto/importKey.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698