63 # include <openssl/opensslconf.h>
64 # include <openssl/symhacks.h>
65 # ifndef OPENSSL_NO_BUFFER
66 # include <openssl/buffer.h>
68 # ifndef OPENSSL_NO_EVP
69 # include <openssl/evp.h>
71 # ifndef OPENSSL_NO_BIO
72 # include <openssl/bio.h>
74 # include <openssl/stack.h>
75 # include <openssl/asn1.h>
76 # include <openssl/safestack.h>
78 # ifndef OPENSSL_NO_RSA
79 # include <openssl/rsa.h>
82 # ifndef OPENSSL_NO_DSA
83 # include <openssl/dsa.h>
86 # ifndef OPENSSL_NO_DH
87 # include <openssl/dh.h>
99 # include <openssl/x509.h>
100 # include <openssl/x509v3.h>
130 ASN1_BOOLEAN cert_req;
174 ASN1_BOOLEAN ordering;
195 # define TS_STATUS_GRANTED 0
196 # define TS_STATUS_GRANTED_WITH_MODS 1
197 # define TS_STATUS_REJECTION 2
198 # define TS_STATUS_WAITING 3
199 # define TS_STATUS_REVOCATION_WARNING 4
200 # define TS_STATUS_REVOCATION_NOTIFICATION 5
206 # define TS_INFO_BAD_ALG 0
207 # define TS_INFO_BAD_REQUEST 2
208 # define TS_INFO_BAD_DATA_FORMAT 5
209 # define TS_INFO_TIME_NOT_AVAILABLE 14
210 # define TS_INFO_UNACCEPTED_POLICY 15
211 # define TS_INFO_UNACCEPTED_EXTENSION 16
212 # define TS_INFO_ADD_INFO_NOT_AVAILABLE 17
213 # define TS_INFO_SYSTEM_FAILURE 25
278 void TS_REQ_free(
TS_REQ *a);
279 int i2d_TS_REQ(
const TS_REQ *a,
unsigned char **pp);
280 TS_REQ *d2i_TS_REQ(
TS_REQ **a,
const unsigned char **pp,
long length);
285 int i2d_TS_REQ_fp(FILE *fp,
TS_REQ *a);
291 int i2d_TS_MSG_IMPRINT(
const TS_MSG_IMPRINT *a,
unsigned char **pp);
293 const unsigned char **pp,
long length);
304 int i2d_TS_RESP(
const TS_RESP *a,
unsigned char **pp);
305 TS_RESP *d2i_TS_RESP(
TS_RESP **a,
const unsigned char **pp,
long length);
310 int i2d_TS_RESP_fp(FILE *fp,
TS_RESP *a);
316 int i2d_TS_STATUS_INFO(
const TS_STATUS_INFO *a,
unsigned char **pp);
318 const unsigned char **pp,
long length);
323 int i2d_TS_TST_INFO(
const TS_TST_INFO *a,
unsigned char **pp);
335 int i2d_TS_ACCURACY(
const TS_ACCURACY *a,
unsigned char **pp);
344 const unsigned char **pp,
350 int i2d_ESS_CERT_ID(
const ESS_CERT_ID *a,
unsigned char **pp);
359 const unsigned char **pp,
long length);
362 void ERR_load_TS_strings(
void);
364 int TS_REQ_set_version(
TS_REQ *a,
long version);
365 long TS_REQ_get_version(
const TS_REQ *a);
373 int TS_MSG_IMPRINT_set_msg(
TS_MSG_IMPRINT *a,
unsigned char *d,
int len);
382 int TS_REQ_set_cert_req(
TS_REQ *a,
int cert_req);
383 int TS_REQ_get_cert_req(
const TS_REQ *a);
386 void TS_REQ_ext_free(
TS_REQ *a);
387 int TS_REQ_get_ext_count(
TS_REQ *a);
388 int TS_REQ_get_ext_by_NID(
TS_REQ *a,
int nid,
int lastpos);
390 int TS_REQ_get_ext_by_critical(
TS_REQ *a,
int crit,
int lastpos);
394 void *TS_REQ_get_ext_d2i(
TS_REQ *a,
int nid,
int *crit,
int *idx);
398 int TS_REQ_print_bio(
BIO *bio,
TS_REQ *a);
410 int TS_TST_INFO_set_version(
TS_TST_INFO *a,
long version);
411 long TS_TST_INFO_get_version(
const TS_TST_INFO *a);
437 int TS_TST_INFO_set_ordering(
TS_TST_INFO *a,
int ordering);
438 int TS_TST_INFO_get_ordering(
const TS_TST_INFO *a);
449 int TS_TST_INFO_get_ext_by_NID(
TS_TST_INFO *a,
int nid,
int lastpos);
451 int TS_TST_INFO_get_ext_by_critical(
TS_TST_INFO *a,
int crit,
int lastpos);
455 void *TS_TST_INFO_get_ext_d2i(
TS_TST_INFO *a,
int nid,
int *crit,
int *idx);
464 # define TS_TSA_NAME 0x01
467 # define TS_ORDERING 0x02
474 # define TS_ESS_CERT_ID_CHAIN 0x04
487 typedef int (*TS_time_cb) (
struct TS_resp_ctx *,
void *,
long *sec,
501 STACK_OF(
X509) *certs;
508 unsigned clock_precision_digits;
512 TS_serial_cb serial_cb;
513 void *serial_cb_data;
516 TS_extension_cb extension_cb;
517 void *extension_cb_data;
525 DECLARE_ASN1_SET_OF(
EVP_MD)
557 int secs,
int millis,
int micros);
563 int TS_RESP_CTX_set_clock_precision_digits(
TS_RESP_CTX *ctx,
564 unsigned clock_precision_digits);
566 # define TS_MAX_CLOCK_PRECISION_DIGITS 6
569 # define TS_MAX_STATUS_LENGTH (1024 * 1024)
572 void TS_RESP_CTX_add_flags(
TS_RESP_CTX *ctx,
int flags);
575 void TS_RESP_CTX_set_serial_cb(
TS_RESP_CTX *ctx, TS_serial_cb cb,
void *data);
578 void TS_RESP_CTX_set_time_cb(
TS_RESP_CTX *ctx, TS_time_cb cb,
void *data);
585 void TS_RESP_CTX_set_extension_cb(
TS_RESP_CTX *ctx,
586 TS_extension_cb cb,
void *data);
590 int status,
const char *text);
593 int TS_RESP_CTX_set_status_info_cond(
TS_RESP_CTX *ctx,
594 int status,
const char *text);
596 int TS_RESP_CTX_add_failure_info(
TS_RESP_CTX *ctx,
int failure);
615 int TS_RESP_verify_signature(
PKCS7 *token, STACK_OF(
X509) *certs,
621 # define TS_VFY_SIGNATURE (1u << 0)
623 # define TS_VFY_VERSION (1u << 1)
625 # define TS_VFY_POLICY (1u << 2)
630 # define TS_VFY_IMPRINT (1u << 3)
636 # define TS_VFY_DATA (1u << 4)
638 # define TS_VFY_NONCE (1u << 5)
640 # define TS_VFY_SIGNER (1u << 6)
642 # define TS_VFY_TSA_NAME (1u << 7)
645 # define TS_VFY_ALL_IMPRINT (TS_VFY_SIGNATURE \
652 # define TS_VFY_ALL_DATA (TS_VFY_SIGNATURE \
665 STACK_OF(
X509) *certs;
673 unsigned char *imprint;
674 unsigned imprint_len;
725 int TS_ext_print_bio(
BIO *bio,
const STACK_OF(X509_EXTENSION) *extensions);
726 int TS_X509_ALGOR_print_bio(
BIO *bio,
const X509_ALGOR *alg);
734 X509 *TS_CONF_load_cert(
const char *
file);
735 STACK_OF(
X509) *TS_CONF_load_certs(
const char *
file);
736 EVP_PKEY *TS_CONF_load_key(
const char *
file,
const char *pass);
737 const char *TS_CONF_get_tsa_section(
CONF *conf,
const char *section);
738 int TS_CONF_set_serial(
CONF *conf,
const char *section, TS_serial_cb cb,
740 int TS_CONF_set_crypto_device(
CONF *conf,
const char *section,
742 int TS_CONF_set_default_engine(
const char *name);
743 int TS_CONF_set_signer_cert(
CONF *conf,
const char *section,
745 int TS_CONF_set_certs(
CONF *conf,
const char *section,
const char *certs,
747 int TS_CONF_set_signer_key(
CONF *conf,
const char *section,
748 const char *key,
const char *pass,
750 int TS_CONF_set_def_policy(
CONF *conf,
const char *section,
752 int TS_CONF_set_policies(
CONF *conf,
const char *section,
TS_RESP_CTX *ctx);
753 int TS_CONF_set_digests(
CONF *conf,
const char *section,
TS_RESP_CTX *ctx);
754 int TS_CONF_set_accuracy(
CONF *conf,
const char *section,
TS_RESP_CTX *ctx);
755 int TS_CONF_set_clock_precision_digits(
CONF *conf,
const char *section,
757 int TS_CONF_set_ordering(
CONF *conf,
const char *section,
TS_RESP_CTX *ctx);
758 int TS_CONF_set_tsa_name(
CONF *conf,
const char *section,
TS_RESP_CTX *ctx);
759 int TS_CONF_set_ess_cert_id_chain(
CONF *conf,
const char *section,
768 void ERR_load_TS_strings(
void);
773 # define TS_F_D2I_TS_RESP 147
774 # define TS_F_DEF_SERIAL_CB 110
775 # define TS_F_DEF_TIME_CB 111
776 # define TS_F_ESS_ADD_SIGNING_CERT 112
777 # define TS_F_ESS_CERT_ID_NEW_INIT 113
778 # define TS_F_ESS_SIGNING_CERT_NEW_INIT 114
779 # define TS_F_INT_TS_RESP_VERIFY_TOKEN 149
780 # define TS_F_PKCS7_TO_TS_TST_INFO 148
781 # define TS_F_TS_ACCURACY_SET_MICROS 115
782 # define TS_F_TS_ACCURACY_SET_MILLIS 116
783 # define TS_F_TS_ACCURACY_SET_SECONDS 117
784 # define TS_F_TS_CHECK_IMPRINTS 100
785 # define TS_F_TS_CHECK_NONCES 101
786 # define TS_F_TS_CHECK_POLICY 102
787 # define TS_F_TS_CHECK_SIGNING_CERTS 103
788 # define TS_F_TS_CHECK_STATUS_INFO 104
789 # define TS_F_TS_COMPUTE_IMPRINT 145
790 # define TS_F_TS_CONF_SET_DEFAULT_ENGINE 146
791 # define TS_F_TS_GET_STATUS_TEXT 105
792 # define TS_F_TS_MSG_IMPRINT_SET_ALGO 118
793 # define TS_F_TS_REQ_SET_MSG_IMPRINT 119
794 # define TS_F_TS_REQ_SET_NONCE 120
795 # define TS_F_TS_REQ_SET_POLICY_ID 121
796 # define TS_F_TS_RESP_CREATE_RESPONSE 122
797 # define TS_F_TS_RESP_CREATE_TST_INFO 123
798 # define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO 124
799 # define TS_F_TS_RESP_CTX_ADD_MD 125
800 # define TS_F_TS_RESP_CTX_ADD_POLICY 126
801 # define TS_F_TS_RESP_CTX_NEW 127
802 # define TS_F_TS_RESP_CTX_SET_ACCURACY 128
803 # define TS_F_TS_RESP_CTX_SET_CERTS 129
804 # define TS_F_TS_RESP_CTX_SET_DEF_POLICY 130
805 # define TS_F_TS_RESP_CTX_SET_SIGNER_CERT 131
806 # define TS_F_TS_RESP_CTX_SET_STATUS_INFO 132
807 # define TS_F_TS_RESP_GET_POLICY 133
808 # define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION 134
809 # define TS_F_TS_RESP_SET_STATUS_INFO 135
810 # define TS_F_TS_RESP_SET_TST_INFO 150
811 # define TS_F_TS_RESP_SIGN 136
812 # define TS_F_TS_RESP_VERIFY_SIGNATURE 106
813 # define TS_F_TS_RESP_VERIFY_TOKEN 107
814 # define TS_F_TS_TST_INFO_SET_ACCURACY 137
815 # define TS_F_TS_TST_INFO_SET_MSG_IMPRINT 138
816 # define TS_F_TS_TST_INFO_SET_NONCE 139
817 # define TS_F_TS_TST_INFO_SET_POLICY_ID 140
818 # define TS_F_TS_TST_INFO_SET_SERIAL 141
819 # define TS_F_TS_TST_INFO_SET_TIME 142
820 # define TS_F_TS_TST_INFO_SET_TSA 143
821 # define TS_F_TS_VERIFY 108
822 # define TS_F_TS_VERIFY_CERT 109
823 # define TS_F_TS_VERIFY_CTX_NEW 144
826 # define TS_R_BAD_PKCS7_TYPE 132
827 # define TS_R_BAD_TYPE 133
828 # define TS_R_CERTIFICATE_VERIFY_ERROR 100
829 # define TS_R_COULD_NOT_SET_ENGINE 127
830 # define TS_R_COULD_NOT_SET_TIME 115
831 # define TS_R_D2I_TS_RESP_INT_FAILED 128
832 # define TS_R_DETACHED_CONTENT 134
833 # define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116
834 # define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101
835 # define TS_R_INVALID_NULL_POINTER 102
836 # define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117
837 # define TS_R_MESSAGE_IMPRINT_MISMATCH 103
838 # define TS_R_NONCE_MISMATCH 104
839 # define TS_R_NONCE_NOT_RETURNED 105
840 # define TS_R_NO_CONTENT 106
841 # define TS_R_NO_TIME_STAMP_TOKEN 107
842 # define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118
843 # define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119
844 # define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129
845 # define TS_R_POLICY_MISMATCH 108
846 # define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120
847 # define TS_R_RESPONSE_SETUP_ERROR 121
848 # define TS_R_SIGNATURE_FAILURE 109
849 # define TS_R_THERE_MUST_BE_ONE_SIGNER 110
850 # define TS_R_TIME_SYSCALL_ERROR 122
851 # define TS_R_TOKEN_NOT_PRESENT 130
852 # define TS_R_TOKEN_PRESENT 131
853 # define TS_R_TSA_NAME_MISMATCH 111
854 # define TS_R_TSA_UNTRUSTED 112
855 # define TS_R_TST_INFO_SETUP_ERROR 123
856 # define TS_R_TS_DATASIGN 124
857 # define TS_R_UNACCEPTABLE_POLICY 125
858 # define TS_R_UNSUPPORTED_MD_ALGORITHM 126
859 # define TS_R_UNSUPPORTED_VERSION 113
860 # define TS_R_WRONG_CONTENT_TYPE 114
Definition: x509_vfy.h:186
Definition: gzappend.c:170