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

Unified Diff: net/cert/x509_util_nss.h

Issue 1720653002: Add new functions to handle UPN and email addresses (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add NOTREACHED() for impossible enum case Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/cert/x509_util_nss_certs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_util_nss.h
diff --git a/net/cert/x509_util_nss.h b/net/cert/x509_util_nss.h
index 55e562effbab95875f4fb9cd76099c0977d8a83b..d1b7310b47eaa20a96440ce8a46e68d0b674f10b 100644
--- a/net/cert/x509_util_nss.h
+++ b/net/cert/x509_util_nss.h
@@ -29,6 +29,17 @@ namespace net {
namespace x509_util {
#if defined(USE_NSS_CERTS) || defined(OS_IOS)
+// Allows the caller to filter the subjectAltName list and return only
+// a specific data type (e.g. email addresses or Microsoft User Principal
+// Name).
+enum SubjectAltNameType {
+ SAN_RFC822_NAME,
+ SAN_DNS_NAME,
+ SAN_URI,
+ SAN_IP_ADDRESS,
+ SAN_UPN,
+};
+
// Parses the Principal attribute from |name| and outputs the result in
// |principal|.
void ParsePrincipal(CERTName* name,
@@ -45,6 +56,12 @@ void GetSubjectAltName(CERTCertificate* cert_handle,
std::vector<std::string>* dns_names,
std::vector<std::string>* ip_addrs);
+// Filters subjectAltName list by type. Only implemented for NSS, to
+// support wifi on CrOS.
+void NET_EXPORT GetSubjectAltName(CERTCertificate* cert_handle,
+ SubjectAltNameType type,
+ std::vector<std::string>* names);
stevenjb 2016/02/29 22:05:03 Avoid having two identical function names with dif
Kevin Cernekee 2016/02/29 22:52:01 Done.
+
// Creates all possible OS certificate handles from |data| encoded in a specific
// |format|. Returns an empty collection on failure.
X509Certificate::OSCertHandles CreateOSCertHandlesFromBytes(
« no previous file with comments | « no previous file | net/cert/x509_util_nss_certs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698