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

Side by Side Diff: net/cert/x509_util_nss.h

Issue 2770713002: Add a DevTools warning for a missing subjectAltName (Closed)
Patch Set: 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_win.cc ('k') | net/cert/x509_util_nss.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) 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 #ifndef NET_CERT_X509_UTIL_NSS_H_ 5 #ifndef NET_CERT_X509_UTIL_NSS_H_
6 #define NET_CERT_X509_UTIL_NSS_H_ 6 #define NET_CERT_X509_UTIL_NSS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 22 matching lines...) Expand all
33 // |principal|. 33 // |principal|.
34 void ParsePrincipal(CERTName* name, 34 void ParsePrincipal(CERTName* name,
35 CertPrincipal* principal); 35 CertPrincipal* principal);
36 36
37 // Parses the date from |der_date| and outputs the result in |result|. 37 // Parses the date from |der_date| and outputs the result in |result|.
38 void ParseDate(const SECItem* der_date, base::Time* result); 38 void ParseDate(const SECItem* der_date, base::Time* result);
39 39
40 // Parses the serial number from |certificate|. 40 // Parses the serial number from |certificate|.
41 std::string ParseSerialNumber(const CERTCertificate* certificate); 41 std::string ParseSerialNumber(const CERTCertificate* certificate);
42 42
43 // Gets the dNSName and iPAddress name types from the subjectAltName 43 // Gets the dNSName and iPAddress name fields from the subjectAltName
44 // extension of |cert_handle|, storing them in |dns_names| and 44 // extension of |cert_handle|.
45 // |ip_addrs|, respectively. 45 // If |dns_names| is non-null, each dNSName will be stored in |*dns_names|.
46 // If no subjectAltName is present, or no names of that type are 46 // If |ip_addrs| is non-null, each iPAddress will be stored in |*ip_addrs|.
47 // present, the relevant vectors are cleared. 47 // Returns true if any dNSName or iPAddress was present.
48 void GetSubjectAltName(CERTCertificate* cert_handle, 48 bool GetSubjectAltName(CERTCertificate* cert_handle,
49 std::vector<std::string>* dns_names, 49 std::vector<std::string>* dns_names,
50 std::vector<std::string>* ip_addrs); 50 std::vector<std::string>* ip_addrs);
51 51
52 // Stores the values of all rfc822Name subjectAltNames from |cert_handle| 52 // Stores the values of all rfc822Name subjectAltNames from |cert_handle|
53 // into |names|. If no names are present, clears |names|. 53 // into |names|. If no names are present, clears |names|.
54 // WARNING: This method does not validate that the rfc822Name is 54 // WARNING: This method does not validate that the rfc822Name is
55 // properly encoded; it MAY contain embedded NULs or other illegal 55 // properly encoded; it MAY contain embedded NULs or other illegal
56 // characters; care should be taken to validate the well-formedness 56 // characters; care should be taken to validate the well-formedness
57 // before using. 57 // before using.
58 NET_EXPORT void GetRFC822SubjectAltNames(CERTCertificate* cert_handle, 58 NET_EXPORT void GetRFC822SubjectAltNames(CERTCertificate* cert_handle,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 std::string GetUniqueNicknameForSlot(const std::string& nickname, 127 std::string GetUniqueNicknameForSlot(const std::string& nickname,
128 const SECItem* subject, 128 const SECItem* subject,
129 PK11SlotInfo* slot); 129 PK11SlotInfo* slot);
130 #endif // defined(USE_NSS_CERTS) 130 #endif // defined(USE_NSS_CERTS)
131 131
132 } // namespace x509_util 132 } // namespace x509_util
133 133
134 } // namespace net 134 } // namespace net
135 135
136 #endif // NET_CERT_X509_UTIL_NSS_H_ 136 #endif // NET_CERT_X509_UTIL_NSS_H_
OLDNEW
« no previous file with comments | « net/cert/x509_certificate_win.cc ('k') | net/cert/x509_util_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698