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

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: rename function; reorder NET_EXPORT 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') | net/cert/x509_util_nss_certs.cc » ('J')
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..b0ad7138e317f7506d541c28d5f52e451adf1b83 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).
Ryan Sleevi 2016/03/01 00:28:28 While not wanting to seem too aggressive in this C
Kevin Cernekee 2016/03/01 19:28:01 Done.
+enum SubjectAltNameType {
+ SAN_RFC822_NAME,
+ SAN_DNS_NAME,
+ SAN_URI,
+ SAN_IP_ADDRESS,
+ SAN_UPN,
Ryan Sleevi 2016/03/01 00:28:28 I highlighted this in a previous CL, but I do want
Ryan Sleevi 2016/03/01 00:28:28 SAN_UPN explicitly is the sort of thing that shoul
Kevin Cernekee 2016/03/01 19:28:01 Done.
+};
+
// 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.
Ryan Sleevi 2016/03/01 00:28:28 1) It's obvious this is only implemented for NSS,
Ryan Sleevi 2016/03/01 00:28:28 DESIGN: This design really gets to the crux of the
Kevin Cernekee 2016/03/01 19:28:01 Done.
+NET_EXPORT void GetSubjectAltNameByType(CERTCertificate* cert_handle,
+ SubjectAltNameType type,
+ std::vector<std::string>* names);
+
// 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') | net/cert/x509_util_nss_certs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698