1CT_POLICY_EVAL_CTX_NEW(3) OpenSSL CT_POLICY_EVAL_CTX_NEW(3)
2
3
4
6 CT_POLICY_EVAL_CTX_new, CT_POLICY_EVAL_CTX_free,
7 CT_POLICY_EVAL_CTX_get0_cert, CT_POLICY_EVAL_CTX_set1_cert,
8 CT_POLICY_EVAL_CTX_get0_issuer, CT_POLICY_EVAL_CTX_set1_issuer,
9 CT_POLICY_EVAL_CTX_get0_log_store,
10 CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE, CT_POLICY_EVAL_CTX_get_time,
11 CT_POLICY_EVAL_CTX_set_time - Encapsulates the data required to
12 evaluate whether SCTs meet a Certificate Transparency policy
13
15 #include <openssl/ct.h>
16
17 CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
18 void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
19 X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
20 int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
21 X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
22 int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
23 const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);
24 void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx,
25 CTLOG_STORE *log_store);
26 uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx);
27 void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms);
28
30 A CT_POLICY_EVAL_CTX is used by functions that evaluate whether Signed
31 Certificate Timestamps (SCTs) fulfil a Certificate Transparency (CT)
32 policy. This policy may be, for example, that at least one valid SCT
33 is available. To determine this, an SCT's timestamp and signature must
34 be verified. This requires:
35
36 • the public key of the log that issued the SCT
37
38 • the certificate that the SCT was issued for
39
40 • the issuer certificate (if the SCT was issued for a pre-certificate)
41
42 • the current time
43
44 The above requirements are met using the setters described below.
45
46 CT_POLICY_EVAL_CTX_new() creates an empty policy evaluation context.
47 This should then be populated using:
48
49 • CT_POLICY_EVAL_CTX_set1_cert() to provide the certificate the SCTs
50 were issued for
51
52 Increments the reference count of the certificate.
53
54 • CT_POLICY_EVAL_CTX_set1_issuer() to provide the issuer certificate
55
56 Increments the reference count of the certificate.
57
58 • CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE() to provide a list of logs
59 that are trusted as sources of SCTs
60
61 Holds a pointer to the CTLOG_STORE, so the CTLOG_STORE must outlive
62 the CT_POLICY_EVAL_CTX.
63
64 • CT_POLICY_EVAL_CTX_set_time() to set the time SCTs should be compared
65 with to determine if they are valid
66
67 The SCT timestamp will be compared to this time to check whether the
68 SCT was issued in the future. RFC6962 states that "TLS clients MUST
69 reject SCTs whose timestamp is in the future". By default, this will
70 be set to 5 minutes in the future (e.g. (time() + 300) * 1000), to
71 allow for clock drift.
72
73 The time should be in milliseconds since the Unix epoch.
74
75 Each setter has a matching getter for accessing the current value.
76
77 When no longer required, the CT_POLICY_EVAL_CTX should be passed to
78 CT_POLICY_EVAL_CTX_free() to delete it.
79
81 The issuer certificate only needs to be provided if at least one of the
82 SCTs was issued for a pre-certificate. This will be the case for SCTs
83 embedded in a certificate (i.e. those in an X.509 extension), but may
84 not be the case for SCTs found in the TLS SCT extension or OCSP
85 response.
86
88 CT_POLICY_EVAL_CTX_new() will return NULL if malloc fails.
89
91 ct(7)
92
94 These functions were added in OpenSSL 1.1.0.
95
97 Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
98
99 Licensed under the OpenSSL license (the "License"). You may not use
100 this file except in compliance with the License. You can obtain a copy
101 in the file LICENSE in the source distribution or at
102 <https://www.openssl.org/source/license.html>.
103
104
105
1061.1.1i 2021-01-26 CT_POLICY_EVAL_CTX_NEW(3)