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( |