1
- /* $OpenBSD: ts.c,v 1.18 2022/03/24 11:27:45 inoguchi Exp $ */
1
+ /* $OpenBSD: ts.c,v 1.19 2022/03/24 11:40:07 inoguchi Exp $ */
2
2
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3
3
* project 2002.
4
4
*/
@@ -81,29 +81,29 @@ static CONF *load_config_file(const char *configfile);
81
81
82
82
/* Query related functions. */
83
83
static int query_command (const char * data , char * digest ,
84
- const EVP_MD * md , const char * policy , int no_nonce ,
84
+ const EVP_MD * md , const char * policy , int no_nonce ,
85
85
int cert , const char * in , const char * out , int text );
86
86
static BIO * BIO_open_with_default (const char * file , const char * mode ,
87
- FILE * default_fp );
88
- static TS_REQ * create_query (BIO * data_bio , char * digest , const EVP_MD * md ,
87
+ FILE * default_fp );
88
+ static TS_REQ * create_query (BIO * data_bio , char * digest , const EVP_MD * md ,
89
89
const char * policy , int no_nonce , int cert );
90
- static int create_digest (BIO * input , char * digest ,
91
- const EVP_MD * md , unsigned char * * md_value );
90
+ static int create_digest (BIO * input , char * digest ,
91
+ const EVP_MD * md , unsigned char * * md_value );
92
92
static ASN1_INTEGER * create_nonce (int bits );
93
93
94
94
/* Reply related functions. */
95
- static int reply_command (CONF * conf , char * section ,
95
+ static int reply_command (CONF * conf , char * section ,
96
96
char * queryfile , char * passin , char * inkey ,
97
97
char * signer , char * chain , const char * policy ,
98
98
char * in , int token_in , char * out , int token_out ,
99
99
int text );
100
- static TS_RESP * read_PKCS7 (BIO * in_bio );
101
- static TS_RESP * create_response (CONF * conf , const char * section ,
100
+ static TS_RESP * read_PKCS7 (BIO * in_bio );
101
+ static TS_RESP * create_response (CONF * conf , const char * section ,
102
102
char * queryfile , char * passin , char * inkey ,
103
103
char * signer , char * chain , const char * policy );
104
- static ASN1_INTEGER * serial_cb (TS_RESP_CTX * ctx , void * data );
104
+ static ASN1_INTEGER * serial_cb (TS_RESP_CTX * ctx , void * data );
105
105
static ASN1_INTEGER * next_serial (const char * serialfile );
106
- static int save_ts_serial (const char * serialfile , ASN1_INTEGER * serial );
106
+ static int save_ts_serial (const char * serialfile , ASN1_INTEGER * serial );
107
107
108
108
/* Verify related functions. */
109
109
static int verify_command (char * data , char * digest , char * queryfile ,
@@ -114,7 +114,7 @@ static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest,
114
114
char * ca_path , char * ca_file ,
115
115
char * untrusted );
116
116
static X509_STORE * create_cert_store (char * ca_path , char * ca_file );
117
- static int verify_cb (int ok , X509_STORE_CTX * ctx );
117
+ static int verify_cb (int ok , X509_STORE_CTX * ctx );
118
118
119
119
enum mode {
120
120
CMD_NONE , CMD_QUERY , CMD_REPLY , CMD_VERIFY
@@ -524,7 +524,7 @@ load_config_file(const char *configfile)
524
524
*/
525
525
526
526
static int
527
- query_command (const char * data , char * digest , const EVP_MD * md ,
527
+ query_command (const char * data , char * digest , const EVP_MD * md ,
528
528
const char * policy , int no_nonce , int cert , const char * in ,
529
529
const char * out , int text )
530
530
{
@@ -580,14 +580,14 @@ query_command(const char *data, char *digest, const EVP_MD * md,
580
580
}
581
581
582
582
static BIO *
583
- BIO_open_with_default (const char * file , const char * mode , FILE * default_fp )
583
+ BIO_open_with_default (const char * file , const char * mode , FILE * default_fp )
584
584
{
585
585
return file == NULL ? BIO_new_fp (default_fp , BIO_NOCLOSE ) :
586
586
BIO_new_file (file , mode );
587
587
}
588
588
589
589
static TS_REQ *
590
- create_query (BIO * data_bio , char * digest , const EVP_MD * md ,
590
+ create_query (BIO * data_bio , char * digest , const EVP_MD * md ,
591
591
const char * policy , int no_nonce , int cert )
592
592
{
593
593
int ret = 0 ;
@@ -669,7 +669,7 @@ create_query(BIO * data_bio, char *digest, const EVP_MD * md,
669
669
}
670
670
671
671
static int
672
- create_digest (BIO * input , char * digest , const EVP_MD * md ,
672
+ create_digest (BIO * input , char * digest , const EVP_MD * md ,
673
673
unsigned char * * md_value )
674
674
{
675
675
int md_value_len ;
@@ -752,7 +752,7 @@ create_nonce(int bits)
752
752
*/
753
753
754
754
static int
755
- reply_command (CONF * conf , char * section , char * queryfile ,
755
+ reply_command (CONF * conf , char * section , char * queryfile ,
756
756
char * passin , char * inkey , char * signer , char * chain , const char * policy ,
757
757
char * in , int token_in , char * out , int token_out , int text )
758
758
{
@@ -833,7 +833,7 @@ reply_command(CONF * conf, char *section, char *queryfile,
833
833
834
834
/* Reads a PKCS7 token and adds default 'granted' status info to it. */
835
835
static TS_RESP *
836
- read_PKCS7 (BIO * in_bio )
836
+ read_PKCS7 (BIO * in_bio )
837
837
{
838
838
int ret = 0 ;
839
839
PKCS7 * token = NULL ;
@@ -877,7 +877,7 @@ read_PKCS7(BIO * in_bio)
877
877
}
878
878
879
879
static TS_RESP *
880
- create_response (CONF * conf , const char * section ,
880
+ create_response (CONF * conf , const char * section ,
881
881
char * queryfile , char * passin , char * inkey ,
882
882
char * signer , char * chain , const char * policy )
883
883
{
@@ -962,7 +962,7 @@ create_response(CONF * conf, const char *section,
962
962
}
963
963
964
964
static ASN1_INTEGER *
965
- serial_cb (TS_RESP_CTX * ctx , void * data )
965
+ serial_cb (TS_RESP_CTX * ctx , void * data )
966
966
{
967
967
const char * serial_file = (const char * ) data ;
968
968
ASN1_INTEGER * serial = next_serial (serial_file );
@@ -1024,7 +1024,7 @@ next_serial(const char *serialfile)
1024
1024
}
1025
1025
1026
1026
static int
1027
- save_ts_serial (const char * serialfile , ASN1_INTEGER * serial )
1027
+ save_ts_serial (const char * serialfile , ASN1_INTEGER * serial )
1028
1028
{
1029
1029
int ret = 0 ;
1030
1030
BIO * out = NULL ;
@@ -1207,7 +1207,7 @@ create_cert_store(char *ca_path, char *ca_file)
1207
1207
}
1208
1208
1209
1209
static int
1210
- verify_cb (int ok , X509_STORE_CTX * ctx )
1210
+ verify_cb (int ok , X509_STORE_CTX * ctx )
1211
1211
{
1212
1212
/*
1213
1213
char buf[256];
0 commit comments