OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 5 #ifndef NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
6 #define NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 6 #define NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "net/base/hash_value.h" | 14 #include "net/base/hash_value.h" |
15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class Pickle; | 18 class Pickle; |
19 class PickleIterator; | 19 class PickleIterator; |
20 } | 20 } |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 | 23 |
24 // Structures related to Certificate Transparency (RFC6962). | 24 // Structures related to Certificate Transparency (RFC6962). |
25 namespace ct { | 25 namespace ct { |
26 | 26 |
27 // LogEntry struct in RFC 6962, Section 3.1 | 27 // Similar to LogEntry struct in RFC 6962, Section 3.1, with the following |
28 // differences: | |
29 // 1. Only contains end-entities, no chains. | |
30 // 2. Instead of a Precertificate, it contains a PreCert(from Section 3.2). | |
31 // (Precertificate = Certificate with poison extension | |
32 // PreCert = issuer_key_hash + TBSCertificate without poison extension) | |
Ryan Sleevi
2017/04/18 14:53:29
Right, this is actually the signed_entry of an SCT
Eran Messeri
2017/04/19 10:42:07
Nit: The precertificate isn't being verified - it
mattm
2017/04/21 21:12:15
Done.
| |
28 struct NET_EXPORT LogEntry { | 33 struct NET_EXPORT LogEntry { |
29 // LogEntryType enum in RFC 6962, Section 3.1 | 34 // LogEntryType enum in RFC 6962, Section 3.1 |
30 enum Type { | 35 enum Type { |
31 LOG_ENTRY_TYPE_X509 = 0, | 36 LOG_ENTRY_TYPE_X509 = 0, |
32 LOG_ENTRY_TYPE_PRECERT = 1 | 37 LOG_ENTRY_TYPE_PRECERT = 1 |
33 }; | 38 }; |
34 | 39 |
35 LogEntry(); | 40 LogEntry(); |
36 ~LogEntry(); | 41 ~LogEntry(); |
37 void Reset(); | 42 void Reset(); |
38 | 43 |
39 Type type; | 44 Type type; |
40 | 45 |
41 // Set if type == LOG_ENTRY_TYPE_X509 | 46 // Set if type == LOG_ENTRY_TYPE_X509 |
42 std::string leaf_certificate; | 47 std::string leaf_certificate; |
43 | 48 |
49 // PreCert struct in RFC 6962, Section 3.2. | |
44 // Set if type == LOG_ENTRY_TYPE_PRECERT | 50 // Set if type == LOG_ENTRY_TYPE_PRECERT |
45 SHA256HashValue issuer_key_hash; | 51 SHA256HashValue issuer_key_hash; |
46 std::string tbs_certificate; | 52 std::string tbs_certificate; |
47 }; | 53 }; |
48 | 54 |
49 // Helper structure to represent Digitally Signed data, as described in | 55 // Helper structure to represent Digitally Signed data, as described in |
50 // Sections 4.7 and 7.4.1.4.1 of RFC 5246. | 56 // Sections 4.7 and 7.4.1.4.1 of RFC 5246. |
51 struct NET_EXPORT_PRIVATE DigitallySigned { | 57 struct NET_EXPORT_PRIVATE DigitallySigned { |
52 enum HashAlgorithm { | 58 enum HashAlgorithm { |
53 HASH_ALGO_NONE = 0, | 59 HASH_ALGO_NONE = 0, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 ~SignedCertificateTimestamp(); | 136 ~SignedCertificateTimestamp(); |
131 | 137 |
132 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); | 138 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp); |
133 }; | 139 }; |
134 | 140 |
135 } // namespace ct | 141 } // namespace ct |
136 | 142 |
137 } // namespace net | 143 } // namespace net |
138 | 144 |
139 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ | 145 #endif // NET_CERT_SIGNED_CERTIFICATE_TIMESTAMP_H_ |
OLD | NEW |