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

Unified Diff: net/socket/ssl_server_socket_nss.cc

Issue 6297008: The SSL server's RSA private key must be imported with the... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « base/crypto/rsa_private_key_nss.cc ('k') | net/socket/ssl_server_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_server_socket_nss.cc
===================================================================
--- net/socket/ssl_server_socket_nss.cc (revision 71518)
+++ net/socket/ssl_server_socket_nss.cc (working copy)
@@ -349,9 +349,15 @@
der_private_key_info.data =
const_cast<unsigned char*>(&key_vector.front());
der_private_key_info.len = key_vector.size();
+ // The server's RSA private key must be imported into NSS with the
+ // following key usage bits:
+ // - KU_KEY_ENCIPHERMENT, required for the RSA key exchange algorithm.
+ // - KU_DIGITAL_SIGNATURE, required for the DHE_RSA and ECDHE_RSA key
+ // exchange algorithms.
+ const unsigned int key_usage = KU_KEY_ENCIPHERMENT | KU_DIGITAL_SIGNATURE;
rv = PK11_ImportDERPrivateKeyInfoAndReturnKey(
slot, &der_private_key_info, NULL, NULL, PR_FALSE, PR_FALSE,
- KU_DIGITAL_SIGNATURE, &private_key, NULL);
+ key_usage, &private_key, NULL);
PK11_FreeSlot(slot);
if (rv != SECSuccess) {
CERT_DestroyCertificate(cert);
Property changes on: net/socket/ssl_server_socket_nss.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « base/crypto/rsa_private_key_nss.cc ('k') | net/socket/ssl_server_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698