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 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2350 cert_item.data = (unsigned char*) domain_bound_cert_.data(); | 2350 cert_item.data = (unsigned char*) domain_bound_cert_.data(); |
2351 cert_item.len = domain_bound_cert_.size(); | 2351 cert_item.len = domain_bound_cert_.size(); |
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 crypto::ScopedPK11Slot slot(PK11_GetInternalSlot()); |
2360 // Set the private key. | 2361 // Set the private key. |
2361 if (!crypto::ECPrivateKey::ImportFromEncryptedPrivateKeyInfo( | 2362 if (!crypto::ECPrivateKey::ImportFromEncryptedPrivateKeyInfo( |
| 2363 slot.get(), |
2362 ServerBoundCertService::kEPKIPassword, | 2364 ServerBoundCertService::kEPKIPassword, |
2363 reinterpret_cast<const unsigned char*>( | 2365 reinterpret_cast<const unsigned char*>( |
2364 domain_bound_private_key_.data()), | 2366 domain_bound_private_key_.data()), |
2365 domain_bound_private_key_.size(), | 2367 domain_bound_private_key_.size(), |
2366 &cert->subjectPublicKeyInfo, | 2368 &cert->subjectPublicKeyInfo, |
2367 false, | 2369 false, |
2368 false, | 2370 false, |
2369 key, | 2371 key, |
2370 public_key)) { | 2372 public_key)) { |
2371 int error = MapNSSError(PORT_GetError()); | 2373 int error = MapNSSError(PORT_GetError()); |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3477 EnsureThreadIdAssigned(); | 3479 EnsureThreadIdAssigned(); |
3478 base::AutoLock auto_lock(lock_); | 3480 base::AutoLock auto_lock(lock_); |
3479 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 3481 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
3480 } | 3482 } |
3481 | 3483 |
3482 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3484 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
3483 return server_bound_cert_service_; | 3485 return server_bound_cert_service_; |
3484 } | 3486 } |
3485 | 3487 |
3486 } // namespace net | 3488 } // namespace net |
OLD | NEW |