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 #include "net/cert/x509_certificate.h" | 5 #include "net/cert/x509_certificate.h" |
6 | 6 |
7 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. | 7 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 | 228 |
229 // Note: |store| is explicitly not released, as the call to CertCloseStore() | 229 // Note: |store| is explicitly not released, as the call to CertCloseStore() |
230 // when |store| goes out of scope will not actually free the store. Instead, | 230 // when |store| goes out of scope will not actually free the store. Instead, |
231 // the store will be freed when |primary_cert| is freed. | 231 // the store will be freed when |primary_cert| is freed. |
232 return primary_cert; | 232 return primary_cert; |
233 } | 233 } |
234 | 234 |
235 // static | 235 // static |
236 bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle, | 236 bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle, |
237 std::string* encoded) { | 237 std::string* encoded) { |
238 if (!cert_handle->pbCertEncoded || !cert_handle->cbCertEncoded) | 238 if (!cert_handle || !cert_handle->pbCertEncoded || |
239 !cert_handle->cbCertEncoded) | |
agl
2014/09/23 20:30:00
this needs { } now that it's a multi-line conditio
felt
2014/09/24 03:53:48
Done.
| |
239 return false; | 240 return false; |
240 encoded->assign(reinterpret_cast<char*>(cert_handle->pbCertEncoded), | 241 encoded->assign(reinterpret_cast<char*>(cert_handle->pbCertEncoded), |
241 cert_handle->cbCertEncoded); | 242 cert_handle->cbCertEncoded); |
242 return true; | 243 return true; |
243 } | 244 } |
244 | 245 |
245 // static | 246 // static |
246 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a, | 247 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a, |
247 X509Certificate::OSCertHandle b) { | 248 X509Certificate::OSCertHandle b) { |
248 DCHECK(a && b); | 249 DCHECK(a && b); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer, | 446 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer, |
446 valid_issuers)) { | 447 valid_issuers)) { |
447 return true; | 448 return true; |
448 } | 449 } |
449 } | 450 } |
450 | 451 |
451 return false; | 452 return false; |
452 } | 453 } |
453 | 454 |
454 } // namespace net | 455 } // namespace net |
OLD | NEW |