OLD | NEW |
---|---|
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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
8 | 8 |
9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
(...skipping 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2352 ScopedCERTCertificate cert(CERT_NewTempCertificate(CERT_GetDefaultCertDB(), | 2352 ScopedCERTCertificate cert(CERT_NewTempCertificate(CERT_GetDefaultCertDB(), |
2353 &cert_item, | 2353 &cert_item, |
2354 NULL, | 2354 NULL, |
2355 PR_FALSE, | 2355 PR_FALSE, |
2356 PR_TRUE)); | 2356 PR_TRUE)); |
2357 if (cert == NULL) | 2357 if (cert == NULL) |
2358 return MapNSSError(PORT_GetError()); | 2358 return MapNSSError(PORT_GetError()); |
2359 | 2359 |
2360 // Set the private key. | 2360 // Set the private key. |
2361 if (!crypto::ECPrivateKey::ImportFromEncryptedPrivateKeyInfo( | 2361 if (!crypto::ECPrivateKey::ImportFromEncryptedPrivateKeyInfo( |
2362 crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()), | |
wtc
2013/11/11 20:56:25
IMPORTANT: this should be PK11_GetInternalSlot().
mattm
2013/11/12 02:42:44
Done.
| |
2362 ServerBoundCertService::kEPKIPassword, | 2363 ServerBoundCertService::kEPKIPassword, |
2363 reinterpret_cast<const unsigned char*>( | 2364 reinterpret_cast<const unsigned char*>( |
2364 domain_bound_private_key_.data()), | 2365 domain_bound_private_key_.data()), |
2365 domain_bound_private_key_.size(), | 2366 domain_bound_private_key_.size(), |
2366 &cert->subjectPublicKeyInfo, | 2367 &cert->subjectPublicKeyInfo, |
2367 false, | 2368 false, |
2368 false, | 2369 false, |
2369 key, | 2370 key, |
2370 public_key)) { | 2371 public_key)) { |
2371 int error = MapNSSError(PORT_GetError()); | 2372 int error = MapNSSError(PORT_GetError()); |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3477 EnsureThreadIdAssigned(); | 3478 EnsureThreadIdAssigned(); |
3478 base::AutoLock auto_lock(lock_); | 3479 base::AutoLock auto_lock(lock_); |
3479 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 3480 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
3480 } | 3481 } |
3481 | 3482 |
3482 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3483 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
3483 return server_bound_cert_service_; | 3484 return server_bound_cert_service_; |
3484 } | 3485 } |
3485 | 3486 |
3486 } // namespace net | 3487 } // namespace net |
OLD | NEW |