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_win.h" | 5 #include "net/cert/cert_verify_proc_win.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 num_elements -= 1; | 356 num_elements -= 1; |
357 } | 357 } |
358 | 358 |
359 for (DWORD i = 0; i < num_elements; ++i) { | 359 for (DWORD i = 0; i < num_elements; ++i) { |
360 PCCERT_CONTEXT cert = element[i]->pCertContext; | 360 PCCERT_CONTEXT cert = element[i]->pCertContext; |
361 if (i == 0) { | 361 if (i == 0) { |
362 verified_cert = cert; | 362 verified_cert = cert; |
363 } else { | 363 } else { |
364 verified_chain.push_back(cert); | 364 verified_chain.push_back(cert); |
365 } | 365 } |
366 | |
367 FillCertVerifyResultWeakSignature(cert, i == 0, verify_result); | |
368 } | 366 } |
369 | 367 |
370 if (verified_cert) { | 368 if (verified_cert) { |
371 // Add the root certificate, if present, as it was not added above. | 369 // Add the root certificate, if present, as it was not added above. |
372 if (has_root_ca) | 370 if (has_root_ca) |
373 verified_chain.push_back(element[num_elements]->pCertContext); | 371 verified_chain.push_back(element[num_elements]->pCertContext); |
374 verify_result->verified_cert = | 372 verify_result->verified_cert = |
375 X509Certificate::CreateFromHandle(verified_cert, verified_chain); | 373 X509Certificate::CreateFromHandle(verified_cert, verified_chain); |
376 } | 374 } |
377 } | 375 } |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 return MapCertStatusToNetError(verify_result->cert_status); | 1215 return MapCertStatusToNetError(verify_result->cert_status); |
1218 | 1216 |
1219 if (ev_policy_oid && | 1217 if (ev_policy_oid && |
1220 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { | 1218 CheckEV(chain_context, rev_checking_enabled, ev_policy_oid)) { |
1221 verify_result->cert_status |= CERT_STATUS_IS_EV; | 1219 verify_result->cert_status |= CERT_STATUS_IS_EV; |
1222 } | 1220 } |
1223 return OK; | 1221 return OK; |
1224 } | 1222 } |
1225 | 1223 |
1226 } // namespace net | 1224 } // namespace net |
OLD | NEW |