summaryrefslogtreecommitdiffstats
path: root/net/base/ev_root_ca_metadata.h
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 03:57:32 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 03:57:32 +0000
commitc0d769d16ca94f36239fcd82725d909947f1cc1c (patch)
tree534e4c930865d6b7bcdbff895380f825b6c7e51e /net/base/ev_root_ca_metadata.h
parentc59fc74df671f470511a87e24c2d7efee864c27e (diff)
downloadchromium_src-c0d769d16ca94f36239fcd82725d909947f1cc1c.zip
chromium_src-c0d769d16ca94f36239fcd82725d909947f1cc1c.tar.gz
chromium_src-c0d769d16ca94f36239fcd82725d909947f1cc1c.tar.bz2
typedef PolicyOID to support Linux-only SECOidTag in EVRootCAMetadata methods.
BUG=none TEST=none Review URL: http://codereview.chromium.org/164134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23164 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/ev_root_ca_metadata.h')
-rw-r--r--net/base/ev_root_ca_metadata.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/net/base/ev_root_ca_metadata.h b/net/base/ev_root_ca_metadata.h
index 7904039..5b12337 100644
--- a/net/base/ev_root_ca_metadata.h
+++ b/net/base/ev_root_ca_metadata.h
@@ -5,9 +5,15 @@
#ifndef NET_BASE_EV_ROOT_CA_METADATA_H_
#define NET_BASE_EV_ROOT_CA_METADATA_H_
+#include "build/build_config.h"
+
+#if defined(OS_LINUX)
+#include <secoidt.h>
+#endif
+
#include <map>
+#include <vector>
-#include "base/scoped_ptr.h"
#include "net/base/x509_certificate.h"
template <typename T>
@@ -19,15 +25,21 @@ namespace net {
// extended-validation (EV) certificates.
class EVRootCAMetadata {
public:
+#if defined(OS_LINUX)
+ typedef SECOidTag PolicyOID;
+#else
+ typedef const char* PolicyOID;
+#endif
+
static EVRootCAMetadata* GetInstance();
// If the root CA cert has an EV policy OID, returns true and stores the
// policy OID in *policy_oid. Otherwise, returns false.
bool GetPolicyOID(const X509Certificate::Fingerprint& fingerprint,
- std::string* policy_oid) const;
+ PolicyOID* policy_oid) const;
- const char* const* GetPolicyOIDs() const { return policy_oids_.get(); }
- int NumPolicyOIDs() const { return num_policy_oids_; }
+ const PolicyOID* GetPolicyOIDs() const { return &policy_oids_[0]; }
+ int NumPolicyOIDs() const { return policy_oids_.size(); }
private:
EVRootCAMetadata();
@@ -35,17 +47,13 @@ class EVRootCAMetadata {
friend struct DefaultSingletonTraits<EVRootCAMetadata>;
- typedef std::map<X509Certificate::Fingerprint, std::string,
- X509Certificate::FingerprintLessThan> StringMap;
+ typedef std::map<X509Certificate::Fingerprint, PolicyOID,
+ X509Certificate::FingerprintLessThan> PolicyOidMap;
// Maps an EV root CA cert's SHA-1 fingerprint to its EV policy OID.
- StringMap ev_policy_;
+ PolicyOidMap ev_policy_;
- // Contains dotted-decimal OID strings (in ASCII). This is a C array of
- // C strings so that it can be passed directly to Windows CryptoAPI as
- // LPSTR*.
- scoped_array<const char*> policy_oids_;
- int num_policy_oids_;
+ std::vector<PolicyOID> policy_oids_;
DISALLOW_COPY_AND_ASSIGN(EVRootCAMetadata);
};