Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(712)

Side by Side Diff: net/cert/cert_verify_proc_openssl.cc

Issue 509273002: Detect SHA-1 when it appears in certificate chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_status_extended
Patch Set: Correct Android comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/cert/cert_verify_proc_nss.cc ('k') | net/cert/cert_verify_proc_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_openssl.h" 5 #include "net/cert/cert_verify_proc_openssl.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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 // Only check the algorithm status for certificates that are not in the 112 // Only check the algorithm status for certificates that are not in the
113 // trust store. 113 // trust store.
114 if (i < static_cast<size_t>(store_ctx->last_untrusted)) { 114 if (i < static_cast<size_t>(store_ctx->last_untrusted)) {
115 int sig_alg = OBJ_obj2nid(cert->sig_alg->algorithm); 115 int sig_alg = OBJ_obj2nid(cert->sig_alg->algorithm);
116 if (sig_alg == NID_md2WithRSAEncryption) { 116 if (sig_alg == NID_md2WithRSAEncryption) {
117 verify_result->has_md2 = true; 117 verify_result->has_md2 = true;
118 } else if (sig_alg == NID_md4WithRSAEncryption) { 118 } else if (sig_alg == NID_md4WithRSAEncryption) {
119 verify_result->has_md4 = true; 119 verify_result->has_md4 = true;
120 } else if (sig_alg == NID_md5WithRSAEncryption) { 120 } else if (sig_alg == NID_md5WithRSAEncryption ||
121 sig_alg == NID_md5WithRSA) {
121 verify_result->has_md5 = true; 122 verify_result->has_md5 = true;
123 } else if (sig_alg == NID_sha1WithRSAEncryption ||
124 sig_alg == NID_dsaWithSHA || sig_alg == NID_dsaWithSHA1 ||
125 sig_alg == NID_dsaWithSHA1_2 || sig_alg == NID_sha1WithRSA ||
126 sig_alg == NID_ecdsa_with_SHA1) {
127 verify_result->has_sha1 = true;
122 } 128 }
123 } 129 }
124 } 130 }
125 131
126 // Set verify_result->verified_cert and 132 // Set verify_result->verified_cert and
127 // verify_result->is_issued_by_known_root. 133 // verify_result->is_issued_by_known_root.
128 if (verified_cert) { 134 if (verified_cert) {
129 verify_result->verified_cert = 135 verify_result->verified_cert =
130 X509Certificate::CreateFromHandle(verified_cert, verified_chain); 136 X509Certificate::CreateFromHandle(verified_cert, verified_chain);
131 137
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 238
233 GetCertChainInfo(ctx.get(), verify_result); 239 GetCertChainInfo(ctx.get(), verify_result);
234 AppendPublicKeyHashes(ctx.get(), &verify_result->public_key_hashes); 240 AppendPublicKeyHashes(ctx.get(), &verify_result->public_key_hashes);
235 if (IsCertStatusError(verify_result->cert_status)) 241 if (IsCertStatusError(verify_result->cert_status))
236 return MapCertStatusToNetError(verify_result->cert_status); 242 return MapCertStatusToNetError(verify_result->cert_status);
237 243
238 return OK; 244 return OK;
239 } 245 }
240 246
241 } // namespace net 247 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc_nss.cc ('k') | net/cert/cert_verify_proc_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698