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

Side by Side Diff: net/base/x509_cert_types_mac.cc

Issue 7605019: Reduce number of unnamed-type-template-args violations. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_channel_posix_unittest.cc ('k') | net/http/http_stream_parser.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "net/base/x509_cert_types.h" 5 #include "net/base/x509_cert_types.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 #include <Security/Security.h> 8 #include <Security/Security.h>
9 #include <Security/SecAsn1Coder.h> 9 #include <Security/SecAsn1Coder.h>
10 10
(...skipping 18 matching lines...) Expand all
29 29
30 // The following structs and templates work with Apple's very arcane and under- 30 // The following structs and templates work with Apple's very arcane and under-
31 // documented SecAsn1Parser API, which is apparently the same as NSS's ASN.1 31 // documented SecAsn1Parser API, which is apparently the same as NSS's ASN.1
32 // decoder: 32 // decoder:
33 // http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn1.html 33 // http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn1.html
34 34
35 // These are used to parse the contents of a raw 35 // These are used to parse the contents of a raw
36 // BER DistinguishedName structure. 36 // BER DistinguishedName structure.
37 37
38 struct KeyValuePair { 38 struct KeyValuePair {
39 CSSM_OID key; 39 enum ValueType {
40 int value_type;
41 CSSM_DATA value;
42
43 enum {
44 kTypeOther = 0, 40 kTypeOther = 0,
45 kTypePrintableString, 41 kTypePrintableString,
46 kTypeIA5String, 42 kTypeIA5String,
47 kTypeT61String, 43 kTypeT61String,
48 kTypeUTF8String, 44 kTypeUTF8String,
49 kTypeBMPString, 45 kTypeBMPString,
50 kTypeUniversalString, 46 kTypeUniversalString,
51 }; 47 };
48
49 CSSM_OID key;
50 ValueType value_type;
51 CSSM_DATA value;
52 }; 52 };
53 53
54 const SecAsn1Template kStringValueTemplate[] = { 54 const SecAsn1Template kStringValueTemplate[] = {
55 { SEC_ASN1_CHOICE, offsetof(KeyValuePair, value_type), }, 55 { SEC_ASN1_CHOICE, offsetof(KeyValuePair, value_type), },
56 { SEC_ASN1_PRINTABLE_STRING, 56 { SEC_ASN1_PRINTABLE_STRING,
57 offsetof(KeyValuePair, value), 0, KeyValuePair::kTypePrintableString }, 57 offsetof(KeyValuePair, value), 0, KeyValuePair::kTypePrintableString },
58 { SEC_ASN1_IA5_STRING, 58 { SEC_ASN1_IA5_STRING,
59 offsetof(KeyValuePair, value), 0, KeyValuePair::kTypeIA5String }, 59 offsetof(KeyValuePair, value), 0, KeyValuePair::kTypeIA5String },
60 { SEC_ASN1_T61_STRING, 60 { SEC_ASN1_T61_STRING,
61 offsetof(KeyValuePair, value), 0, KeyValuePair::kTypeT61String }, 61 offsetof(KeyValuePair, value), 0, KeyValuePair::kTypeT61String },
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 match(locality_name, against.locality_name) && 302 match(locality_name, against.locality_name) &&
303 match(state_or_province_name, against.state_or_province_name) && 303 match(state_or_province_name, against.state_or_province_name) &&
304 match(country_name, against.country_name) && 304 match(country_name, against.country_name) &&
305 match(street_addresses, against.street_addresses) && 305 match(street_addresses, against.street_addresses) &&
306 match(organization_names, against.organization_names) && 306 match(organization_names, against.organization_names) &&
307 match(organization_unit_names, against.organization_unit_names) && 307 match(organization_unit_names, against.organization_unit_names) &&
308 match(domain_components, against.domain_components); 308 match(domain_components, against.domain_components);
309 } 309 }
310 310
311 } // namespace net 311 } // namespace net
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix_unittest.cc ('k') | net/http/http_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698