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/cert_verify_proc_android.h" | 5 #include "net/cert/cert_verify_proc_android.h" |
6 | 6 |
7 #include <openssl/x509v3.h> | 7 #include <openssl/x509v3.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 // Save the verified chain. | 64 // Save the verified chain. |
65 if (!verified_chain.empty()) { | 65 if (!verified_chain.empty()) { |
66 std::vector<base::StringPiece> verified_chain_pieces(verified_chain.size()); | 66 std::vector<base::StringPiece> verified_chain_pieces(verified_chain.size()); |
67 for (size_t i = 0; i < verified_chain.size(); i++) { | 67 for (size_t i = 0; i < verified_chain.size(); i++) { |
68 verified_chain_pieces[i] = base::StringPiece(verified_chain[i]); | 68 verified_chain_pieces[i] = base::StringPiece(verified_chain[i]); |
69 } | 69 } |
70 scoped_refptr<X509Certificate> verified_cert = | 70 scoped_refptr<X509Certificate> verified_cert = |
71 X509Certificate::CreateFromDERCertChain(verified_chain_pieces); | 71 X509Certificate::CreateFromDERCertChain(verified_chain_pieces); |
72 if (verified_cert) | 72 if (verified_cert.get()) |
73 verify_result->verified_cert = verified_cert; | 73 verify_result->verified_cert = verified_cert; |
74 } | 74 } |
75 | 75 |
76 // Extract the algorithm information from the certs | 76 // Extract the algorithm information from the certs |
77 X509Certificate::OSCertHandles chain; | 77 X509Certificate::OSCertHandles chain; |
78 const X509Certificate::OSCertHandles& intermediates = | 78 const X509Certificate::OSCertHandles& intermediates = |
79 verify_result->verified_cert->GetIntermediateCertificates(); | 79 verify_result->verified_cert->GetIntermediateCertificates(); |
80 chain.push_back(verify_result->verified_cert->os_cert_handle()); | 80 chain.push_back(verify_result->verified_cert->os_cert_handle()); |
81 chain.insert(chain.end(), intermediates.begin(), intermediates.end()); | 81 chain.insert(chain.end(), intermediates.begin(), intermediates.end()); |
82 | 82 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 NOTREACHED(); | 174 NOTREACHED(); |
175 return ERR_FAILED; | 175 return ERR_FAILED; |
176 } | 176 } |
177 if (IsCertStatusError(verify_result->cert_status)) | 177 if (IsCertStatusError(verify_result->cert_status)) |
178 return MapCertStatusToNetError(verify_result->cert_status); | 178 return MapCertStatusToNetError(verify_result->cert_status); |
179 | 179 |
180 return OK; | 180 return OK; |
181 } | 181 } |
182 | 182 |
183 } // namespace net | 183 } // namespace net |
OLD | NEW |