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

Side by Side Diff: net/base/cert_database_nss.cc

Issue 8919020: This fixes a bug I introduced last night (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
« no previous file with comments | « no previous file | net/base/x509_certificate_nss.cc » ('j') | net/base/x509_certificate_nss.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/cert_database.h" 5 #include "net/base/cert_database.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <certdb.h> 8 #include <certdb.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <pk11pub.h> 10 #include <pk11pub.h>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return ERR_NO_PRIVATE_KEY_FOR_CERT; 57 return ERR_NO_PRIVATE_KEY_FOR_CERT;
58 } 58 }
59 PK11_FreeSlot(slot); 59 PK11_FreeSlot(slot);
60 60
61 return OK; 61 return OK;
62 } 62 }
63 63
64 int CertDatabase::AddUserCert(X509Certificate* cert_obj) { 64 int CertDatabase::AddUserCert(X509Certificate* cert_obj) {
65 CERTCertificate* cert = cert_obj->os_cert_handle(); 65 CERTCertificate* cert = cert_obj->os_cert_handle();
66 PK11SlotInfo* slot = NULL; 66 PK11SlotInfo* slot = NULL;
67 std::string nickname;
68 67
69 { 68 {
70 crypto::AutoNSSWriteLock lock; 69 crypto::AutoNSSWriteLock lock;
71 slot = PK11_ImportCertForKey( 70 slot = PK11_ImportCertForKey(
72 cert, 71 cert,
73 cert_obj->GetDefaultNickname(net::USER_CERT).c_str(), 72 cert_obj->GetDefaultNickname(net::USER_CERT).c_str(),
74 NULL); 73 NULL);
75 } 74 }
76 75
77 if (!slot) { 76 if (!slot) {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 312 }
314 return true; 313 return true;
315 } 314 }
316 315
317 bool CertDatabase::IsReadOnly(const X509Certificate* cert) const { 316 bool CertDatabase::IsReadOnly(const X509Certificate* cert) const {
318 PK11SlotInfo* slot = cert->os_cert_handle()->slot; 317 PK11SlotInfo* slot = cert->os_cert_handle()->slot;
319 return slot && PK11_IsReadOnly(slot); 318 return slot && PK11_IsReadOnly(slot);
320 } 319 }
321 320
322 } // namespace net 321 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/x509_certificate_nss.cc » ('j') | net/base/x509_certificate_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698