| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/cert/cert_verify_proc_whitelist.h" | 5 #include "net/cert/cert_verify_proc_whitelist.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 | 8 |
| 9 #include "net/base/lookup_string_in_fixed_set.h" | 9 #include "net/base/lookup_string_in_fixed_set.h" |
| 10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 // Comparator to compare a (SHA-256) HashValue with a uint8_t array containing | 52 // Comparator to compare a (SHA-256) HashValue with a uint8_t array containing |
| 53 // a raw SHA-256 hash. Return value follows memcmp semantics. | 53 // a raw SHA-256 hash. Return value follows memcmp semantics. |
| 54 int CompareHashValueToRawHash(const void* key, const void* element) { | 54 int CompareHashValueToRawHash(const void* key, const void* element) { |
| 55 const HashValue* search_key = reinterpret_cast<const HashValue*>(key); | 55 const HashValue* search_key = reinterpret_cast<const HashValue*>(key); |
| 56 return memcmp(search_key->data(), element, search_key->size()); | 56 return memcmp(search_key->data(), element, search_key->size()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 namespace wosign { | 59 namespace wosign { |
| 60 #include "net/data/ssl/wosign/wosign_domains-inc.cc" | 60 #include "net/data/ssl/wosign/wosign_domains-inc.cc" |
| 61 } // namespace | 61 } // namespace wosign |
| 62 | 62 |
| 63 } // namespace | 63 } // namespace |
| 64 | 64 |
| 65 bool IsNonWhitelistedCertificate(const X509Certificate& cert, | 65 bool IsNonWhitelistedCertificate(const X509Certificate& cert, |
| 66 const HashValueVector& public_key_hashes, | 66 const HashValueVector& public_key_hashes, |
| 67 base::StringPiece hostname) { | 67 base::StringPiece hostname) { |
| 68 for (const auto& hash : public_key_hashes) { | 68 for (const auto& hash : public_key_hashes) { |
| 69 if (hash.tag != HASH_VALUE_SHA256) | 69 if (hash.tag != HASH_VALUE_SHA256) |
| 70 continue; | 70 continue; |
| 71 | 71 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 domain_length) != kDafsaNotFound) { | 120 domain_length) != kDafsaNotFound) { |
| 121 return true; | 121 return true; |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 return LookupStringInFixedSet(graph, graph_length, host.data(), end) != | 125 return LookupStringInFixedSet(graph, graph_length, host.data(), end) != |
| 126 kDafsaNotFound; | 126 kDafsaNotFound; |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace net | 129 } // namespace net |
| OLD | NEW |