summaryrefslogtreecommitdiffstats
path: root/net/base/ev_root_ca_metadata.h
diff options
context:
space:
mode:
authorpalmer@chromium.org <palmer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 19:04:21 +0000
committerpalmer@chromium.org <palmer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 19:04:21 +0000
commita7c2609a96d01f2d5f9cecd15ddc55869e8c6a75 (patch)
tree6a2b69b0160fd4c77dbf1a91af54c48c023eb2af /net/base/ev_root_ca_metadata.h
parent9939d35f9827ed0929646607cbdb071af627ac38 (diff)
downloadchromium_src-a7c2609a96d01f2d5f9cecd15ddc55869e8c6a75.zip
chromium_src-a7c2609a96d01f2d5f9cecd15ddc55869e8c6a75.tar.gz
chromium_src-a7c2609a96d01f2d5f9cecd15ddc55869e8c6a75.tar.bz2
Implement SHA-256 fingerprint support.
The HTTP-based Public Key Pinning Internet Draft (tools.ietf.org/html/draft-ietf-websec-key-pinning) requires this. Per wtc, give the *Fingeprint* types more meaningful *HashValue* names. Cleaning up lint along the way. This CL reverts 149268, which reverted 149261 the previous version of this CL. It includes a fix to the compile problem that necessitated 149268. BUG=117914 TEST=net_unittests, unit_tests TransportSecurityPersisterTest Review URL: https://chromiumcodereview.appspot.com/10836062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150124 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/ev_root_ca_metadata.h')
-rw-r--r--net/base/ev_root_ca_metadata.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/base/ev_root_ca_metadata.h b/net/base/ev_root_ca_metadata.h
index ab76c49..864e120 100644
--- a/net/base/ev_root_ca_metadata.h
+++ b/net/base/ev_root_ca_metadata.h
@@ -12,6 +12,7 @@
#endif
#include <map>
+#include <string>
#include <vector>
#include "net/base/net_export.h"
@@ -39,7 +40,7 @@ class NET_EXPORT_PRIVATE EVRootCAMetadata {
#if defined(USE_NSS)
// If the root CA cert has an EV policy OID, returns true and appends the
// policy OIDs to |*policy_oids|. Otherwise, returns false.
- bool GetPolicyOIDsForCA(const SHA1Fingerprint& fingerprint,
+ bool GetPolicyOIDsForCA(const SHA1HashValue& fingerprint,
std::vector<PolicyOID>* policy_oids) const;
const PolicyOID* GetPolicyOIDs() const;
int NumPolicyOIDs() const;
@@ -49,18 +50,18 @@ class NET_EXPORT_PRIVATE EVRootCAMetadata {
// Returns true if the root CA with the given certificate fingerprint has
// the EV policy OID policy_oid.
- bool HasEVPolicyOID(const SHA1Fingerprint& fingerprint,
+ bool HasEVPolicyOID(const SHA1HashValue& fingerprint,
PolicyOID policy_oid) const;
#endif
// AddEVCA adds an EV CA to the list of known EV CAs with the given policy.
// |policy| is expressed as a string of dotted numbers. It returns true on
// success.
- bool AddEVCA(const SHA1Fingerprint& fingerprint, const char* policy);
+ bool AddEVCA(const SHA1HashValue& fingerprint, const char* policy);
// RemoveEVCA removes an EV CA that was previously added by AddEVCA. It
// returns true on success.
- bool RemoveEVCA(const SHA1Fingerprint& fingerprint);
+ bool RemoveEVCA(const SHA1HashValue& fingerprint);
private:
friend struct base::DefaultLazyInstanceTraits<EVRootCAMetadata>;
@@ -69,8 +70,8 @@ class NET_EXPORT_PRIVATE EVRootCAMetadata {
~EVRootCAMetadata();
#if defined(USE_NSS)
- typedef std::map<SHA1Fingerprint, std::vector<PolicyOID>,
- SHA1FingerprintLessThan> PolicyOIDMap;
+ typedef std::map<SHA1HashValue, std::vector<PolicyOID>,
+ SHA1HashValueLessThan> PolicyOIDMap;
// RegisterOID registers |policy|, a policy OID in dotted string form, and
// writes the memoized form to |*out|. It returns true on success.
@@ -79,8 +80,8 @@ class NET_EXPORT_PRIVATE EVRootCAMetadata {
PolicyOIDMap ev_policy_;
std::vector<PolicyOID> policy_oids_;
#elif defined(OS_WIN)
- typedef std::map<SHA1Fingerprint, std::string,
- SHA1FingerprintLessThan> ExtraEVCAMap;
+ typedef std::map<SHA1HashValue, std::string,
+ SHA1HashValueLessThan> ExtraEVCAMap;
// extra_cas_ contains any EV CA metadata that was added at runtime.
ExtraEVCAMap extra_cas_;