Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: net/http/transport_security_state_static.template

Issue 2906633003: Add a build flag to configure bundling of HSTS preload list (Closed)
Patch Set: self (one typo) Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // This file is generated by net/tools/transport_security_state_generator/. 5 // This file is generated by net/tools/transport_security_state_generator/.
6 6
7 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_ 7 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
8 #define NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_ 8 #define NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
9 9
10 #include <stdint.h> 10 #include <stdint.h>
11 11
12 #include "net/http/transport_security_state_source.h" 12 #include "net/http/transport_security_state_source.h"
13 13
14 // kNoReportURI is a placeholder for when a pinset does not have a report URI.
15 static const char kNoReportURI[] = "";
16
17 #if BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST)
18
14 // These are SubjectPublicKeyInfo hashes for public key pinning. The 19 // These are SubjectPublicKeyInfo hashes for public key pinning. The
15 // hashes are SHA256 digests. 20 // hashes are SHA256 digests.
16 [[SPKI_HASHES]] 21 [[SPKI_HASHES]]
17 22
18 static const char* const kExpectCTReportURIs[] = [[EXPECT_CT_REPORT_URIS]]; 23 static const char* const kExpectCTReportURIs[] = [[EXPECT_CT_REPORT_URIS]];
19 24
20 static const char* const kExpectStapleReportURIs[] = [[EXPECT_STAPLE_REPORT_URIS ]]; 25 static const char* const kExpectStapleReportURIs[] = [[EXPECT_STAPLE_REPORT_URIS ]];
21 26
22 // kNoRejectedPublicKeys is a placeholder for when no public keys are rejected. 27 // kNoRejectedPublicKeys is a placeholder for when no public keys are rejected.
23 static const char* const kNoRejectedPublicKeys[] = { 28 static const char* const kNoRejectedPublicKeys[] = {
24 nullptr, 29 nullptr,
25 }; 30 };
26 31
27 // kNoReportURI is a placeholder for when a pinset does not have a report URI.
28 static const char kNoReportURI[] = "";
29
30 [[ACCEPTABLE_CERTS]] 32 [[ACCEPTABLE_CERTS]]
31 33
32 static const net::TransportSecurityStateSource::Pinset kPinsets[] = [[PINSETS]]; 34 static const net::TransportSecurityStateSource::Pinset kPinsets[] = [[PINSETS]];
33 35
34 // kHSTSHuffmanTree describes a Huffman tree. The nodes of the tree are pairs 36 // kHSTSHuffmanTree describes a Huffman tree. The nodes of the tree are pairs
35 // of uint8s. The last node in the array is the root of the tree. Each pair is 37 // of uint8s. The last node in the array is the root of the tree. Each pair is
36 // two uint8_t values, the first is "left" and the second is "right". If a 38 // two uint8_t values, the first is "left" and the second is "right". If a
37 // uint8_t value has the MSB set then it represents a literal leaf value. 39 // uint8_t value has the MSB set then it represents a literal leaf value.
38 // Otherwise it's a pointer to the n'th element of the array. 40 // Otherwise it's a pointer to the n'th element of the array.
39 static const uint8_t kHSTSHuffmanTree[] = [[HUFFMAN_TREE]]; 41 static const uint8_t kHSTSHuffmanTree[] = [[HUFFMAN_TREE]];
40 42
41 static const uint8_t kPreloadedHSTSData[] = [[HSTS_TRIE]]; 43 static const uint8_t kPreloadedHSTSData[] = [[HSTS_TRIE]];
42 44
43 static const unsigned kPreloadedHSTSBits = [[HSTS_TRIE_BITS]]; 45 static const unsigned kPreloadedHSTSBits = [[HSTS_TRIE_BITS]];
44 static const unsigned kHSTSRootPosition = [[HSTS_TRIE_ROOT]]; 46 static const unsigned kHSTSRootPosition = [[HSTS_TRIE_ROOT]];
45 47
46 static const net::TransportSecurityStateSource kHSTSSource = { 48 static const net::TransportSecurityStateSource kHSTSSource = {
47 kHSTSHuffmanTree, 49 kHSTSHuffmanTree,
48 sizeof(kHSTSHuffmanTree), 50 sizeof(kHSTSHuffmanTree),
49 kPreloadedHSTSData, 51 kPreloadedHSTSData,
50 kPreloadedHSTSBits, 52 kPreloadedHSTSBits,
51 kHSTSRootPosition, 53 kHSTSRootPosition,
52 kExpectCTReportURIs, 54 kExpectCTReportURIs,
53 kExpectStapleReportURIs, 55 kExpectStapleReportURIs,
54 kPinsets, 56 kPinsets,
55 arraysize(kPinsets) 57 arraysize(kPinsets)
56 }; 58 };
57 59
60 #else
61 static const net::TransportSecurityStateSource kHSTSSource = {
Ryan Sleevi 2017/07/07 16:45:13 I'm not sure it makes sense to force the BUILDFLAG
xunjieli 2017/07/10 22:20:40 Done. Not compiling this when the build flag is tu
62 nullptr,
63 0,
64 nullptr,
65 0,
66 0,
67 nullptr,
68 nullptr,
69 nullptr,
70 0
71 };
72 #endif // BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST)
73
58 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_ 74 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698