| Index: net/http/transport_security_state_unittest.cc
|
| diff --git a/net/http/transport_security_state_unittest.cc b/net/http/transport_security_state_unittest.cc
|
| index 67e6f9118524f84885a13bf2d4d6c4c2f944bb4c..8a2ebe87e94f40a402afb1d39ec4c82f42d0b757 100644
|
| --- a/net/http/transport_security_state_unittest.cc
|
| +++ b/net/http/transport_security_state_unittest.cc
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/base64.h"
|
| #include "base/files/file_path.h"
|
| +#include "base/rand_util.h"
|
| #include "base/sha1.h"
|
| #include "base/strings/string_piece.h"
|
| #include "crypto/sha2.h"
|
| @@ -92,6 +93,28 @@ TEST_F(TransportSecurityStateTest, MatchesCase1) {
|
| EXPECT_TRUE(state.GetDynamicDomainState("yahoo.com", &domain_state));
|
| }
|
|
|
| +TEST_F(TransportSecurityStateTest, Fuzz) {
|
| + TransportSecurityState state;
|
| + TransportSecurityState::DomainState domain_state;
|
| +
|
| + EnableStaticPins(&state);
|
| +
|
| + for (size_t i = 0; i < 128; i++) {
|
| + std::string hostname;
|
| +
|
| + for (;;) {
|
| + if (base::RandInt(0, 16) == 7) {
|
| + break;
|
| + }
|
| + if (i > 0 && base::RandInt(0, 7) == 7) {
|
| + hostname.append(1, '.');
|
| + }
|
| + hostname.append(1, 'a' + base::RandInt(0, 25));
|
| + }
|
| + state.GetStaticDomainState(hostname, &domain_state);
|
| + }
|
| +}
|
| +
|
| TEST_F(TransportSecurityStateTest, MatchesCase2) {
|
| TransportSecurityState state;
|
| TransportSecurityState::DomainState domain_state;
|
|
|