diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/ct/ct.h | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/src/lib/libcrypto/ct/ct.h b/src/lib/libcrypto/ct/ct.h index ebdba34d67..ac981fa0b5 100644 --- a/src/lib/libcrypto/ct/ct.h +++ b/src/lib/libcrypto/ct/ct.h | |||
@@ -8,51 +8,51 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef HEADER_CT_H | 10 | #ifndef HEADER_CT_H |
11 | # define HEADER_CT_H | 11 | #define HEADER_CT_H |
12 | 12 | ||
13 | # include <openssl/opensslconf.h> | 13 | #include <openssl/opensslconf.h> |
14 | 14 | ||
15 | # ifndef OPENSSL_NO_CT | 15 | #ifndef OPENSSL_NO_CT |
16 | # include <openssl/ossl_typ.h> | 16 | #include <openssl/ossl_typ.h> |
17 | # include <openssl/safestack.h> | 17 | #include <openssl/safestack.h> |
18 | # include <openssl/x509.h> | 18 | #include <openssl/x509.h> |
19 | # include <openssl/cterr.h> | 19 | #include <openssl/cterr.h> |
20 | # ifdef __cplusplus | 20 | #ifdef __cplusplus |
21 | extern "C" { | 21 | extern "C" { |
22 | # endif | 22 | #endif |
23 | 23 | ||
24 | 24 | ||
25 | /* Minimum RSA key size, from RFC6962 */ | 25 | /* Minimum RSA key size, from RFC6962 */ |
26 | # define SCT_MIN_RSA_BITS 2048 | 26 | #define SCT_MIN_RSA_BITS 2048 |
27 | 27 | ||
28 | /* All hashes are SHA256 in v1 of Certificate Transparency */ | 28 | /* All hashes are SHA256 in v1 of Certificate Transparency */ |
29 | # define CT_V1_HASHLEN SHA256_DIGEST_LENGTH | 29 | #define CT_V1_HASHLEN SHA256_DIGEST_LENGTH |
30 | 30 | ||
31 | typedef enum { | 31 | typedef enum { |
32 | CT_LOG_ENTRY_TYPE_NOT_SET = -1, | 32 | CT_LOG_ENTRY_TYPE_NOT_SET = -1, |
33 | CT_LOG_ENTRY_TYPE_X509 = 0, | 33 | CT_LOG_ENTRY_TYPE_X509 = 0, |
34 | CT_LOG_ENTRY_TYPE_PRECERT = 1 | 34 | CT_LOG_ENTRY_TYPE_PRECERT = 1 |
35 | } ct_log_entry_type_t; | 35 | } ct_log_entry_type_t; |
36 | 36 | ||
37 | typedef enum { | 37 | typedef enum { |
38 | SCT_VERSION_NOT_SET = -1, | 38 | SCT_VERSION_NOT_SET = -1, |
39 | SCT_VERSION_V1 = 0 | 39 | SCT_VERSION_V1 = 0 |
40 | } sct_version_t; | 40 | } sct_version_t; |
41 | 41 | ||
42 | typedef enum { | 42 | typedef enum { |
43 | SCT_SOURCE_UNKNOWN, | 43 | SCT_SOURCE_UNKNOWN, |
44 | SCT_SOURCE_TLS_EXTENSION, | 44 | SCT_SOURCE_TLS_EXTENSION, |
45 | SCT_SOURCE_X509V3_EXTENSION, | 45 | SCT_SOURCE_X509V3_EXTENSION, |
46 | SCT_SOURCE_OCSP_STAPLED_RESPONSE | 46 | SCT_SOURCE_OCSP_STAPLED_RESPONSE |
47 | } sct_source_t; | 47 | } sct_source_t; |
48 | 48 | ||
49 | typedef enum { | 49 | typedef enum { |
50 | SCT_VALIDATION_STATUS_NOT_SET, | 50 | SCT_VALIDATION_STATUS_NOT_SET, |
51 | SCT_VALIDATION_STATUS_UNKNOWN_LOG, | 51 | SCT_VALIDATION_STATUS_UNKNOWN_LOG, |
52 | SCT_VALIDATION_STATUS_VALID, | 52 | SCT_VALIDATION_STATUS_VALID, |
53 | SCT_VALIDATION_STATUS_INVALID, | 53 | SCT_VALIDATION_STATUS_INVALID, |
54 | SCT_VALIDATION_STATUS_UNVERIFIED, | 54 | SCT_VALIDATION_STATUS_UNVERIFIED, |
55 | SCT_VALIDATION_STATUS_UNKNOWN_VERSION | 55 | SCT_VALIDATION_STATUS_UNKNOWN_VERSION |
56 | } sct_validation_status_t; | 56 | } sct_validation_status_t; |
57 | 57 | ||
58 | DEFINE_STACK_OF(SCT) | 58 | DEFINE_STACK_OF(SCT) |
@@ -288,7 +288,7 @@ void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs); | |||
288 | * came from, so that the log names can be printed. | 288 | * came from, so that the log names can be printed. |
289 | */ | 289 | */ |
290 | void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent, | 290 | void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent, |
291 | const char *separator, const CTLOG_STORE *logs); | 291 | const char *separator, const CTLOG_STORE *logs); |
292 | 292 | ||
293 | /* | 293 | /* |
294 | * Gets the last result of validating this SCT. | 294 | * Gets the last result of validating this SCT. |
@@ -313,7 +313,7 @@ __owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx); | |||
313 | * Returns a negative integer if an error occurs. | 313 | * Returns a negative integer if an error occurs. |
314 | */ | 314 | */ |
315 | __owur int SCT_LIST_validate(const STACK_OF(SCT) *scts, | 315 | __owur int SCT_LIST_validate(const STACK_OF(SCT) *scts, |
316 | CT_POLICY_EVAL_CTX *ctx); | 316 | CT_POLICY_EVAL_CTX *ctx); |
317 | 317 | ||
318 | 318 | ||
319 | /********************************* | 319 | /********************************* |
@@ -345,7 +345,7 @@ __owur int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); | |||
345 | * not defined. | 345 | * not defined. |
346 | */ | 346 | */ |
347 | STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, | 347 | STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, |
348 | size_t len); | 348 | size_t len); |
349 | 349 | ||
350 | /* | 350 | /* |
351 | * Serialize (to DER format) a stack of SCTs and return the length. | 351 | * Serialize (to DER format) a stack of SCTs and return the length. |
@@ -372,7 +372,7 @@ __owur int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); | |||
372 | * not defined. | 372 | * not defined. |
373 | */ | 373 | */ |
374 | STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, | 374 | STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, |
375 | long len); | 375 | long len); |
376 | 376 | ||
377 | /* | 377 | /* |
378 | * Serialize (to TLS format) an |sct| and write it to |out|. | 378 | * Serialize (to TLS format) an |sct| and write it to |out|. |
@@ -428,7 +428,7 @@ void CTLOG_free(CTLOG *log); | |||
428 | const char *CTLOG_get0_name(const CTLOG *log); | 428 | const char *CTLOG_get0_name(const CTLOG *log); |
429 | /* Gets the ID of the CT log */ | 429 | /* Gets the ID of the CT log */ |
430 | void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id, | 430 | void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id, |
431 | size_t *log_id_len); | 431 | size_t *log_id_len); |
432 | /* Gets the public key of the CT log */ | 432 | /* Gets the public key of the CT log */ |
433 | EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log); | 433 | EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log); |
434 | 434 | ||
@@ -452,8 +452,7 @@ void CTLOG_STORE_free(CTLOG_STORE *store); | |||
452 | * Returns the CT log, or NULL if no match is found. | 452 | * Returns the CT log, or NULL if no match is found. |
453 | */ | 453 | */ |
454 | const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store, | 454 | const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store, |
455 | const uint8_t *log_id, | 455 | const uint8_t *log_id, size_t log_id_len); |
456 | size_t log_id_len); | ||
457 | 456 | ||
458 | /* | 457 | /* |
459 | * Loads a CT log list into a |store| from a |file|. | 458 | * Loads a CT log list into a |store| from a |file|. |