| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_NET_PACKED_CT_EV_WHITELIST_H_ | 5 #ifndef COMPONENTS_PACKED_CT_EV_WHITELIST_PACKED_CT_EV_WHITELIST_H_ |
| 6 #define CHROME_BROWSER_NET_PACKED_CT_EV_WHITELIST_H_ | 6 #define COMPONENTS_PACKED_CT_EV_WHITELIST_PACKED_CT_EV_WHITELIST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "net/cert/ct_ev_whitelist.h" | 14 #include "net/cert/ct_ev_whitelist.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class FilePath; | 17 class FilePath; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace packed_ct_ev_whitelist { |
| 21 |
| 20 // An implementation of the EVCertsWhitelist that gets its data packed using | 22 // An implementation of the EVCertsWhitelist that gets its data packed using |
| 21 // Golomb coding to encode the difference between subsequent hash values. | 23 // Golomb coding to encode the difference between subsequent hash values. |
| 22 // Format of the packed list: | 24 // Format of the packed list: |
| 23 // * First 8 bytes: First hash | 25 // * First 8 bytes: First hash |
| 24 // * Repeating Golomb-coded number which is the numeric difference of the | 26 // * Repeating Golomb-coded number which is the numeric difference of the |
| 25 // previous hash value from this one | 27 // previous hash value from this one |
| 26 // | 28 // |
| 27 // The resulting, unpacked list is a sorted list of hash values that can be | 29 // The resulting, unpacked list is a sorted list of hash values that can be |
| 28 // efficiently searched. | 30 // efficiently searched. |
| 29 class PackedEVCertsWhitelist : public net::ct::EVCertsWhitelist { | 31 class PackedEVCertsWhitelist : public net::ct::EVCertsWhitelist { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 std::vector<uint64_t> whitelist_; | 71 std::vector<uint64_t> whitelist_; |
| 70 | 72 |
| 71 DISALLOW_COPY_AND_ASSIGN(PackedEVCertsWhitelist); | 73 DISALLOW_COPY_AND_ASSIGN(PackedEVCertsWhitelist); |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 // Sets the EV certificate hashes whitelist in the SSLConfigService | 76 // Sets the EV certificate hashes whitelist in the SSLConfigService |
| 75 // to the provided |whitelist|, if valid. Otherwise, does nothing. | 77 // to the provided |whitelist|, if valid. Otherwise, does nothing. |
| 76 // To set the new whitelist, this function dispatches a task to the IO thread. | 78 // To set the new whitelist, this function dispatches a task to the IO thread. |
| 77 void SetEVCertsWhitelist(scoped_refptr<net::ct::EVCertsWhitelist> whitelist); | 79 void SetEVCertsWhitelist(scoped_refptr<net::ct::EVCertsWhitelist> whitelist); |
| 78 | 80 |
| 79 #endif // CHROME_BROWSER_NET_PACKED_CT_EV_WHITELIST_H_ | 81 } // namespace packed_ct_ev_whitelist |
| 82 |
| 83 #endif // COMPONENTS_PACKED_CT_EV_WHITELIST_PACKED_CT_EV_WHITELIST_H_ |
| OLD | NEW |