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

Unified Diff: chrome/browser/net/transport_security_persister.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 | « no previous file | chrome/browser/net/transport_security_persister_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/transport_security_persister.cc
===================================================================
--- chrome/browser/net/transport_security_persister.cc (revision 150506)
+++ chrome/browser/net/transport_security_persister.cc (working copy)
@@ -20,46 +20,32 @@
#include "net/base/x509_certificate.h"
using content::BrowserThread;
-using net::HashValue;
-using net::HashValueTag;
-using net::HashValueVector;
+using net::Fingerprint;
+using net::FingerprintVector;
using net::TransportSecurityState;
namespace {
-ListValue* SPKIHashesToListValue(const HashValueVector& hashes) {
+ListValue* SPKIHashesToListValue(const FingerprintVector& hashes) {
ListValue* pins = new ListValue;
- for (HashValueVector::const_iterator i = hashes.begin();
+ for (FingerprintVector::const_iterator i = hashes.begin();
i != hashes.end(); ++i) {
- std::string label;
- switch (i->tag) {
- case net::HASH_VALUE_SHA1:
- label = "sha1/";
- break;
- case net::HASH_VALUE_SHA256:
- label = "sha256/";
- break;
- default:
- LOG(WARNING) << "Skipping invalid fingerprint with unknown type "
- << i->tag;
- continue;
- }
-
- std::string hash_str(reinterpret_cast<const char*>(i->data()), i->size());
+ std::string hash_str(reinterpret_cast<const char*>(i->data),
+ sizeof(i->data));
std::string b64;
base::Base64Encode(hash_str, &b64);
- pins->Append(new StringValue(label + b64));
+ pins->Append(new StringValue("sha1/" + b64));
}
return pins;
}
-void SPKIHashesFromListValue(const ListValue& pins, HashValueVector* hashes) {
+void SPKIHashesFromListValue(const ListValue& pins, FingerprintVector* hashes) {
size_t num_pins = pins.GetSize();
for (size_t i = 0; i < num_pins; ++i) {
std::string type_and_base64;
- HashValue fingerprint;
+ Fingerprint fingerprint;
if (pins.GetString(i, &type_and_base64) &&
TransportSecurityState::ParsePin(type_and_base64, &fingerprint)) {
hashes->push_back(fingerprint);
« no previous file with comments | « no previous file | chrome/browser/net/transport_security_persister_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698