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

Side by Side Diff: net/socket/ssl_server_socket_nss.cc

Issue 383593002: Add GetSystemNSSKeySlot, merge GetPrivateNSSKeySlot/GetPublicNSSKeySlot to GetPersistentNSSKeySlot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use GetPersistentNSSKeySlot instead of GetDefaultNSSKeySlot Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/ssl_server_socket_nss.h" 5 #include "net/socket/ssl_server_socket_nss.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <winsock2.h> 8 #include <winsock2.h>
9 #endif 9 #endif
10 10
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 } 439 }
440 440
441 // Get a key of SECKEYPrivateKey* structure. 441 // Get a key of SECKEYPrivateKey* structure.
442 std::vector<uint8> key_vector; 442 std::vector<uint8> key_vector;
443 if (!key_->ExportPrivateKey(&key_vector)) { 443 if (!key_->ExportPrivateKey(&key_vector)) {
444 CERT_DestroyCertificate(cert); 444 CERT_DestroyCertificate(cert);
445 return ERR_UNEXPECTED; 445 return ERR_UNEXPECTED;
446 } 446 }
447 447
448 SECKEYPrivateKeyStr* private_key = NULL; 448 SECKEYPrivateKeyStr* private_key = NULL;
449 PK11SlotInfo* slot = crypto::GetPrivateNSSKeySlot(); 449 PK11SlotInfo* slot = PK11_GetInternalSlot();
pneubeck (no reviews) 2014/07/10 09:44:11 This changed from PK11_GetInternalKeySlot to PK11_
mattm 2014/07/10 22:20:45 Right. This function only imports a temporary key,
450 if (!slot) { 450 if (!slot) {
451 CERT_DestroyCertificate(cert); 451 CERT_DestroyCertificate(cert);
452 return ERR_UNEXPECTED; 452 return ERR_UNEXPECTED;
453 } 453 }
454 454
455 SECItem der_private_key_info; 455 SECItem der_private_key_info;
456 der_private_key_info.data = 456 der_private_key_info.data =
457 const_cast<unsigned char*>(&key_vector.front()); 457 const_cast<unsigned char*>(&key_vector.front());
458 der_private_key_info.len = key_vector.size(); 458 der_private_key_info.len = key_vector.size();
459 // The server's RSA private key must be imported into NSS with the 459 // The server's RSA private key must be imported into NSS with the
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 // initializes the NSS base library. 831 // initializes the NSS base library.
832 EnsureNSSSSLInit(); 832 EnsureNSSSSLInit();
833 if (!NSS_IsInitialized()) 833 if (!NSS_IsInitialized())
834 return ERR_UNEXPECTED; 834 return ERR_UNEXPECTED;
835 835
836 EnableSSLServerSockets(); 836 EnableSSLServerSockets();
837 return OK; 837 return OK;
838 } 838 }
839 839
840 } // namespace net 840 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698