Chromium Code Reviews| Index: chrome/browser/net/transport_security_persister.cc |
| =================================================================== |
| --- chrome/browser/net/transport_security_persister.cc (revision 153687) |
| +++ chrome/browser/net/transport_security_persister.cc (working copy) |
| @@ -20,32 +20,33 @@ |
| #include "net/base/x509_certificate.h" |
| using content::BrowserThread; |
| -using net::Fingerprint; |
| -using net::FingerprintVector; |
| +using net::HashValue; |
| +using net::HashValueTag; |
| +using net::HashValueVector; |
| using net::TransportSecurityState; |
| namespace { |
| -ListValue* SPKIHashesToListValue(const FingerprintVector& hashes) { |
| +ListValue* SPKIHashesToListValue(const HashValueVector& hashes) { |
| ListValue* pins = new ListValue; |
| - for (FingerprintVector::const_iterator i = hashes.begin(); |
| + for (HashValueVector::const_iterator i = hashes.begin(); |
| i != hashes.end(); ++i) { |
| - std::string hash_str(reinterpret_cast<const char*>(i->data), |
| - sizeof(i->data)); |
| + std::string hash_str(reinterpret_cast<const char*>(i->data()), i->size()); |
| std::string b64; |
| base::Base64Encode(hash_str, &b64); |
|
cbentzel
2012/08/31 00:38:01
I notice that you aren't handling the return boole
palmer
2012/09/04 23:23:33
I agree. Would you like me to check Base64Encode's
cbentzel
2012/09/05 13:05:47
For now, yes. Probably should fix the function in
palmer
2012/09/05 22:23:25
Done.
|
| - pins->Append(new StringValue("sha1/" + b64)); |
| + pins->Append(new StringValue(TransportSecurityState::HashValueLabel(*i) + |
| + b64)); |
| } |
| return pins; |
| } |
| -void SPKIHashesFromListValue(const ListValue& pins, FingerprintVector* hashes) { |
| +void SPKIHashesFromListValue(const ListValue& pins, HashValueVector* hashes) { |
| size_t num_pins = pins.GetSize(); |
| for (size_t i = 0; i < num_pins; ++i) { |
| std::string type_and_base64; |
| - Fingerprint fingerprint; |
| + HashValue fingerprint; |
| if (pins.GetString(i, &type_and_base64) && |
| TransportSecurityState::ParsePin(type_and_base64, &fingerprint)) { |
| hashes->push_back(fingerprint); |