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 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 NOTREACHED(); | 284 NOTREACHED(); |
285 break; | 285 break; |
286 } | 286 } |
287 } | 287 } |
288 } | 288 } |
289 } | 289 } |
290 } | 290 } |
291 return false; | 291 return false; |
292 } | 292 } |
293 | 293 |
294 // Saves some information about the certificate chain chain_context in | 294 // Saves some information about the certificate chain |chain_context| in |
295 // *verify_result. The caller MUST initialize *verify_result before calling | 295 // |*verify_result|. The caller MUST initialize |*verify_result| before |
296 // this function. | 296 // calling this function. |
297 void GetCertChainInfo(PCCERT_CHAIN_CONTEXT chain_context, | 297 void GetCertChainInfo(PCCERT_CHAIN_CONTEXT chain_context, |
298 CertVerifyResult* verify_result) { | 298 CertVerifyResult* verify_result) { |
299 if (chain_context->cChain == 0) | 299 if (chain_context->cChain == 0) |
300 return; | 300 return; |
301 | 301 |
302 PCERT_SIMPLE_CHAIN first_chain = chain_context->rgpChain[0]; | 302 PCERT_SIMPLE_CHAIN first_chain = chain_context->rgpChain[0]; |
303 int num_elements = first_chain->cElement; | 303 int num_elements = first_chain->cElement; |
304 PCERT_CHAIN_ELEMENT* element = first_chain->rgpElement; | 304 PCERT_CHAIN_ELEMENT* element = first_chain->rgpElement; |
305 | 305 |
306 PCCERT_CONTEXT verified_cert = NULL; | 306 PCCERT_CONTEXT verified_cert = NULL; |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0], | 1051 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0], |
1052 &length)) { | 1052 &length)) { |
1053 return false; | 1053 return false; |
1054 } | 1054 } |
1055 | 1055 |
1056 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]), | 1056 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]), |
1057 length); | 1057 length); |
1058 } | 1058 } |
1059 | 1059 |
1060 } // namespace net | 1060 } // namespace net |
OLD | NEW |