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

Unified Diff: chrome/browser/renderer_host/resource_message_filter.cc

Issue 652137: Mac: implement <keygen> support, including adding generated cert to the Keychain. (Closed)
Patch Set: Responding to review feedback. Created 10 years, 10 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: chrome/browser/renderer_host/resource_message_filter.cc
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 70ab6e94f52103638302394a2aee12dfda52d41b..687049dcd879d896b98f26a7401cf38b923928c4 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -1332,10 +1332,23 @@ void ResourceMessageFilter::OnKeygen(uint32 key_size_index,
const std::string& challenge_string,
const GURL& url,
std::string* signed_public_key) {
- scoped_ptr<net::KeygenHandler> keygen_handler(
- new net::KeygenHandler(key_size_index,
- challenge_string));
- *signed_public_key = keygen_handler->GenKeyAndSignChallenge();
+ // Map displayed strings indicating level of keysecurity in the <keygen>
+ // menu to the key size in bits. (See SSLKeyGeneratorChromium.cpp in WebCore.)
+ int key_size_in_bits;
+ switch (key_size_index) {
+ case 0:
+ key_size_in_bits = 2048;
+ break;
+ case 1:
+ key_size_in_bits = 1024;
+ break;
+ default:
+ DCHECK(false) << "Illegal key_size_index " << key_size_index;
+ *signed_public_key = std::string();
+ return;
+ }
+ net::KeygenHandler keygen_handler(key_size_in_bits, challenge_string);
+ *signed_public_key = keygen_handler.GenKeyAndSignChallenge();
}
void ResourceMessageFilter::OnTranslateText(

Powered by Google App Engine
This is Rietveld 408576698