summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ct/ct_local.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/ct/ct_local.h96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/lib/libcrypto/ct/ct_local.h b/src/lib/libcrypto/ct/ct_local.h
index 9f983c91be..75ff4d8f75 100644
--- a/src/lib/libcrypto/ct/ct_local.h
+++ b/src/lib/libcrypto/ct/ct_local.h
@@ -18,8 +18,8 @@
18 * From RFC6962: opaque SerializedSCT<1..2^16-1>; struct { SerializedSCT 18 * From RFC6962: opaque SerializedSCT<1..2^16-1>; struct { SerializedSCT
19 * sct_list <1..2^16-1>; } SignedCertificateTimestampList; 19 * sct_list <1..2^16-1>; } SignedCertificateTimestampList;
20 */ 20 */
21# define MAX_SCT_SIZE 65535 21#define MAX_SCT_SIZE 65535
22# define MAX_SCT_LIST_SIZE MAX_SCT_SIZE 22#define MAX_SCT_LIST_SIZE MAX_SCT_SIZE
23 23
24/* 24/*
25 * Macros to read and write integers in network-byte order. 25 * Macros to read and write integers in network-byte order.
@@ -55,60 +55,60 @@
55 55
56/* Signed Certificate Timestamp */ 56/* Signed Certificate Timestamp */
57struct sct_st { 57struct sct_st {
58 sct_version_t version; 58 sct_version_t version;
59 /* If version is not SCT_VERSION_V1, this contains the encoded SCT */ 59 /* If version is not SCT_VERSION_V1, this contains the encoded SCT */
60 unsigned char *sct; 60 unsigned char *sct;
61 size_t sct_len; 61 size_t sct_len;
62 /* If version is SCT_VERSION_V1, fields below contain components of the SCT */ 62 /* If version is SCT_VERSION_V1, fields below contain components of the SCT */
63 unsigned char *log_id; 63 unsigned char *log_id;
64 size_t log_id_len; 64 size_t log_id_len;
65 /* 65 /*
66 * Note, we cannot distinguish between an unset timestamp, and one 66 * Note, we cannot distinguish between an unset timestamp, and one
67 * that is set to 0. However since CT didn't exist in 1970, no real 67 * that is set to 0. However since CT didn't exist in 1970, no real
68 * SCT should ever be set as such. 68 * SCT should ever be set as such.
69 */ 69 */
70 uint64_t timestamp; 70 uint64_t timestamp;
71 unsigned char *ext; 71 unsigned char *ext;
72 size_t ext_len; 72 size_t ext_len;
73 unsigned char hash_alg; 73 unsigned char hash_alg;
74 unsigned char sig_alg; 74 unsigned char sig_alg;
75 unsigned char *sig; 75 unsigned char *sig;
76 size_t sig_len; 76 size_t sig_len;
77 /* Log entry type */ 77 /* Log entry type */
78 ct_log_entry_type_t entry_type; 78 ct_log_entry_type_t entry_type;
79 /* Where this SCT was found, e.g. certificate, OCSP response, etc. */ 79 /* Where this SCT was found, e.g. certificate, OCSP response, etc. */
80 sct_source_t source; 80 sct_source_t source;
81 /* The result of the last attempt to validate this SCT. */ 81 /* The result of the last attempt to validate this SCT. */
82 sct_validation_status_t validation_status; 82 sct_validation_status_t validation_status;
83}; 83};
84 84
85/* Miscellaneous data that is useful when verifying an SCT */ 85/* Miscellaneous data that is useful when verifying an SCT */
86struct sct_ctx_st { 86struct sct_ctx_st {
87 /* Public key */ 87 /* Public key */
88 EVP_PKEY *pkey; 88 EVP_PKEY *pkey;
89 /* Hash of public key */ 89 /* Hash of public key */
90 unsigned char *pkeyhash; 90 unsigned char *pkeyhash;
91 size_t pkeyhashlen; 91 size_t pkeyhashlen;
92 /* For pre-certificate: issuer public key hash */ 92 /* For pre-certificate: issuer public key hash */
93 unsigned char *ihash; 93 unsigned char *ihash;
94 size_t ihashlen; 94 size_t ihashlen;
95 /* certificate encoding */ 95 /* certificate encoding */
96 unsigned char *certder; 96 unsigned char *certder;
97 size_t certderlen; 97 size_t certderlen;
98 /* pre-certificate encoding */ 98 /* pre-certificate encoding */
99 unsigned char *preder; 99 unsigned char *preder;
100 size_t prederlen; 100 size_t prederlen;
101 /* milliseconds since epoch (to check that the SCT isn't from the future) */ 101 /* milliseconds since epoch (to check that the SCT isn't from the future) */
102 uint64_t epoch_time_in_ms; 102 uint64_t epoch_time_in_ms;
103}; 103};
104 104
105/* Context when evaluating whether a Certificate Transparency policy is met */ 105/* Context when evaluating whether a Certificate Transparency policy is met */
106struct ct_policy_eval_ctx_st { 106struct ct_policy_eval_ctx_st {
107 X509 *cert; 107 X509 *cert;
108 X509 *issuer; 108 X509 *issuer;
109 CTLOG_STORE *log_store; 109 CTLOG_STORE *log_store;
110 /* milliseconds since epoch (to check that SCTs aren't from the future) */ 110 /* milliseconds since epoch (to check that SCTs aren't from the future) */
111 uint64_t epoch_time_in_ms; 111 uint64_t epoch_time_in_ms;
112}; 112};
113 113
114/* 114/*