1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos SCT_validate, SCT_LIST_validate, SCT_get_validation_status - 6 1.1 christos checks Signed Certificate Timestamps (SCTs) are valid 7 1.1 christos 8 1.1 christos =head1 SYNOPSIS 9 1.1 christos 10 1.1 christos #include <openssl/ct.h> 11 1.1 christos 12 1.1 christos typedef enum { 13 1.1 christos SCT_VALIDATION_STATUS_NOT_SET, 14 1.1 christos SCT_VALIDATION_STATUS_UNKNOWN_LOG, 15 1.1 christos SCT_VALIDATION_STATUS_VALID, 16 1.1 christos SCT_VALIDATION_STATUS_INVALID, 17 1.1 christos SCT_VALIDATION_STATUS_UNVERIFIED, 18 1.1 christos SCT_VALIDATION_STATUS_UNKNOWN_VERSION 19 1.1 christos } sct_validation_status_t; 20 1.1 christos 21 1.1 christos int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx); 22 1.1 christos int SCT_LIST_validate(const STACK_OF(SCT) *scts, CT_POLICY_EVAL_CTX *ctx); 23 1.1 christos sct_validation_status_t SCT_get_validation_status(const SCT *sct); 24 1.1 christos 25 1.1 christos =head1 DESCRIPTION 26 1.1 christos 27 1.1 christos SCT_validate() will check that an SCT is valid and verify its signature. 28 1.1 christos SCT_LIST_validate() performs the same checks on an entire stack of SCTs. 29 1.1 christos The result of the validation checks can be obtained by passing the SCT to 30 1.1 christos SCT_get_validation_status(). 31 1.1 christos 32 1.1 christos A CT_POLICY_EVAL_CTX must be provided that specifies: 33 1.1 christos 34 1.1 christos =over 2 35 1.1 christos 36 1.1 christos =item * 37 1.1 christos 38 1.1 christos The certificate the SCT was issued for. 39 1.1 christos 40 1.1 christos Failure to provide the certificate will result in the validation status being 41 1.1 christos SCT_VALIDATION_STATUS_UNVERIFIED. 42 1.1 christos 43 1.1 christos =item * 44 1.1 christos 45 1.1 christos The issuer of that certificate. 46 1.1 christos 47 1.1 christos This is only required if the SCT was issued for a pre-certificate 48 1.1 christos (see RFC 6962). If it is required but not provided, the validation status will 49 1.1 christos be SCT_VALIDATION_STATUS_UNVERIFIED. 50 1.1 christos 51 1.1 christos =item * 52 1.1 christos 53 1.1 christos A CTLOG_STORE that contains the CT log that issued this SCT. 54 1.1 christos 55 1.1 christos If the SCT was issued by a log that is not in this CTLOG_STORE, the validation 56 1.1 christos status will be SCT_VALIDATION_STATUS_UNKNOWN_LOG. 57 1.1 christos 58 1.1 christos =back 59 1.1 christos 60 1.1 christos If the SCT is of an unsupported version (only v1 is currently supported), the 61 1.1 christos validation status will be SCT_VALIDATION_STATUS_UNKNOWN_VERSION. 62 1.1 christos 63 1.1 christos If the SCT's signature is incorrect, its timestamp is in the future (relative to 64 1.1 christos the time in CT_POLICY_EVAL_CTX), or if it is otherwise invalid, the validation 65 1.1 christos status will be SCT_VALIDATION_STATUS_INVALID. 66 1.1 christos 67 1.1 christos If all checks pass, the validation status will be SCT_VALIDATION_STATUS_VALID. 68 1.1 christos 69 1.1 christos =head1 NOTES 70 1.1 christos 71 1.1 christos A return value of 0 from SCT_LIST_validate() should not be interpreted as a 72 1.1 christos failure. At a minimum, only one valid SCT may provide sufficient confidence 73 1.1 christos that a certificate has been publicly logged. 74 1.1 christos 75 1.1 christos =head1 RETURN VALUES 76 1.1 christos 77 1.1 christos SCT_validate() returns a negative integer if an internal error occurs, 0 if the 78 1.1 christos SCT fails validation, or 1 if the SCT passes validation. 79 1.1 christos 80 1.1 christos SCT_LIST_validate() returns a negative integer if an internal error occurs, 0 81 1.1 christos if any of SCTs fails validation, or 1 if they all pass validation. 82 1.1 christos 83 1.1 christos SCT_get_validation_status() returns the validation status of the SCT. 84 1.1 christos If SCT_validate() or SCT_LIST_validate() have not been passed that SCT, the 85 1.1 christos returned value will be SCT_VALIDATION_STATUS_NOT_SET. 86 1.1 christos 87 1.1 christos =head1 SEE ALSO 88 1.1 christos 89 1.1 christos L<ct(7)> 90 1.1 christos 91 1.1 christos =head1 HISTORY 92 1.1 christos 93 1.1 christos These functions were added in OpenSSL 1.1.0. 94 1.1 christos 95 1.1 christos =head1 COPYRIGHT 96 1.1 christos 97 1.1 christos Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. 98 1.1 christos 99 1.1.1.2 christos Licensed under the Apache License 2.0 (the "License"). You may not use 100 1.1 christos this file except in compliance with the License. You can obtain a copy 101 1.1 christos in the file LICENSE in the source distribution or at 102 1.1 christos L<https://www.openssl.org/source/license.html>. 103 1.1 christos 104 1.1 christos =cut 105