=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/ts.c,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** src/usr.bin/openssl/ts.c 2022/03/24 11:27:45 1.18 --- src/usr.bin/openssl/ts.c 2022/03/24 11:40:07 1.19 *************** *** 1,4 **** ! /* $OpenBSD: ts.c,v 1.18 2022/03/24 11:27:45 inoguchi Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ --- 1,4 ---- ! /* $OpenBSD: ts.c,v 1.19 2022/03/24 11:40:07 inoguchi Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ *************** *** 81,109 **** /* Query related functions. */ static int query_command(const char *data, char *digest, ! const EVP_MD * md, const char *policy, int no_nonce, int cert, const char *in, const char *out, int text); static BIO *BIO_open_with_default(const char *file, const char *mode, ! FILE * default_fp); ! static TS_REQ *create_query(BIO * data_bio, char *digest, const EVP_MD * md, const char *policy, int no_nonce, int cert); ! static int create_digest(BIO * input, char *digest, ! const EVP_MD * md, unsigned char **md_value); static ASN1_INTEGER *create_nonce(int bits); /* Reply related functions. */ ! static int reply_command(CONF * conf, char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy, char *in, int token_in, char *out, int token_out, int text); ! static TS_RESP *read_PKCS7(BIO * in_bio); ! static TS_RESP *create_response(CONF * conf, const char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy); ! static ASN1_INTEGER *serial_cb(TS_RESP_CTX * ctx, void *data); static ASN1_INTEGER *next_serial(const char *serialfile); ! static int save_ts_serial(const char *serialfile, ASN1_INTEGER * serial); /* Verify related functions. */ static int verify_command(char *data, char *digest, char *queryfile, --- 81,109 ---- /* Query related functions. */ static int query_command(const char *data, char *digest, ! const EVP_MD *md, const char *policy, int no_nonce, int cert, const char *in, const char *out, int text); static BIO *BIO_open_with_default(const char *file, const char *mode, ! FILE *default_fp); ! static TS_REQ *create_query(BIO *data_bio, char *digest, const EVP_MD *md, const char *policy, int no_nonce, int cert); ! static int create_digest(BIO *input, char *digest, ! const EVP_MD *md, unsigned char **md_value); static ASN1_INTEGER *create_nonce(int bits); /* Reply related functions. */ ! static int reply_command(CONF *conf, char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy, char *in, int token_in, char *out, int token_out, int text); ! static TS_RESP *read_PKCS7(BIO *in_bio); ! static TS_RESP *create_response(CONF *conf, const char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy); ! static ASN1_INTEGER *serial_cb(TS_RESP_CTX *ctx, void *data); static ASN1_INTEGER *next_serial(const char *serialfile); ! static int save_ts_serial(const char *serialfile, ASN1_INTEGER *serial); /* Verify related functions. */ static int verify_command(char *data, char *digest, char *queryfile, *************** *** 114,120 **** char *ca_path, char *ca_file, char *untrusted); static X509_STORE *create_cert_store(char *ca_path, char *ca_file); ! static int verify_cb(int ok, X509_STORE_CTX * ctx); enum mode { CMD_NONE, CMD_QUERY, CMD_REPLY, CMD_VERIFY --- 114,120 ---- char *ca_path, char *ca_file, char *untrusted); static X509_STORE *create_cert_store(char *ca_path, char *ca_file); ! static int verify_cb(int ok, X509_STORE_CTX *ctx); enum mode { CMD_NONE, CMD_QUERY, CMD_REPLY, CMD_VERIFY *************** *** 524,530 **** */ static int ! query_command(const char *data, char *digest, const EVP_MD * md, const char *policy, int no_nonce, int cert, const char *in, const char *out, int text) { --- 524,530 ---- */ static int ! query_command(const char *data, char *digest, const EVP_MD *md, const char *policy, int no_nonce, int cert, const char *in, const char *out, int text) { *************** *** 580,593 **** } static BIO * ! BIO_open_with_default(const char *file, const char *mode, FILE * default_fp) { return file == NULL ? BIO_new_fp(default_fp, BIO_NOCLOSE) : BIO_new_file(file, mode); } static TS_REQ * ! create_query(BIO * data_bio, char *digest, const EVP_MD * md, const char *policy, int no_nonce, int cert) { int ret = 0; --- 580,593 ---- } static BIO * ! BIO_open_with_default(const char *file, const char *mode, FILE *default_fp) { return file == NULL ? BIO_new_fp(default_fp, BIO_NOCLOSE) : BIO_new_file(file, mode); } static TS_REQ * ! create_query(BIO *data_bio, char *digest, const EVP_MD *md, const char *policy, int no_nonce, int cert) { int ret = 0; *************** *** 669,675 **** } static int ! create_digest(BIO * input, char *digest, const EVP_MD * md, unsigned char **md_value) { int md_value_len; --- 669,675 ---- } static int ! create_digest(BIO *input, char *digest, const EVP_MD *md, unsigned char **md_value) { int md_value_len; *************** *** 752,758 **** */ static int ! reply_command(CONF * conf, char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy, char *in, int token_in, char *out, int token_out, int text) { --- 752,758 ---- */ static int ! reply_command(CONF *conf, char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy, char *in, int token_in, char *out, int token_out, int text) { *************** *** 833,839 **** /* Reads a PKCS7 token and adds default 'granted' status info to it. */ static TS_RESP * ! read_PKCS7(BIO * in_bio) { int ret = 0; PKCS7 *token = NULL; --- 833,839 ---- /* Reads a PKCS7 token and adds default 'granted' status info to it. */ static TS_RESP * ! read_PKCS7(BIO *in_bio) { int ret = 0; PKCS7 *token = NULL; *************** *** 877,883 **** } static TS_RESP * ! create_response(CONF * conf, const char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy) { --- 877,883 ---- } static TS_RESP * ! create_response(CONF *conf, const char *section, char *queryfile, char *passin, char *inkey, char *signer, char *chain, const char *policy) { *************** *** 962,968 **** } static ASN1_INTEGER * ! serial_cb(TS_RESP_CTX * ctx, void *data) { const char *serial_file = (const char *) data; ASN1_INTEGER *serial = next_serial(serial_file); --- 962,968 ---- } static ASN1_INTEGER * ! serial_cb(TS_RESP_CTX *ctx, void *data) { const char *serial_file = (const char *) data; ASN1_INTEGER *serial = next_serial(serial_file); *************** *** 1024,1030 **** } static int ! save_ts_serial(const char *serialfile, ASN1_INTEGER * serial) { int ret = 0; BIO *out = NULL; --- 1024,1030 ---- } static int ! save_ts_serial(const char *serialfile, ASN1_INTEGER *serial) { int ret = 0; BIO *out = NULL; *************** *** 1207,1213 **** } static int ! verify_cb(int ok, X509_STORE_CTX * ctx) { /* char buf[256]; --- 1207,1213 ---- } static int ! verify_cb(int ok, X509_STORE_CTX *ctx) { /* char buf[256];