OLD | NEW |
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/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
6 | 6 |
7 #define PRArenaPool PLArenaPool // Required by <blapi.h>. | 7 #define PRArenaPool PLArenaPool // Required by <blapi.h>. |
8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. | 8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 NOTREACHED(); | 308 NOTREACHED(); |
309 break; | 309 break; |
310 } | 310 } |
311 } | 311 } |
312 } | 312 } |
313 } | 313 } |
314 } | 314 } |
315 return false; | 315 return false; |
316 } | 316 } |
317 | 317 |
318 // Saves some information about the certificate chain chain_context in | 318 // Saves some information about the certificate chain |chain_context| in |
319 // *verify_result. The caller MUST initialize *verify_result before calling | 319 // |*verify_result|. The caller MUST initialize |*verify_result| before |
320 // this function. | 320 // calling this function. |
321 void GetCertChainInfo(PCCERT_CHAIN_CONTEXT chain_context, | 321 void GetCertChainInfo(PCCERT_CHAIN_CONTEXT chain_context, |
322 CertVerifyResult* verify_result) { | 322 CertVerifyResult* verify_result) { |
323 if (chain_context->cChain == 0) | 323 if (chain_context->cChain == 0) |
324 return; | 324 return; |
325 | 325 |
326 PCERT_SIMPLE_CHAIN first_chain = chain_context->rgpChain[0]; | 326 PCERT_SIMPLE_CHAIN first_chain = chain_context->rgpChain[0]; |
327 int num_elements = first_chain->cElement; | 327 int num_elements = first_chain->cElement; |
328 PCERT_CHAIN_ELEMENT* element = first_chain->rgpElement; | 328 PCERT_CHAIN_ELEMENT* element = first_chain->rgpElement; |
329 | 329 |
330 PCCERT_CONTEXT verified_cert = NULL; | 330 PCCERT_CONTEXT verified_cert = NULL; |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0], | 1147 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0], |
1148 &length)) { | 1148 &length)) { |
1149 return false; | 1149 return false; |
1150 } | 1150 } |
1151 | 1151 |
1152 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]), | 1152 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]), |
1153 length); | 1153 length); |
1154 } | 1154 } |
1155 | 1155 |
1156 } // namespace net | 1156 } // namespace net |
OLD | NEW |