Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/openssl
File: ts.h
/*
[0] Fix | Delete
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
[1] Fix | Delete
*
[2] Fix | Delete
* Licensed under the OpenSSL license (the "License"). You may not use
[3] Fix | Delete
* this file except in compliance with the License. You can obtain a copy
[4] Fix | Delete
* in the file LICENSE in the source distribution or at
[5] Fix | Delete
* https://www.openssl.org/source/license.html
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
#ifndef HEADER_TS_H
[9] Fix | Delete
# define HEADER_TS_H
[10] Fix | Delete
[11] Fix | Delete
# include <openssl/opensslconf.h>
[12] Fix | Delete
[13] Fix | Delete
# ifndef OPENSSL_NO_TS
[14] Fix | Delete
# include <openssl/symhacks.h>
[15] Fix | Delete
# include <openssl/buffer.h>
[16] Fix | Delete
# include <openssl/evp.h>
[17] Fix | Delete
# include <openssl/bio.h>
[18] Fix | Delete
# include <openssl/asn1.h>
[19] Fix | Delete
# include <openssl/safestack.h>
[20] Fix | Delete
# include <openssl/rsa.h>
[21] Fix | Delete
# include <openssl/dsa.h>
[22] Fix | Delete
# include <openssl/dh.h>
[23] Fix | Delete
# include <openssl/tserr.h>
[24] Fix | Delete
# ifdef __cplusplus
[25] Fix | Delete
extern "C" {
[26] Fix | Delete
# endif
[27] Fix | Delete
[28] Fix | Delete
# include <openssl/x509.h>
[29] Fix | Delete
# include <openssl/x509v3.h>
[30] Fix | Delete
[31] Fix | Delete
typedef struct TS_msg_imprint_st TS_MSG_IMPRINT;
[32] Fix | Delete
typedef struct TS_req_st TS_REQ;
[33] Fix | Delete
typedef struct TS_accuracy_st TS_ACCURACY;
[34] Fix | Delete
typedef struct TS_tst_info_st TS_TST_INFO;
[35] Fix | Delete
[36] Fix | Delete
/* Possible values for status. */
[37] Fix | Delete
# define TS_STATUS_GRANTED 0
[38] Fix | Delete
# define TS_STATUS_GRANTED_WITH_MODS 1
[39] Fix | Delete
# define TS_STATUS_REJECTION 2
[40] Fix | Delete
# define TS_STATUS_WAITING 3
[41] Fix | Delete
# define TS_STATUS_REVOCATION_WARNING 4
[42] Fix | Delete
# define TS_STATUS_REVOCATION_NOTIFICATION 5
[43] Fix | Delete
[44] Fix | Delete
/* Possible values for failure_info. */
[45] Fix | Delete
# define TS_INFO_BAD_ALG 0
[46] Fix | Delete
# define TS_INFO_BAD_REQUEST 2
[47] Fix | Delete
# define TS_INFO_BAD_DATA_FORMAT 5
[48] Fix | Delete
# define TS_INFO_TIME_NOT_AVAILABLE 14
[49] Fix | Delete
# define TS_INFO_UNACCEPTED_POLICY 15
[50] Fix | Delete
# define TS_INFO_UNACCEPTED_EXTENSION 16
[51] Fix | Delete
# define TS_INFO_ADD_INFO_NOT_AVAILABLE 17
[52] Fix | Delete
# define TS_INFO_SYSTEM_FAILURE 25
[53] Fix | Delete
[54] Fix | Delete
[55] Fix | Delete
typedef struct TS_status_info_st TS_STATUS_INFO;
[56] Fix | Delete
typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL;
[57] Fix | Delete
typedef struct ESS_cert_id ESS_CERT_ID;
[58] Fix | Delete
typedef struct ESS_signing_cert ESS_SIGNING_CERT;
[59] Fix | Delete
[60] Fix | Delete
DEFINE_STACK_OF(ESS_CERT_ID)
[61] Fix | Delete
[62] Fix | Delete
typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2;
[63] Fix | Delete
typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2;
[64] Fix | Delete
[65] Fix | Delete
DEFINE_STACK_OF(ESS_CERT_ID_V2)
[66] Fix | Delete
[67] Fix | Delete
typedef struct TS_resp_st TS_RESP;
[68] Fix | Delete
[69] Fix | Delete
TS_REQ *TS_REQ_new(void);
[70] Fix | Delete
void TS_REQ_free(TS_REQ *a);
[71] Fix | Delete
int i2d_TS_REQ(const TS_REQ *a, unsigned char **pp);
[72] Fix | Delete
TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length);
[73] Fix | Delete
[74] Fix | Delete
TS_REQ *TS_REQ_dup(TS_REQ *a);
[75] Fix | Delete
[76] Fix | Delete
#ifndef OPENSSL_NO_STDIO
[77] Fix | Delete
TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a);
[78] Fix | Delete
int i2d_TS_REQ_fp(FILE *fp, TS_REQ *a);
[79] Fix | Delete
#endif
[80] Fix | Delete
TS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a);
[81] Fix | Delete
int i2d_TS_REQ_bio(BIO *fp, TS_REQ *a);
[82] Fix | Delete
[83] Fix | Delete
TS_MSG_IMPRINT *TS_MSG_IMPRINT_new(void);
[84] Fix | Delete
void TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a);
[85] Fix | Delete
int i2d_TS_MSG_IMPRINT(const TS_MSG_IMPRINT *a, unsigned char **pp);
[86] Fix | Delete
TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a,
[87] Fix | Delete
const unsigned char **pp, long length);
[88] Fix | Delete
[89] Fix | Delete
TS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a);
[90] Fix | Delete
[91] Fix | Delete
#ifndef OPENSSL_NO_STDIO
[92] Fix | Delete
TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a);
[93] Fix | Delete
int i2d_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT *a);
[94] Fix | Delete
#endif
[95] Fix | Delete
TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *bio, TS_MSG_IMPRINT **a);
[96] Fix | Delete
int i2d_TS_MSG_IMPRINT_bio(BIO *bio, TS_MSG_IMPRINT *a);
[97] Fix | Delete
[98] Fix | Delete
TS_RESP *TS_RESP_new(void);
[99] Fix | Delete
void TS_RESP_free(TS_RESP *a);
[100] Fix | Delete
int i2d_TS_RESP(const TS_RESP *a, unsigned char **pp);
[101] Fix | Delete
TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length);
[102] Fix | Delete
TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token);
[103] Fix | Delete
TS_RESP *TS_RESP_dup(TS_RESP *a);
[104] Fix | Delete
[105] Fix | Delete
#ifndef OPENSSL_NO_STDIO
[106] Fix | Delete
TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a);
[107] Fix | Delete
int i2d_TS_RESP_fp(FILE *fp, TS_RESP *a);
[108] Fix | Delete
#endif
[109] Fix | Delete
TS_RESP *d2i_TS_RESP_bio(BIO *bio, TS_RESP **a);
[110] Fix | Delete
int i2d_TS_RESP_bio(BIO *bio, TS_RESP *a);
[111] Fix | Delete
[112] Fix | Delete
TS_STATUS_INFO *TS_STATUS_INFO_new(void);
[113] Fix | Delete
void TS_STATUS_INFO_free(TS_STATUS_INFO *a);
[114] Fix | Delete
int i2d_TS_STATUS_INFO(const TS_STATUS_INFO *a, unsigned char **pp);
[115] Fix | Delete
TS_STATUS_INFO *d2i_TS_STATUS_INFO(TS_STATUS_INFO **a,
[116] Fix | Delete
const unsigned char **pp, long length);
[117] Fix | Delete
TS_STATUS_INFO *TS_STATUS_INFO_dup(TS_STATUS_INFO *a);
[118] Fix | Delete
[119] Fix | Delete
TS_TST_INFO *TS_TST_INFO_new(void);
[120] Fix | Delete
void TS_TST_INFO_free(TS_TST_INFO *a);
[121] Fix | Delete
int i2d_TS_TST_INFO(const TS_TST_INFO *a, unsigned char **pp);
[122] Fix | Delete
TS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp,
[123] Fix | Delete
long length);
[124] Fix | Delete
TS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a);
[125] Fix | Delete
[126] Fix | Delete
#ifndef OPENSSL_NO_STDIO
[127] Fix | Delete
TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a);
[128] Fix | Delete
int i2d_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO *a);
[129] Fix | Delete
#endif
[130] Fix | Delete
TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *bio, TS_TST_INFO **a);
[131] Fix | Delete
int i2d_TS_TST_INFO_bio(BIO *bio, TS_TST_INFO *a);
[132] Fix | Delete
[133] Fix | Delete
TS_ACCURACY *TS_ACCURACY_new(void);
[134] Fix | Delete
void TS_ACCURACY_free(TS_ACCURACY *a);
[135] Fix | Delete
int i2d_TS_ACCURACY(const TS_ACCURACY *a, unsigned char **pp);
[136] Fix | Delete
TS_ACCURACY *d2i_TS_ACCURACY(TS_ACCURACY **a, const unsigned char **pp,
[137] Fix | Delete
long length);
[138] Fix | Delete
TS_ACCURACY *TS_ACCURACY_dup(TS_ACCURACY *a);
[139] Fix | Delete
[140] Fix | Delete
ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void);
[141] Fix | Delete
void ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a);
[142] Fix | Delete
int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, unsigned char **pp);
[143] Fix | Delete
ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a,
[144] Fix | Delete
const unsigned char **pp,
[145] Fix | Delete
long length);
[146] Fix | Delete
ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a);
[147] Fix | Delete
[148] Fix | Delete
ESS_CERT_ID *ESS_CERT_ID_new(void);
[149] Fix | Delete
void ESS_CERT_ID_free(ESS_CERT_ID *a);
[150] Fix | Delete
int i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp);
[151] Fix | Delete
ESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp,
[152] Fix | Delete
long length);
[153] Fix | Delete
ESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a);
[154] Fix | Delete
[155] Fix | Delete
ESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void);
[156] Fix | Delete
void ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a);
[157] Fix | Delete
int i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a, unsigned char **pp);
[158] Fix | Delete
ESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a,
[159] Fix | Delete
const unsigned char **pp, long length);
[160] Fix | Delete
ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a);
[161] Fix | Delete
[162] Fix | Delete
ESS_CERT_ID_V2 *ESS_CERT_ID_V2_new(void);
[163] Fix | Delete
void ESS_CERT_ID_V2_free(ESS_CERT_ID_V2 *a);
[164] Fix | Delete
int i2d_ESS_CERT_ID_V2(const ESS_CERT_ID_V2 *a, unsigned char **pp);
[165] Fix | Delete
ESS_CERT_ID_V2 *d2i_ESS_CERT_ID_V2(ESS_CERT_ID_V2 **a,
[166] Fix | Delete
const unsigned char **pp, long length);
[167] Fix | Delete
ESS_CERT_ID_V2 *ESS_CERT_ID_V2_dup(ESS_CERT_ID_V2 *a);
[168] Fix | Delete
[169] Fix | Delete
ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_new(void);
[170] Fix | Delete
void ESS_SIGNING_CERT_V2_free(ESS_SIGNING_CERT_V2 *a);
[171] Fix | Delete
int i2d_ESS_SIGNING_CERT_V2(const ESS_SIGNING_CERT_V2 *a, unsigned char **pp);
[172] Fix | Delete
ESS_SIGNING_CERT_V2 *d2i_ESS_SIGNING_CERT_V2(ESS_SIGNING_CERT_V2 **a,
[173] Fix | Delete
const unsigned char **pp,
[174] Fix | Delete
long length);
[175] Fix | Delete
ESS_SIGNING_CERT_V2 *ESS_SIGNING_CERT_V2_dup(ESS_SIGNING_CERT_V2 *a);
[176] Fix | Delete
[177] Fix | Delete
int TS_REQ_set_version(TS_REQ *a, long version);
[178] Fix | Delete
long TS_REQ_get_version(const TS_REQ *a);
[179] Fix | Delete
[180] Fix | Delete
int TS_STATUS_INFO_set_status(TS_STATUS_INFO *a, int i);
[181] Fix | Delete
const ASN1_INTEGER *TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *a);
[182] Fix | Delete
[183] Fix | Delete
const STACK_OF(ASN1_UTF8STRING) *
[184] Fix | Delete
TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a);
[185] Fix | Delete
[186] Fix | Delete
const ASN1_BIT_STRING *
[187] Fix | Delete
TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a);
[188] Fix | Delete
[189] Fix | Delete
int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint);
[190] Fix | Delete
TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a);
[191] Fix | Delete
[192] Fix | Delete
int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg);
[193] Fix | Delete
X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a);
[194] Fix | Delete
[195] Fix | Delete
int TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len);
[196] Fix | Delete
ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a);
[197] Fix | Delete
[198] Fix | Delete
int TS_REQ_set_policy_id(TS_REQ *a, const ASN1_OBJECT *policy);
[199] Fix | Delete
ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a);
[200] Fix | Delete
[201] Fix | Delete
int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce);
[202] Fix | Delete
const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a);
[203] Fix | Delete
[204] Fix | Delete
int TS_REQ_set_cert_req(TS_REQ *a, int cert_req);
[205] Fix | Delete
int TS_REQ_get_cert_req(const TS_REQ *a);
[206] Fix | Delete
[207] Fix | Delete
STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a);
[208] Fix | Delete
void TS_REQ_ext_free(TS_REQ *a);
[209] Fix | Delete
int TS_REQ_get_ext_count(TS_REQ *a);
[210] Fix | Delete
int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos);
[211] Fix | Delete
int TS_REQ_get_ext_by_OBJ(TS_REQ *a, const ASN1_OBJECT *obj, int lastpos);
[212] Fix | Delete
int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos);
[213] Fix | Delete
X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc);
[214] Fix | Delete
X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc);
[215] Fix | Delete
int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc);
[216] Fix | Delete
void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);
[217] Fix | Delete
[218] Fix | Delete
/* Function declarations for TS_REQ defined in ts/ts_req_print.c */
[219] Fix | Delete
[220] Fix | Delete
int TS_REQ_print_bio(BIO *bio, TS_REQ *a);
[221] Fix | Delete
[222] Fix | Delete
/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */
[223] Fix | Delete
[224] Fix | Delete
int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info);
[225] Fix | Delete
TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a);
[226] Fix | Delete
[227] Fix | Delete
/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
[228] Fix | Delete
void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info);
[229] Fix | Delete
PKCS7 *TS_RESP_get_token(TS_RESP *a);
[230] Fix | Delete
TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a);
[231] Fix | Delete
[232] Fix | Delete
int TS_TST_INFO_set_version(TS_TST_INFO *a, long version);
[233] Fix | Delete
long TS_TST_INFO_get_version(const TS_TST_INFO *a);
[234] Fix | Delete
[235] Fix | Delete
int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id);
[236] Fix | Delete
ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a);
[237] Fix | Delete
[238] Fix | Delete
int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint);
[239] Fix | Delete
TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a);
[240] Fix | Delete
[241] Fix | Delete
int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial);
[242] Fix | Delete
const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a);
[243] Fix | Delete
[244] Fix | Delete
int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime);
[245] Fix | Delete
const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a);
[246] Fix | Delete
[247] Fix | Delete
int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy);
[248] Fix | Delete
TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a);
[249] Fix | Delete
[250] Fix | Delete
int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds);
[251] Fix | Delete
const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a);
[252] Fix | Delete
[253] Fix | Delete
int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis);
[254] Fix | Delete
const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a);
[255] Fix | Delete
[256] Fix | Delete
int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros);
[257] Fix | Delete
const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a);
[258] Fix | Delete
[259] Fix | Delete
int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering);
[260] Fix | Delete
int TS_TST_INFO_get_ordering(const TS_TST_INFO *a);
[261] Fix | Delete
[262] Fix | Delete
int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce);
[263] Fix | Delete
const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a);
[264] Fix | Delete
[265] Fix | Delete
int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);
[266] Fix | Delete
GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);
[267] Fix | Delete
[268] Fix | Delete
STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a);
[269] Fix | Delete
void TS_TST_INFO_ext_free(TS_TST_INFO *a);
[270] Fix | Delete
int TS_TST_INFO_get_ext_count(TS_TST_INFO *a);
[271] Fix | Delete
int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos);
[272] Fix | Delete
int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, const ASN1_OBJECT *obj,
[273] Fix | Delete
int lastpos);
[274] Fix | Delete
int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos);
[275] Fix | Delete
X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc);
[276] Fix | Delete
X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc);
[277] Fix | Delete
int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc);
[278] Fix | Delete
void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx);
[279] Fix | Delete
[280] Fix | Delete
/*
[281] Fix | Delete
* Declarations related to response generation, defined in ts/ts_resp_sign.c.
[282] Fix | Delete
*/
[283] Fix | Delete
[284] Fix | Delete
/* Optional flags for response generation. */
[285] Fix | Delete
[286] Fix | Delete
/* Don't include the TSA name in response. */
[287] Fix | Delete
# define TS_TSA_NAME 0x01
[288] Fix | Delete
[289] Fix | Delete
/* Set ordering to true in response. */
[290] Fix | Delete
# define TS_ORDERING 0x02
[291] Fix | Delete
[292] Fix | Delete
/*
[293] Fix | Delete
* Include the signer certificate and the other specified certificates in
[294] Fix | Delete
* the ESS signing certificate attribute beside the PKCS7 signed data.
[295] Fix | Delete
* Only the signer certificates is included by default.
[296] Fix | Delete
*/
[297] Fix | Delete
# define TS_ESS_CERT_ID_CHAIN 0x04
[298] Fix | Delete
[299] Fix | Delete
/* Forward declaration. */
[300] Fix | Delete
struct TS_resp_ctx;
[301] Fix | Delete
[302] Fix | Delete
/* This must return a unique number less than 160 bits long. */
[303] Fix | Delete
typedef ASN1_INTEGER *(*TS_serial_cb) (struct TS_resp_ctx *, void *);
[304] Fix | Delete
[305] Fix | Delete
/*
[306] Fix | Delete
* This must return the seconds and microseconds since Jan 1, 1970 in the sec
[307] Fix | Delete
* and usec variables allocated by the caller. Return non-zero for success
[308] Fix | Delete
* and zero for failure.
[309] Fix | Delete
*/
[310] Fix | Delete
typedef int (*TS_time_cb) (struct TS_resp_ctx *, void *, long *sec,
[311] Fix | Delete
long *usec);
[312] Fix | Delete
[313] Fix | Delete
/*
[314] Fix | Delete
* This must process the given extension. It can modify the TS_TST_INFO
[315] Fix | Delete
* object of the context. Return values: !0 (processed), 0 (error, it must
[316] Fix | Delete
* set the status info/failure info of the response).
[317] Fix | Delete
*/
[318] Fix | Delete
typedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *,
[319] Fix | Delete
void *);
[320] Fix | Delete
[321] Fix | Delete
typedef struct TS_resp_ctx TS_RESP_CTX;
[322] Fix | Delete
[323] Fix | Delete
DEFINE_STACK_OF_CONST(EVP_MD)
[324] Fix | Delete
[325] Fix | Delete
/* Creates a response context that can be used for generating responses. */
[326] Fix | Delete
TS_RESP_CTX *TS_RESP_CTX_new(void);
[327] Fix | Delete
void TS_RESP_CTX_free(TS_RESP_CTX *ctx);
[328] Fix | Delete
[329] Fix | Delete
/* This parameter must be set. */
[330] Fix | Delete
int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer);
[331] Fix | Delete
[332] Fix | Delete
/* This parameter must be set. */
[333] Fix | Delete
int TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key);
[334] Fix | Delete
[335] Fix | Delete
int TS_RESP_CTX_set_signer_digest(TS_RESP_CTX *ctx,
[336] Fix | Delete
const EVP_MD *signer_digest);
[337] Fix | Delete
int TS_RESP_CTX_set_ess_cert_id_digest(TS_RESP_CTX *ctx, const EVP_MD *md);
[338] Fix | Delete
[339] Fix | Delete
/* This parameter must be set. */
[340] Fix | Delete
int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *def_policy);
[341] Fix | Delete
[342] Fix | Delete
/* No additional certs are included in the response by default. */
[343] Fix | Delete
int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs);
[344] Fix | Delete
[345] Fix | Delete
/*
[346] Fix | Delete
* Adds a new acceptable policy, only the default policy is accepted by
[347] Fix | Delete
* default.
[348] Fix | Delete
*/
[349] Fix | Delete
int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *policy);
[350] Fix | Delete
[351] Fix | Delete
/*
[352] Fix | Delete
* Adds a new acceptable message digest. Note that no message digests are
[353] Fix | Delete
* accepted by default. The md argument is shared with the caller.
[354] Fix | Delete
*/
[355] Fix | Delete
int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md);
[356] Fix | Delete
[357] Fix | Delete
/* Accuracy is not included by default. */
[358] Fix | Delete
int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx,
[359] Fix | Delete
int secs, int millis, int micros);
[360] Fix | Delete
[361] Fix | Delete
/*
[362] Fix | Delete
* Clock precision digits, i.e. the number of decimal digits: '0' means sec,
[363] Fix | Delete
* '3' msec, '6' usec, and so on. Default is 0.
[364] Fix | Delete
*/
[365] Fix | Delete
int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx,
[366] Fix | Delete
unsigned clock_precision_digits);
[367] Fix | Delete
/* At most we accept usec precision. */
[368] Fix | Delete
# define TS_MAX_CLOCK_PRECISION_DIGITS 6
[369] Fix | Delete
[370] Fix | Delete
/* Maximum status message length */
[371] Fix | Delete
# define TS_MAX_STATUS_LENGTH (1024 * 1024)
[372] Fix | Delete
[373] Fix | Delete
/* No flags are set by default. */
[374] Fix | Delete
void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags);
[375] Fix | Delete
[376] Fix | Delete
/* Default callback always returns a constant. */
[377] Fix | Delete
void TS_RESP_CTX_set_serial_cb(TS_RESP_CTX *ctx, TS_serial_cb cb, void *data);
[378] Fix | Delete
[379] Fix | Delete
/* Default callback uses the gettimeofday() and gmtime() system calls. */
[380] Fix | Delete
void TS_RESP_CTX_set_time_cb(TS_RESP_CTX *ctx, TS_time_cb cb, void *data);
[381] Fix | Delete
[382] Fix | Delete
/*
[383] Fix | Delete
* Default callback rejects all extensions. The extension callback is called
[384] Fix | Delete
* when the TS_TST_INFO object is already set up and not signed yet.
[385] Fix | Delete
*/
[386] Fix | Delete
/* FIXME: extension handling is not tested yet. */
[387] Fix | Delete
void TS_RESP_CTX_set_extension_cb(TS_RESP_CTX *ctx,
[388] Fix | Delete
TS_extension_cb cb, void *data);
[389] Fix | Delete
[390] Fix | Delete
/* The following methods can be used in the callbacks. */
[391] Fix | Delete
int TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx,
[392] Fix | Delete
int status, const char *text);
[393] Fix | Delete
[394] Fix | Delete
/* Sets the status info only if it is still TS_STATUS_GRANTED. */
[395] Fix | Delete
int TS_RESP_CTX_set_status_info_cond(TS_RESP_CTX *ctx,
[396] Fix | Delete
int status, const char *text);
[397] Fix | Delete
[398] Fix | Delete
int TS_RESP_CTX_add_failure_info(TS_RESP_CTX *ctx, int failure);
[399] Fix | Delete
[400] Fix | Delete
/* The get methods below can be used in the extension callback. */
[401] Fix | Delete
TS_REQ *TS_RESP_CTX_get_request(TS_RESP_CTX *ctx);
[402] Fix | Delete
[403] Fix | Delete
TS_TST_INFO *TS_RESP_CTX_get_tst_info(TS_RESP_CTX *ctx);
[404] Fix | Delete
[405] Fix | Delete
/*
[406] Fix | Delete
* Creates the signed TS_TST_INFO and puts it in TS_RESP.
[407] Fix | Delete
* In case of errors it sets the status info properly.
[408] Fix | Delete
* Returns NULL only in case of memory allocation/fatal error.
[409] Fix | Delete
*/
[410] Fix | Delete
TS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio);
[411] Fix | Delete
[412] Fix | Delete
/*
[413] Fix | Delete
* Declarations related to response verification,
[414] Fix | Delete
* they are defined in ts/ts_resp_verify.c.
[415] Fix | Delete
*/
[416] Fix | Delete
[417] Fix | Delete
int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,
[418] Fix | Delete
X509_STORE *store, X509 **signer_out);
[419] Fix | Delete
[420] Fix | Delete
/* Context structure for the generic verify method. */
[421] Fix | Delete
[422] Fix | Delete
/* Verify the signer's certificate and the signature of the response. */
[423] Fix | Delete
# define TS_VFY_SIGNATURE (1u << 0)
[424] Fix | Delete
/* Verify the version number of the response. */
[425] Fix | Delete
# define TS_VFY_VERSION (1u << 1)
[426] Fix | Delete
/* Verify if the policy supplied by the user matches the policy of the TSA. */
[427] Fix | Delete
# define TS_VFY_POLICY (1u << 2)
[428] Fix | Delete
/*
[429] Fix | Delete
* Verify the message imprint provided by the user. This flag should not be
[430] Fix | Delete
* specified with TS_VFY_DATA.
[431] Fix | Delete
*/
[432] Fix | Delete
# define TS_VFY_IMPRINT (1u << 3)
[433] Fix | Delete
/*
[434] Fix | Delete
* Verify the message imprint computed by the verify method from the user
[435] Fix | Delete
* provided data and the MD algorithm of the response. This flag should not
[436] Fix | Delete
* be specified with TS_VFY_IMPRINT.
[437] Fix | Delete
*/
[438] Fix | Delete
# define TS_VFY_DATA (1u << 4)
[439] Fix | Delete
/* Verify the nonce value. */
[440] Fix | Delete
# define TS_VFY_NONCE (1u << 5)
[441] Fix | Delete
/* Verify if the TSA name field matches the signer certificate. */
[442] Fix | Delete
# define TS_VFY_SIGNER (1u << 6)
[443] Fix | Delete
/* Verify if the TSA name field equals to the user provided name. */
[444] Fix | Delete
# define TS_VFY_TSA_NAME (1u << 7)
[445] Fix | Delete
[446] Fix | Delete
/* You can use the following convenience constants. */
[447] Fix | Delete
# define TS_VFY_ALL_IMPRINT (TS_VFY_SIGNATURE \
[448] Fix | Delete
| TS_VFY_VERSION \
[449] Fix | Delete
| TS_VFY_POLICY \
[450] Fix | Delete
| TS_VFY_IMPRINT \
[451] Fix | Delete
| TS_VFY_NONCE \
[452] Fix | Delete
| TS_VFY_SIGNER \
[453] Fix | Delete
| TS_VFY_TSA_NAME)
[454] Fix | Delete
# define TS_VFY_ALL_DATA (TS_VFY_SIGNATURE \
[455] Fix | Delete
| TS_VFY_VERSION \
[456] Fix | Delete
| TS_VFY_POLICY \
[457] Fix | Delete
| TS_VFY_DATA \
[458] Fix | Delete
| TS_VFY_NONCE \
[459] Fix | Delete
| TS_VFY_SIGNER \
[460] Fix | Delete
| TS_VFY_TSA_NAME)
[461] Fix | Delete
[462] Fix | Delete
typedef struct TS_verify_ctx TS_VERIFY_CTX;
[463] Fix | Delete
[464] Fix | Delete
int TS_RESP_verify_response(TS_VERIFY_CTX *ctx, TS_RESP *response);
[465] Fix | Delete
int TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token);
[466] Fix | Delete
[467] Fix | Delete
/*
[468] Fix | Delete
* Declarations related to response verification context,
[469] Fix | Delete
*/
[470] Fix | Delete
TS_VERIFY_CTX *TS_VERIFY_CTX_new(void);
[471] Fix | Delete
void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx);
[472] Fix | Delete
void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx);
[473] Fix | Delete
void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx);
[474] Fix | Delete
int TS_VERIFY_CTX_set_flags(TS_VERIFY_CTX *ctx, int f);
[475] Fix | Delete
int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f);
[476] Fix | Delete
BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *b);
[477] Fix | Delete
unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,
[478] Fix | Delete
unsigned char *hexstr, long len);
[479] Fix | Delete
X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s);
[480] Fix | Delete
STACK_OF(X509) *TS_VERIFY_CTS_set_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs);
[481] Fix | Delete
[482] Fix | Delete
/*-
[483] Fix | Delete
* If ctx is NULL, it allocates and returns a new object, otherwise
[484] Fix | Delete
* it returns ctx. It initialises all the members as follows:
[485] Fix | Delete
* flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE)
[486] Fix | Delete
* certs = NULL
[487] Fix | Delete
* store = NULL
[488] Fix | Delete
* policy = policy from the request or NULL if absent (in this case
[489] Fix | Delete
* TS_VFY_POLICY is cleared from flags as well)
[490] Fix | Delete
* md_alg = MD algorithm from request
[491] Fix | Delete
* imprint, imprint_len = imprint from request
[492] Fix | Delete
* data = NULL
[493] Fix | Delete
* nonce, nonce_len = nonce from the request or NULL if absent (in this case
[494] Fix | Delete
* TS_VFY_NONCE is cleared from flags as well)
[495] Fix | Delete
* tsa_name = NULL
[496] Fix | Delete
* Important: after calling this method TS_VFY_SIGNATURE should be added!
[497] Fix | Delete
*/
[498] Fix | Delete
TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx);
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function