diff options
author | palmer@chromium.org <palmer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-07 18:14:34 +0000 |
---|---|---|
committer | palmer@chromium.org <palmer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-07 18:14:34 +0000 |
commit | 2c6349934c1e8e8199431d79ade127c18700fc1f (patch) | |
tree | de1cd6f20adf2207de2b76b49af675c43efe9cd9 /net/base/ev_root_ca_metadata.h | |
parent | 44687e5b8967ef1f723b8058121beb627c70bbba (diff) | |
download | chromium_src-2c6349934c1e8e8199431d79ade127c18700fc1f.zip chromium_src-2c6349934c1e8e8199431d79ade127c18700fc1f.tar.gz chromium_src-2c6349934c1e8e8199431d79ade127c18700fc1f.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.
BUG=117914
TEST=net_unittests, unit_tests TransportSecurityPersisterTest
Review URL: https://chromiumcodereview.appspot.com/10825211
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150375 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/ev_root_ca_metadata.h')
-rw-r--r-- | net/base/ev_root_ca_metadata.h | 17 |
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_; |