xref: /aosp_15_r20/external/cronet/net/http/transport_security_state_static.template (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// Copyright 2012 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// This file is generated by net/tools/transport_security_state_generator/.
6
7#ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
8#define NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
9
10#include <stdint.h>
11
12#include <iterator>
13
14#include "base/time/time.h"
15#include "net/http/transport_security_state_source.h"
16
17// This is the time at which the key pins list was last updated.
18const base::Time kPinsListTimestamp = base::Time::FromTimeT([[PINS_LIST_TIMESTAMP]]);
19
20// These are SubjectPublicKeyInfo hashes for public key pinning. The
21// hashes are SHA256 digests.
22[[SPKI_HASHES]]
23
24// kNoRejectedPublicKeys is a placeholder for when no public keys are rejected.
25static const char* const kNoRejectedPublicKeys[] = {
26    nullptr,
27};
28
29[[ACCEPTABLE_CERTS]]
30
31static const net::TransportSecurityStateSource::Pinset kPinsets[] = [[PINSETS]];
32
33// kHSTSHuffmanTree describes a Huffman tree. The nodes of the tree are pairs
34// of uint8s. The last node in the array is the root of the tree. Each pair is
35// two uint8_t values, the first is "left" and the second is "right". If a
36// uint8_t value has the MSB set then it represents a literal leaf value.
37// Otherwise it's a pointer to the n'th element of the array.
38static const uint8_t kHSTSHuffmanTree[] = [[HUFFMAN_TREE]];
39
40static const uint8_t kPreloadedHSTSData[] = [[HSTS_TRIE]];
41
42static const unsigned kPreloadedHSTSBits = [[HSTS_TRIE_BITS]];
43static const unsigned kHSTSRootPosition = [[HSTS_TRIE_ROOT]];
44
45static const net::TransportSecurityStateSource kHSTSSource = {
46  kHSTSHuffmanTree,
47  sizeof(kHSTSHuffmanTree),
48  kPreloadedHSTSData,
49  kPreloadedHSTSBits,
50  kHSTSRootPosition,
51  kPinsets,
52  std::size(kPinsets)
53};
54
55#endif  // NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
56