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

Unified Diff: net/base/cert_verify_proc_nss.cc

Issue 10836150: Revert 150375 - Implement SHA-256 fingerprint support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/base/cert_verify_proc_mac.cc ('k') | net/base/cert_verify_proc_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_verify_proc_nss.cc
===================================================================
--- net/base/cert_verify_proc_nss.cc (revision 150506)
+++ net/base/cert_verify_proc_nss.cc (working copy)
@@ -4,9 +4,6 @@
#include "net/base/cert_verify_proc_nss.h"
-#include <string>
-#include <vector>
-
#include <cert.h>
#include <nss.h>
#include <prerror.h>
@@ -600,38 +597,24 @@
return false;
}
-HashValue CertPublicKeyHashSHA1(CERTCertificate* cert) {
- HashValue hash;
- hash.tag = HASH_VALUE_SHA1;
- SECStatus rv = HASH_HashBuf(HASH_AlgSHA1, hash.data(),
+SHA1Fingerprint CertPublicKeyHash(CERTCertificate* cert) {
+ SHA1Fingerprint hash;
+ SECStatus rv = HASH_HashBuf(HASH_AlgSHA1, hash.data,
cert->derPublicKey.data, cert->derPublicKey.len);
DCHECK_EQ(rv, SECSuccess);
return hash;
}
-HashValue CertPublicKeyHashSHA256(CERTCertificate* cert) {
- HashValue hash;
- hash.tag = HASH_VALUE_SHA256;
- SECStatus rv = HASH_HashBuf(HASH_AlgSHA256, hash.data(),
- cert->derPublicKey.data, cert->derPublicKey.len);
- DCHECK_EQ(rv, SECSuccess);
- return hash;
-}
-
void AppendPublicKeyHashes(CERTCertList* cert_list,
CERTCertificate* root_cert,
- std::vector<HashValueVector>* hashes) {
- // TODO(palmer): Generalize this to handle any and all HashValueTags.
+ std::vector<SHA1Fingerprint>* hashes) {
for (CERTCertListNode* node = CERT_LIST_HEAD(cert_list);
!CERT_LIST_END(node, cert_list);
node = CERT_LIST_NEXT(node)) {
- (*hashes)[HASH_VALUE_SHA1].push_back(CertPublicKeyHashSHA1(node->cert));
- (*hashes)[HASH_VALUE_SHA256].push_back(CertPublicKeyHashSHA256(node->cert));
+ hashes->push_back(CertPublicKeyHash(node->cert));
}
- if (root_cert) {
- (*hashes)[HASH_VALUE_SHA1].push_back(CertPublicKeyHashSHA1(root_cert));
- (*hashes)[HASH_VALUE_SHA256].push_back(CertPublicKeyHashSHA256(root_cert));
- }
+ if (root_cert)
+ hashes->push_back(CertPublicKeyHash(root_cert));
}
// Studied Mozilla's code (esp. security/manager/ssl/src/nsIdentityChecking.cpp
@@ -684,7 +667,7 @@
return false;
}
- SHA1HashValue fingerprint =
+ SHA1Fingerprint fingerprint =
X509Certificate::CalculateFingerprint(root_ca);
std::vector<SECOidTag> ev_policy_tags;
if (!metadata->GetPolicyOIDsForCA(fingerprint, &ev_policy_tags))
« no previous file with comments | « net/base/cert_verify_proc_mac.cc ('k') | net/base/cert_verify_proc_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698