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

Unified Diff: net/cert/internal/parse_name.cc

Issue 2746103003: Add X509CertificateBytes which uses CRYPTO_BUFFER instead of macOS-native certificate types. (Closed)
Patch Set: rebase Created 3 years, 8 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 | « net/cert/internal/parse_name.h ('k') | net/cert/internal/trust_store_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/parse_name.cc
diff --git a/net/cert/internal/parse_name.cc b/net/cert/internal/parse_name.cc
index 2e7a8e705657b49bcb56fc21910d913cd74e1d2b..d9eaaeed7c86f25de361e8d5f5804f892294a879 100644
--- a/net/cert/internal/parse_name.cc
+++ b/net/cert/internal/parse_name.cc
@@ -134,6 +134,12 @@ der::Input TypeStateOrProvinceNameOid() {
return der::Input(oid);
}
+der::Input TypeStreetAddressOid() {
+ // street (streetAddress): 2.5.4.9 (RFC 4519)
+ static const uint8_t oid[] = {0x55, 0x04, 0x09};
+ return der::Input(oid);
+}
+
der::Input TypeOrganizationNameOid() {
// id-at-organizationName: 2.5.4.10 (RFC 5280)
static const uint8_t oid[] = {0x55, 0x04, 0x0a};
@@ -176,6 +182,13 @@ der::Input TypeGenerationQualifierOid() {
return der::Input(oid);
}
+der::Input TypeDomainComponentOid() {
+ // dc (domainComponent): 0.9.2342.19200300.100.1.25 (RFC 4519)
+ static const uint8_t oid[] = {0x09, 0x92, 0x26, 0x89, 0x93,
+ 0xF2, 0x2C, 0x64, 0x01, 0x19};
+ return der::Input(oid);
+}
+
bool X509NameAttribute::ValueAsString(std::string* out) const {
switch (value_tag) {
case der::kTeletexString:
@@ -234,6 +247,7 @@ bool X509NameAttribute::ValueAsStringUnsafe(std::string* out) const {
bool X509NameAttribute::AsRFC2253String(std::string* out) const {
std::string type_string;
std::string value_string;
+ // TODO(mattm): Add streetAddress and domainComponent here?
if (type == TypeCommonNameOid()) {
type_string = "CN";
} else if (type == TypeSurnameOid()) {
« no previous file with comments | « net/cert/internal/parse_name.h ('k') | net/cert/internal/trust_store_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698