OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/transport_security_state.h" | 5 #include "net/base/transport_security_state.h" |
6 | 6 |
7 #if defined(USE_OPENSSL) | 7 #if defined(USE_OPENSSL) |
8 #include <openssl/ecdsa.h> | 8 #include <openssl/ecdsa.h> |
9 #include <openssl/ssl.h> | 9 #include <openssl/ssl.h> |
10 #else // !defined(USE_OPENSSL) | 10 #else // !defined(USE_OPENSSL) |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 SPKIHashesToListValue(i->second.preloaded_spki_hashes)); | 870 SPKIHashesToListValue(i->second.preloaded_spki_hashes)); |
871 | 871 |
872 if (now < i->second.dynamic_spki_hashes_expiry) { | 872 if (now < i->second.dynamic_spki_hashes_expiry) { |
873 state->Set("dynamic_spki_hashes", | 873 state->Set("dynamic_spki_hashes", |
874 SPKIHashesToListValue(i->second.dynamic_spki_hashes)); | 874 SPKIHashesToListValue(i->second.dynamic_spki_hashes)); |
875 } | 875 } |
876 | 876 |
877 toplevel.Set(HashedDomainToExternalString(i->first), state); | 877 toplevel.Set(HashedDomainToExternalString(i->first), state); |
878 } | 878 } |
879 | 879 |
880 base::JSONWriter::Write(&toplevel, true /* pretty print */, output); | 880 base::JSONWriter::WriteWithOptions(&toplevel, |
| 881 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
| 882 output); |
881 return true; | 883 return true; |
882 } | 884 } |
883 | 885 |
884 bool TransportSecurityState::LoadEntries(const std::string& input, | 886 bool TransportSecurityState::LoadEntries(const std::string& input, |
885 bool* dirty) { | 887 bool* dirty) { |
886 DCHECK(CalledOnValidThread()); | 888 DCHECK(CalledOnValidThread()); |
887 | 889 |
888 enabled_hosts_.clear(); | 890 enabled_hosts_.clear(); |
889 return Deserialise(input, dirty, &enabled_hosts_); | 891 return Deserialise(input, dirty, &enabled_hosts_); |
890 } | 892 } |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 | 1657 |
1656 return true; | 1658 return true; |
1657 } | 1659 } |
1658 | 1660 |
1659 bool TransportSecurityState::DomainState::ShouldRedirectHTTPToHTTPS() | 1661 bool TransportSecurityState::DomainState::ShouldRedirectHTTPToHTTPS() |
1660 const { | 1662 const { |
1661 return mode == MODE_STRICT; | 1663 return mode == MODE_STRICT; |
1662 } | 1664 } |
1663 | 1665 |
1664 } // namespace | 1666 } // namespace |
OLD | NEW |