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

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

Issue 2761333002: Add a DevTools warning for a missing subjectAltName (Closed)
Patch Set: Feedback & fixes Created 3 years, 9 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/x509_certificate_mac.cc ('k') | net/cert/x509_certificate_openssl.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 <cert.h> 5 #include <cert.h>
6 #include <cryptohi.h> 6 #include <cryptohi.h>
7 #include <keyhi.h> 7 #include <keyhi.h>
8 #include <nss.h> 8 #include <nss.h>
9 #include <pk11pub.h> 9 #include <pk11pub.h>
10 #include <prtime.h> 10 #include <prtime.h>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 case SERVER_CERT: 81 case SERVER_CERT:
82 result = subject_.GetDisplayName(); 82 result = subject_.GetDisplayName();
83 break; 83 break;
84 case OTHER_CERT: 84 case OTHER_CERT:
85 default: 85 default:
86 break; 86 break;
87 } 87 }
88 return result; 88 return result;
89 } 89 }
90 90
91 void X509Certificate::GetSubjectAltName( 91 bool X509Certificate::GetSubjectAltName(
92 std::vector<std::string>* dns_names, 92 std::vector<std::string>* dns_names,
93 std::vector<std::string>* ip_addrs) const { 93 std::vector<std::string>* ip_addrs) const {
94 x509_util::GetSubjectAltName(cert_handle_, dns_names, ip_addrs); 94 return x509_util::GetSubjectAltName(cert_handle_, dns_names, ip_addrs);
95 } 95 }
96 96
97 bool X509Certificate::IsIssuedByEncoded( 97 bool X509Certificate::IsIssuedByEncoded(
98 const std::vector<std::string>& valid_issuers) { 98 const std::vector<std::string>& valid_issuers) {
99 // Get certificate chain as scoped list of CERTCertificate objects. 99 // Get certificate chain as scoped list of CERTCertificate objects.
100 std::vector<CERTCertificate*> cert_chain; 100 std::vector<CERTCertificate*> cert_chain;
101 cert_chain.push_back(cert_handle_); 101 cert_chain.push_back(cert_handle_);
102 for (size_t n = 0; n < intermediate_ca_certs_.size(); ++n) { 102 for (size_t n = 0; n < intermediate_ca_certs_.size(); ++n) {
103 cert_chain.push_back(intermediate_ca_certs_[n]); 103 cert_chain.push_back(intermediate_ca_certs_[n]);
104 } 104 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 return false; 245 return false;
246 if (SECSuccess != CERT_VerifySignedDataWithPublicKey( 246 if (SECSuccess != CERT_VerifySignedDataWithPublicKey(
247 &cert_handle->signatureWrap, public_key.get(), NULL)) { 247 &cert_handle->signatureWrap, public_key.get(), NULL)) {
248 return false; 248 return false;
249 } 249 }
250 return CERT_CompareName(&cert_handle->subject, &cert_handle->issuer) == 250 return CERT_CompareName(&cert_handle->subject, &cert_handle->issuer) ==
251 SECEqual; 251 SECEqual;
252 } 252 }
253 253
254 } // namespace net 254 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/x509_certificate_mac.cc ('k') | net/cert/x509_certificate_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698