| 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 "base/version.h" | 14 #include "base/version.h" |
| 15 #include "net/cert/ct_ev_whitelist.h" | 15 #include "net/cert/ct_ev_whitelist.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class FilePath; | 18 class FilePath; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace packed_ct_ev_whitelist { |
| 22 |
| 21 // An implementation of the EVCertsWhitelist that gets its data packed using | 23 // An implementation of the EVCertsWhitelist that gets its data packed using |
| 22 // Golomb coding to encode the difference between subsequent hash values. | 24 // Golomb coding to encode the difference between subsequent hash values. |
| 23 // Format of the packed list: | 25 // Format of the packed list: |
| 24 // * First 8 bytes: First hash | 26 // * First 8 bytes: First hash |
| 25 // * Repeating Golomb-coded number which is the numeric difference of the | 27 // * Repeating Golomb-coded number which is the numeric difference of the |
| 26 // previous hash value from this one | 28 // previous hash value from this one |
| 27 // | 29 // |
| 28 // The resulting, unpacked list is a sorted list of hash values that can be | 30 // The resulting, unpacked list is a sorted list of hash values that can be |
| 29 // efficiently searched. | 31 // efficiently searched. |
| 30 class PackedEVCertsWhitelist : public net::ct::EVCertsWhitelist { | 32 class PackedEVCertsWhitelist : public net::ct::EVCertsWhitelist { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 base::Version version_; | 77 base::Version version_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(PackedEVCertsWhitelist); | 79 DISALLOW_COPY_AND_ASSIGN(PackedEVCertsWhitelist); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 // Sets the EV certificate hashes whitelist in the SSLConfigService | 82 // Sets the EV certificate hashes whitelist in the SSLConfigService |
| 81 // to the provided |whitelist|, if valid. Otherwise, does nothing. | 83 // to the provided |whitelist|, if valid. Otherwise, does nothing. |
| 82 // To set the new whitelist, this function dispatches a task to the IO thread. | 84 // To set the new whitelist, this function dispatches a task to the IO thread. |
| 83 void SetEVCertsWhitelist(scoped_refptr<net::ct::EVCertsWhitelist> whitelist); | 85 void SetEVCertsWhitelist(scoped_refptr<net::ct::EVCertsWhitelist> whitelist); |
| 84 | 86 |
| 85 #endif // CHROME_BROWSER_NET_PACKED_CT_EV_WHITELIST_H_ | 87 } // namespace packed_ct_ev_whitelist |
| 88 |
| 89 #endif // COMPONENTS_PACKED_CT_EV_WHITELIST_PACKED_CT_EV_WHITELIST_H_ |
| OLD | NEW |