提交 cc696296 编写于 作者: F FdaSilvaYY 提交者: Matt Caswell

Constify char* input parameters in apps code

Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 e7917e38
...@@ -320,9 +320,9 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp) ...@@ -320,9 +320,9 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
return res; return res;
} }
static char *app_get_pass(char *arg, int keepbio); static char *app_get_pass(const char *arg, int keepbio);
int app_passwd(char *arg1, char *arg2, char **pass1, char **pass2) int app_passwd(const char *arg1, const char *arg2, char **pass1, char **pass2)
{ {
int same; int same;
if (!arg2 || !arg1 || strcmp(arg1, arg2)) if (!arg2 || !arg1 || strcmp(arg1, arg2))
...@@ -344,7 +344,7 @@ int app_passwd(char *arg1, char *arg2, char **pass1, char **pass2) ...@@ -344,7 +344,7 @@ int app_passwd(char *arg1, char *arg2, char **pass1, char **pass2)
return 1; return 1;
} }
static char *app_get_pass(char *arg, int keepbio) static char *app_get_pass(const char *arg, int keepbio)
{ {
char *tmp, tpass[APP_PASS_LEN]; char *tmp, tpass[APP_PASS_LEN];
static BIO *pwdbio = NULL; static BIO *pwdbio = NULL;
...@@ -1185,7 +1185,7 @@ void print_array(BIO *out, const char* title, int len, const unsigned char* d) ...@@ -1185,7 +1185,7 @@ void print_array(BIO *out, const char* title, int len, const unsigned char* d)
BIO_printf(out, "\n};\n"); BIO_printf(out, "\n};\n");
} }
X509_STORE *setup_verify(char *CAfile, char *CApath, int noCAfile, int noCApath) X509_STORE *setup_verify(const char *CAfile, const char *CApath, int noCAfile, int noCApath)
{ {
X509_STORE *store = X509_STORE_new(); X509_STORE *store = X509_STORE_new();
X509_LOOKUP *lookup; X509_LOOKUP *lookup;
...@@ -1318,7 +1318,7 @@ static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING) ...@@ -1318,7 +1318,7 @@ static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING) static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING)
#undef BSIZE #undef BSIZE
#define BSIZE 256 #define BSIZE 256
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai) BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai)
{ {
BIO *in = NULL; BIO *in = NULL;
BIGNUM *ret = NULL; BIGNUM *ret = NULL;
...@@ -1363,7 +1363,7 @@ BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai) ...@@ -1363,7 +1363,7 @@ BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
return (ret); return (ret);
} }
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial,
ASN1_INTEGER **retai) ASN1_INTEGER **retai)
{ {
char buf[1][BSIZE]; char buf[1][BSIZE];
...@@ -1413,7 +1413,8 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ...@@ -1413,7 +1413,8 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
return (ret); return (ret);
} }
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) int rotate_serial(const char *serialfile, const char *new_suffix,
const char *old_suffix)
{ {
char buf[2][BSIZE]; char buf[2][BSIZE];
int i, j; int i, j;
...@@ -1483,7 +1484,7 @@ int rand_serial(BIGNUM *b, ASN1_INTEGER *ai) ...@@ -1483,7 +1484,7 @@ int rand_serial(BIGNUM *b, ASN1_INTEGER *ai)
return ret; return ret;
} }
CA_DB *load_index(char *dbfile, DB_ATTR *db_attr) CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
{ {
CA_DB *retdb = NULL; CA_DB *retdb = NULL;
TXT_DB *tmpdb = NULL; TXT_DB *tmpdb = NULL;
......
...@@ -400,7 +400,7 @@ int set_cert_ex(unsigned long *flags, const char *arg); ...@@ -400,7 +400,7 @@ int set_cert_ex(unsigned long *flags, const char *arg);
int set_name_ex(unsigned long *flags, const char *arg); int set_name_ex(unsigned long *flags, const char *arg);
int set_ext_copy(int *copy_type, const char *arg); int set_ext_copy(int *copy_type, const char *arg);
int copy_extensions(X509 *x, X509_REQ *req, int copy_type); int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
int app_passwd(char *arg1, char *arg2, char **pass1, char **pass2); int app_passwd(const char *arg1, const char *arg2, char **pass1, char **pass2);
int add_oid_section(CONF *conf); int add_oid_section(CONF *conf);
X509 *load_cert(const char *file, int format, const char *cert_descrip); X509 *load_cert(const char *file, int format, const char *cert_descrip);
X509_CRL *load_crl(const char *infile, int format); X509_CRL *load_crl(const char *infile, int format);
...@@ -412,7 +412,7 @@ int load_certs(const char *file, STACK_OF(X509) **certs, int format, ...@@ -412,7 +412,7 @@ int load_certs(const char *file, STACK_OF(X509) **certs, int format,
const char *pass, const char *cert_descrip); const char *pass, const char *cert_descrip);
int load_crls(const char *file, STACK_OF(X509_CRL) **crls, int format, int load_crls(const char *file, STACK_OF(X509_CRL) **crls, int format,
const char *pass, const char *cert_descrip); const char *pass, const char *cert_descrip);
X509_STORE *setup_verify(char *CAfile, char *CApath, X509_STORE *setup_verify(const char *CAfile, const char *CApath,
int noCAfile, int noCApath); int noCAfile, int noCApath);
__owur int ctx_set_verify_locations(SSL_CTX *ctx, const char *CAfile, __owur int ctx_set_verify_locations(SSL_CTX *ctx, const char *CAfile,
const char *CApath, int noCAfile, const char *CApath, int noCAfile,
...@@ -468,12 +468,13 @@ typedef struct ca_db_st { ...@@ -468,12 +468,13 @@ typedef struct ca_db_st {
} CA_DB; } CA_DB;
void* app_malloc(int sz, const char *what); void* app_malloc(int sz, const char *what);
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai); BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai);
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial,
ASN1_INTEGER **retai); ASN1_INTEGER **retai);
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix); int rotate_serial(const char *serialfile, const char *new_suffix,
const char *old_suffix);
int rand_serial(BIGNUM *b, ASN1_INTEGER *ai); int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
CA_DB *load_index(char *dbfile, DB_ATTR *dbattr); CA_DB *load_index(const char *dbfile, DB_ATTR *dbattr);
int index_index(CA_DB *db); int index_index(CA_DB *db);
int save_index(const char *dbfile, const char *suffix, CA_DB *db); int save_index(const char *dbfile, const char *suffix, CA_DB *db);
int rotate_index(const char *dbfile, const char *new_suffix, int rotate_index(const char *dbfile, const char *new_suffix,
......
...@@ -52,7 +52,7 @@ OPTIONS asn1parse_options[] = { ...@@ -52,7 +52,7 @@ OPTIONS asn1parse_options[] = {
{NULL} {NULL}
}; };
static int do_generate(char *genstr, char *genconf, BUF_MEM *buf); static int do_generate(char *genstr, const char *genconf, BUF_MEM *buf);
int asn1parse_main(int argc, char **argv) int asn1parse_main(int argc, char **argv)
{ {
...@@ -283,7 +283,7 @@ int asn1parse_main(int argc, char **argv) ...@@ -283,7 +283,7 @@ int asn1parse_main(int argc, char **argv)
return (ret); return (ret);
} }
static int do_generate(char *genstr, char *genconf, BUF_MEM *buf) static int do_generate(char *genstr, const char *genconf, BUF_MEM *buf)
{ {
CONF *cnf = NULL; CONF *cnf = NULL;
int len; int len;
......
...@@ -90,39 +90,40 @@ ...@@ -90,39 +90,40 @@
#define REV_CA_COMPROMISE 4 /* Value is CA key compromise time */ #define REV_CA_COMPROMISE 4 /* Value is CA key compromise time */
static char *lookup_conf(const CONF *conf, const char *group, const char *tag); static char *lookup_conf(const CONF *conf, const char *group, const char *tag);
static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
BIGNUM *serial, char *subj, unsigned long chtype, BIGNUM *serial, const char *subj, unsigned long chtype,
int multirdn, int email_dn, char *startdate, char *enddate, int multirdn, int email_dn, const char *startdate,
long days, int batch, char *ext_sect, CONF *conf, const char *enddate,
long days, int batch, const char *ext_sect, CONF *conf,
int verbose, unsigned long certopt, unsigned long nameopt, int verbose, unsigned long certopt, unsigned long nameopt,
int default_op, int ext_copy, int selfsign); int default_op, int ext_copy, int selfsign);
static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
BIGNUM *serial, char *subj, unsigned long chtype, BIGNUM *serial, const char *subj, unsigned long chtype,
int multirdn, int email_dn, char *startdate, int multirdn, int email_dn, const char *startdate,
char *enddate, long days, int batch, char *ext_sect, const char *enddate, long days, int batch, const char *ext_sect,
CONF *conf, int verbose, unsigned long certopt, CONF *conf, int verbose, unsigned long certopt,
unsigned long nameopt, int default_op, int ext_copy); unsigned long nameopt, int default_op, int ext_copy);
static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
X509 *x509, const EVP_MD *dgst, X509 *x509, const EVP_MD *dgst,
STACK_OF(OPENSSL_STRING) *sigopts, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
BIGNUM *serial, char *subj, unsigned long chtype, BIGNUM *serial, const char *subj, unsigned long chtype,
int multirdn, int email_dn, char *startdate, int multirdn, int email_dn, const char *startdate,
char *enddate, long days, char *ext_sect, CONF *conf, const char *enddate, long days, const char *ext_sect, CONF *conf,
int verbose, unsigned long certopt, int verbose, unsigned long certopt,
unsigned long nameopt, int default_op, int ext_copy); unsigned long nameopt, int default_op, int ext_copy);
static void write_new_certificate(BIO *bp, X509 *x, int output_der, static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext);
int notext);
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial, STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,
char *subj, unsigned long chtype, int multirdn, const char *subj, unsigned long chtype, int multirdn,
int email_dn, char *startdate, char *enddate, long days, int email_dn, const char *startdate, const char *enddate, long days,
int batch, int verbose, X509_REQ *req, char *ext_sect, int batch, int verbose, X509_REQ *req, const char *ext_sect,
CONF *conf, unsigned long certopt, unsigned long nameopt, CONF *conf, unsigned long certopt, unsigned long nameopt,
int default_op, int ext_copy, int selfsign); int default_op, int ext_copy, int selfsign);
static int do_revoke(X509 *x509, CA_DB *db, int ext, char *extval); static int do_revoke(X509 *x509, CA_DB *db, int ext, char *extval);
...@@ -235,12 +236,12 @@ int ca_main(int argc, char **argv) ...@@ -235,12 +236,12 @@ int ca_main(int argc, char **argv)
const EVP_MD *dgst = NULL; const EVP_MD *dgst = NULL;
char *configfile = default_config_file, *section = NULL; char *configfile = default_config_file, *section = NULL;
char *md = NULL, *policy = NULL, *keyfile = NULL; char *md = NULL, *policy = NULL, *keyfile = NULL;
char *certfile = NULL, *crl_ext = NULL, *crlnumberfile = NULL; char *certfile = NULL, *crl_ext = NULL, *crlnumberfile = NULL, *key = NULL;
char *infile = NULL, *spkac_file = NULL, *ss_cert_file = NULL; const char *infile = NULL, *spkac_file = NULL, *ss_cert_file = NULL;
char *extensions = NULL, *extfile = NULL, *key = NULL, *passinarg = NULL; const char *extensions = NULL, *extfile = NULL, *passinarg = NULL;
char *outdir = NULL, *outfile = NULL, *rev_arg = NULL, *ser_status = NULL; char *outdir = NULL, *outfile = NULL, *rev_arg = NULL, *ser_status = NULL;
char *serialfile = NULL, *startdate = NULL, *subj = NULL; const char *serialfile = NULL, *subj = NULL;
char *prog, *enddate = NULL; char *prog, *startdate = NULL, *enddate = NULL;
char *dbfile = NULL, *f, *randfile = NULL; char *dbfile = NULL, *f, *randfile = NULL;
char buf[3][BSIZE]; char buf[3][BSIZE];
char *const *pp; char *const *pp;
...@@ -1245,12 +1246,13 @@ static char *lookup_conf(const CONF *conf, const char *section, const char *tag) ...@@ -1245,12 +1246,13 @@ static char *lookup_conf(const CONF *conf, const char *section, const char *tag)
return entry; return entry;
} }
static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
BIGNUM *serial, char *subj, unsigned long chtype, BIGNUM *serial, const char *subj, unsigned long chtype,
int multirdn, int email_dn, char *startdate, char *enddate, int multirdn, int email_dn, const char *startdate,
long days, int batch, char *ext_sect, CONF *lconf, const char *enddate,
long days, int batch, const char *ext_sect, CONF *lconf,
int verbose, unsigned long certopt, unsigned long nameopt, int verbose, unsigned long certopt, unsigned long nameopt,
int default_op, int ext_copy, int selfsign) int default_op, int ext_copy, int selfsign)
{ {
...@@ -1312,12 +1314,12 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, ...@@ -1312,12 +1314,12 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
return (ok); return (ok);
} }
static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
BIGNUM *serial, char *subj, unsigned long chtype, BIGNUM *serial, const char *subj, unsigned long chtype,
int multirdn, int email_dn, char *startdate, int multirdn, int email_dn, const char *startdate,
char *enddate, long days, int batch, char *ext_sect, const char *enddate, long days, int batch, const char *ext_sect,
CONF *lconf, int verbose, unsigned long certopt, CONF *lconf, int verbose, unsigned long certopt,
unsigned long nameopt, int default_op, int ext_copy) unsigned long nameopt, int default_op, int ext_copy)
{ {
...@@ -1367,9 +1369,9 @@ static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, ...@@ -1367,9 +1369,9 @@ static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial, STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,
char *subj, unsigned long chtype, int multirdn, const char *subj, unsigned long chtype, int multirdn,
int email_dn, char *startdate, char *enddate, long days, int email_dn, const char *startdate, const char *enddate, long days,
int batch, int verbose, X509_REQ *req, char *ext_sect, int batch, int verbose, X509_REQ *req, const char *ext_sect,
CONF *lconf, unsigned long certopt, unsigned long nameopt, CONF *lconf, unsigned long certopt, unsigned long nameopt,
int default_op, int ext_copy, int selfsign) int default_op, int ext_copy, int selfsign)
{ {
...@@ -1880,13 +1882,13 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der, ...@@ -1880,13 +1882,13 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der,
PEM_write_bio_X509(bp, x); PEM_write_bio_X509(bp, x);
} }
static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
X509 *x509, const EVP_MD *dgst, X509 *x509, const EVP_MD *dgst,
STACK_OF(OPENSSL_STRING) *sigopts, STACK_OF(OPENSSL_STRING) *sigopts,
STACK_OF(CONF_VALUE) *policy, CA_DB *db, STACK_OF(CONF_VALUE) *policy, CA_DB *db,
BIGNUM *serial, char *subj, unsigned long chtype, BIGNUM *serial, const char *subj, unsigned long chtype,
int multirdn, int email_dn, char *startdate, int multirdn, int email_dn, const char *startdate,
char *enddate, long days, char *ext_sect, const char *enddate, long days, const char *ext_sect,
CONF *lconf, int verbose, unsigned long certopt, CONF *lconf, int verbose, unsigned long certopt,
unsigned long nameopt, int default_op, int ext_copy) unsigned long nameopt, int default_op, int ext_copy)
{ {
...@@ -2268,7 +2270,8 @@ static const char *crl_reasons[] = { ...@@ -2268,7 +2270,8 @@ static const char *crl_reasons[] = {
char *make_revocation_str(int rev_type, char *rev_arg) char *make_revocation_str(int rev_type, char *rev_arg)
{ {
char *other = NULL, *str; char *str;
const char *other = NULL;
const char *reason = NULL; const char *reason = NULL;
ASN1_OBJECT *otmp; ASN1_OBJECT *otmp;
ASN1_UTCTIME *revtm = NULL; ASN1_UTCTIME *revtm = NULL;
...@@ -2415,8 +2418,10 @@ int make_revoked(X509_REVOKED *rev, const char *str) ...@@ -2415,8 +2418,10 @@ int make_revoked(X509_REVOKED *rev, const char *str)
static int old_entry_print(const ASN1_OBJECT *obj, const ASN1_STRING *str) static int old_entry_print(const ASN1_OBJECT *obj, const ASN1_STRING *str)
{ {
char buf[25], *pbuf, *p; char buf[25], *pbuf;
const char *p;
int j; int j;
j = i2a_ASN1_OBJECT(bio_err, obj); j = i2a_ASN1_OBJECT(bio_err, obj);
pbuf = buf; pbuf = buf;
for (j = 22 - j; j > 0; j--) for (j = 22 - j; j > 0; j--)
...@@ -2436,7 +2441,7 @@ static int old_entry_print(const ASN1_OBJECT *obj, const ASN1_STRING *str) ...@@ -2436,7 +2441,7 @@ static int old_entry_print(const ASN1_OBJECT *obj, const ASN1_STRING *str)
else else
BIO_printf(bio_err, "ASN.1 %2d:'", str->type); BIO_printf(bio_err, "ASN.1 %2d:'", str->type);
p = (char *)str->data; p = (const char *)str->data;
for (j = str->length; j > 0; j--) { for (j = str->length; j > 0; j--) {
if ((*p >= ' ') && (*p <= '~')) if ((*p >= ' ') && (*p <= '~'))
BIO_printf(bio_err, "%c", *p); BIO_printf(bio_err, "%c", *p);
......
...@@ -199,7 +199,8 @@ int cms_main(int argc, char **argv) ...@@ -199,7 +199,8 @@ int cms_main(int argc, char **argv)
X509_STORE *store = NULL; X509_STORE *store = NULL;
X509_VERIFY_PARAM *vpm = NULL; X509_VERIFY_PARAM *vpm = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile = NULL; char *certfile = NULL, *keyfile = NULL, *contfile = NULL;
char *CAfile = NULL, *CApath = NULL, *certsoutfile = NULL; const char *CAfile = NULL, *CApath = NULL;
char *certsoutfile = NULL;
int noCAfile = 0, noCApath = 0; int noCAfile = 0, noCApath = 0;
char *infile = NULL, *outfile = NULL, *rctfile = NULL, *inrand = NULL; char *infile = NULL, *outfile = NULL, *rctfile = NULL, *inrand = NULL;
char *passinarg = NULL, *passin = NULL, *signerfile = NULL, *recipfile = char *passinarg = NULL, *passin = NULL, *signerfile = NULL, *recipfile =
......
...@@ -72,7 +72,7 @@ int crl_main(int argc, char **argv) ...@@ -72,7 +72,7 @@ int crl_main(int argc, char **argv)
unsigned long nmflag = 0; unsigned long nmflag = 0;
char nmflag_set = 0; char nmflag_set = 0;
char *infile = NULL, *outfile = NULL, *crldiff = NULL, *keyfile = NULL; char *infile = NULL, *outfile = NULL, *crldiff = NULL, *keyfile = NULL;
char *CAfile = NULL, *CApath = NULL, *prog; const char *CAfile = NULL, *CApath = NULL, *prog;
OPTION_CHOICE o; OPTION_CHOICE o;
int hash = 0, issuer = 0, lastupdate = 0, nextupdate = 0, noout = 0; int hash = 0, issuer = 0, lastupdate = 0, nextupdate = 0, noout = 0;
int informat = FORMAT_PEM, outformat = FORMAT_PEM, keyformat = FORMAT_PEM; int informat = FORMAT_PEM, outformat = FORMAT_PEM, keyformat = FORMAT_PEM;
......
...@@ -194,7 +194,8 @@ int ocsp_main(int argc, char **argv) ...@@ -194,7 +194,8 @@ int ocsp_main(int argc, char **argv)
X509 *signer = NULL, *rsigner = NULL; X509 *signer = NULL, *rsigner = NULL;
X509_STORE *store = NULL; X509_STORE *store = NULL;
X509_VERIFY_PARAM *vpm = NULL; X509_VERIFY_PARAM *vpm = NULL;
char *CAfile = NULL, *CApath = NULL, *header, *value; const char *CAfile = NULL, *CApath = NULL;
char *header, *value;
char *host = NULL, *port = NULL, *path = "/", *outfile = NULL; char *host = NULL, *port = NULL, *path = "/", *outfile = NULL;
char *rca_filename = NULL, *reqin = NULL, *respin = NULL; char *rca_filename = NULL, *reqin = NULL, *respin = NULL;
char *reqout = NULL, *respout = NULL, *ridx_filename = NULL; char *reqout = NULL, *respout = NULL, *ridx_filename = NULL;
...@@ -809,7 +810,7 @@ static void print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req, ...@@ -809,7 +810,7 @@ static void print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
long maxage) long maxage)
{ {
OCSP_CERTID *id; OCSP_CERTID *id;
char *name; const char *name;
int i, status, reason; int i, status, reason;
ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd; ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;
......
...@@ -131,8 +131,8 @@ int pkcs12_main(int argc, char **argv) ...@@ -131,8 +131,8 @@ int pkcs12_main(int argc, char **argv)
int noprompt = 0; int noprompt = 0;
char *passinarg = NULL, *passoutarg = NULL, *passarg = NULL; char *passinarg = NULL, *passoutarg = NULL, *passarg = NULL;
char *passin = NULL, *passout = NULL, *inrand = NULL, *macalg = NULL; char *passin = NULL, *passout = NULL, *inrand = NULL, *macalg = NULL;
char *cpass = NULL, *mpass = NULL, *CApath = NULL, *CAfile = NULL; char *cpass = NULL, *mpass = NULL;
char *prog; const char *CApath = NULL, *CAfile = NULL, *prog;
int noCApath = 0, noCAfile = 0; int noCApath = 0, noCAfile = 0;
ENGINE *e = NULL; ENGINE *e = NULL;
BIO *in = NULL, *out = NULL; BIO *in = NULL, *out = NULL;
......
...@@ -28,7 +28,7 @@ static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file, ...@@ -28,7 +28,7 @@ static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file,
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op, static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
unsigned char *out, size_t *poutlen, unsigned char *out, size_t *poutlen,
unsigned char *in, size_t inlen); const unsigned char *in, size_t inlen);
typedef enum OPTION_choice { typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
...@@ -459,7 +459,7 @@ static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file, ...@@ -459,7 +459,7 @@ static int setup_peer(EVP_PKEY_CTX *ctx, int peerform, const char *file,
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op, static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
unsigned char *out, size_t *poutlen, unsigned char *out, size_t *poutlen,
unsigned char *in, size_t inlen) const unsigned char *in, size_t inlen)
{ {
int rv = 0; int rv = 0;
switch (pkey_op) { switch (pkey_op) {
......
...@@ -46,11 +46,11 @@ ...@@ -46,11 +46,11 @@
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *dn, int mutlirdn, static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *dn, int mutlirdn,
int attribs, unsigned long chtype); int attribs, unsigned long chtype);
static int build_subject(X509_REQ *req, char *subj, unsigned long chtype, static int build_subject(X509_REQ *req, const char *subj, unsigned long chtype,
int multirdn); int multirdn);
static int prompt_info(X509_REQ *req, static int prompt_info(X509_REQ *req,
STACK_OF(CONF_VALUE) *dn_sk, char *dn_sect, STACK_OF(CONF_VALUE) *dn_sk, const char *dn_sect,
STACK_OF(CONF_VALUE) *attr_sk, char *attr_sect, STACK_OF(CONF_VALUE) *attr_sk, const char *attr_sect,
int attribs, unsigned long chtype); int attribs, unsigned long chtype);
static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *sk, static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *sk,
STACK_OF(CONF_VALUE) *attr, int attribs, STACK_OF(CONF_VALUE) *attr, int attribs,
...@@ -888,7 +888,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn, ...@@ -888,7 +888,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn,
* subject is expected to be in the format /type0=value0/type1=value1/type2=... * subject is expected to be in the format /type0=value0/type1=value1/type2=...
* where characters may be escaped by \ * where characters may be escaped by \
*/ */
static int build_subject(X509_REQ *req, char *subject, unsigned long chtype, static int build_subject(X509_REQ *req, const char *subject, unsigned long chtype,
int multirdn) int multirdn)
{ {
X509_NAME *n; X509_NAME *n;
...@@ -905,8 +905,8 @@ static int build_subject(X509_REQ *req, char *subject, unsigned long chtype, ...@@ -905,8 +905,8 @@ static int build_subject(X509_REQ *req, char *subject, unsigned long chtype,
} }
static int prompt_info(X509_REQ *req, static int prompt_info(X509_REQ *req,
STACK_OF(CONF_VALUE) *dn_sk, char *dn_sect, STACK_OF(CONF_VALUE) *dn_sk, const char *dn_sect,
STACK_OF(CONF_VALUE) *attr_sk, char *attr_sect, STACK_OF(CONF_VALUE) *attr_sk, const char *attr_sect,
int attribs, unsigned long chtype) int attribs, unsigned long chtype)
{ {
int i; int i;
......
...@@ -785,7 +785,8 @@ int s_client_main(int argc, char **argv) ...@@ -785,7 +785,8 @@ int s_client_main(int argc, char **argv)
STACK_OF(OPENSSL_STRING) *dane_tlsa_rrset = NULL; STACK_OF(OPENSSL_STRING) *dane_tlsa_rrset = NULL;
STACK_OF(X509_CRL) *crls = NULL; STACK_OF(X509_CRL) *crls = NULL;
const SSL_METHOD *meth = TLS_client_method(); const SSL_METHOD *meth = TLS_client_method();
char *CApath = NULL, *CAfile = NULL, *cbuf = NULL, *sbuf = NULL; const char *CApath = NULL, *CAfile = NULL;
char *cbuf = NULL, *sbuf = NULL;
char *mbuf = NULL, *proxystr = NULL, *connectstr = NULL; char *mbuf = NULL, *proxystr = NULL, *connectstr = NULL;
char *cert_file = NULL, *key_file = NULL, *chain_file = NULL; char *cert_file = NULL, *key_file = NULL, *chain_file = NULL;
char *chCApath = NULL, *chCAfile = NULL, *host = NULL; char *chCApath = NULL, *chCAfile = NULL, *host = NULL;
......
...@@ -882,7 +882,7 @@ int s_server_main(int argc, char *argv[]) ...@@ -882,7 +882,7 @@ int s_server_main(int argc, char *argv[])
STACK_OF(X509_CRL) *crls = NULL; STACK_OF(X509_CRL) *crls = NULL;
X509 *s_cert = NULL, *s_dcert = NULL; X509 *s_cert = NULL, *s_dcert = NULL;
X509_VERIFY_PARAM *vpm = NULL; X509_VERIFY_PARAM *vpm = NULL;
char *CApath = NULL, *CAfile = NULL, *chCApath = NULL, *chCAfile = NULL; const char *CApath = NULL, *CAfile = NULL, *chCApath = NULL, *chCAfile = NULL;
char *dpassarg = NULL, *dpass = NULL, *inrand = NULL; char *dpassarg = NULL, *dpass = NULL, *inrand = NULL;
char *passarg = NULL, *pass = NULL, *vfyCApath = NULL, *vfyCAfile = NULL; char *passarg = NULL, *pass = NULL, *vfyCApath = NULL, *vfyCAfile = NULL;
char *crl_file = NULL, *prog; char *crl_file = NULL, *prog;
......
...@@ -120,8 +120,8 @@ int smime_main(int argc, char **argv) ...@@ -120,8 +120,8 @@ int smime_main(int argc, char **argv)
X509_VERIFY_PARAM *vpm = NULL; X509_VERIFY_PARAM *vpm = NULL;
const EVP_CIPHER *cipher = NULL; const EVP_CIPHER *cipher = NULL;
const EVP_MD *sign_md = NULL; const EVP_MD *sign_md = NULL;
char *CAfile = NULL, *CApath = NULL, *inrand = NULL; const char *CAfile = NULL, *CApath = NULL, *prog = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile = NULL, *prog; char *certfile = NULL, *keyfile = NULL, *contfile = NULL, *inrand = NULL;
char *infile = NULL, *outfile = NULL, *signerfile = NULL, *recipfile = char *infile = NULL, *outfile = NULL, *signerfile = NULL, *recipfile =
NULL; NULL;
char *passinarg = NULL, *passin = NULL, *to = NULL, *from = char *passinarg = NULL, *passin = NULL, *to = NULL, *from =
......
...@@ -38,41 +38,41 @@ static ASN1_OBJECT *txt2obj(const char *oid); ...@@ -38,41 +38,41 @@ static ASN1_OBJECT *txt2obj(const char *oid);
static CONF *load_config_file(const char *configfile); static CONF *load_config_file(const char *configfile);
/* Query related functions. */ /* Query related functions. */
static int query_command(const char *data, char *digest, static int query_command(const char *data, const char *digest,
const EVP_MD *md, const char *policy, int no_nonce, const EVP_MD *md, const char *policy, int no_nonce,
int cert, const char *in, const char *out, int text); int cert, const char *in, const char *out, int text);
static TS_REQ *create_query(BIO *data_bio, char *digest, const EVP_MD *md, static TS_REQ *create_query(BIO *data_bio, const char *digest, const EVP_MD *md,
const char *policy, int no_nonce, int cert); const char *policy, int no_nonce, int cert);
static int create_digest(BIO *input, char *digest, static int create_digest(BIO *input, const char *digest,
const EVP_MD *md, unsigned char **md_value); const EVP_MD *md, unsigned char **md_value);
static ASN1_INTEGER *create_nonce(int bits); static ASN1_INTEGER *create_nonce(int bits);
/* Reply related functions. */ /* Reply related functions. */
static int reply_command(CONF *conf, char *section, char *engine, static int reply_command(CONF *conf, const char *section, const char *engine,
char *queryfile, char *passin, char *inkey, const char *queryfile, const char *passin, const char *inkey,
const EVP_MD *md, char *signer, char *chain, const EVP_MD *md, const char *signer, const char *chain,
const char *policy, char *in, int token_in, const char *policy, const char *in, int token_in,
char *out, int token_out, int text); const char *out, int token_out, int text);
static TS_RESP *read_PKCS7(BIO *in_bio); static TS_RESP *read_PKCS7(BIO *in_bio);
static TS_RESP *create_response(CONF *conf, const char *section, char *engine, static TS_RESP *create_response(CONF *conf, const char *section, const char *engine,
char *queryfile, char *passin, const char *queryfile, const char *passin,
char *inkey, const EVP_MD *md, char *signer, const char *inkey, const EVP_MD *md, const char *signer,
char *chain, const char *policy); const char *chain, const char *policy);
static ASN1_INTEGER *serial_cb(TS_RESP_CTX *ctx, void *data); static ASN1_INTEGER *serial_cb(TS_RESP_CTX *ctx, void *data);
static ASN1_INTEGER *next_serial(const char *serialfile); static ASN1_INTEGER *next_serial(const char *serialfile);
static int save_ts_serial(const char *serialfile, ASN1_INTEGER *serial); static int save_ts_serial(const char *serialfile, ASN1_INTEGER *serial);
/* Verify related functions. */ /* Verify related functions. */
static int verify_command(char *data, char *digest, char *queryfile, static int verify_command(const char *data, const char *digest, const char *queryfile,
char *in, int token_in, const char *in, int token_in,
char *CApath, char *CAfile, char *untrusted, const char *CApath, const char *CAfile, const char *untrusted,
X509_VERIFY_PARAM *vpm); X509_VERIFY_PARAM *vpm);
static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest, static TS_VERIFY_CTX *create_verify_ctx(const char *data, const char *digest,
char *queryfile, const char *queryfile,
char *CApath, char *CAfile, const char *CApath, const char *CAfile,
char *untrusted, const char *untrusted,
X509_VERIFY_PARAM *vpm); X509_VERIFY_PARAM *vpm);
static X509_STORE *create_cert_store(char *CApath, char *CAfile, static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
X509_VERIFY_PARAM *vpm); X509_VERIFY_PARAM *vpm);
static int verify_cb(int ok, X509_STORE_CTX *ctx); static int verify_cb(int ok, X509_STORE_CTX *ctx);
...@@ -153,9 +153,11 @@ static char* opt_helplist[] = { ...@@ -153,9 +153,11 @@ static char* opt_helplist[] = {
int ts_main(int argc, char **argv) int ts_main(int argc, char **argv)
{ {
CONF *conf = NULL; CONF *conf = NULL;
char *CAfile = NULL, *untrusted = NULL, *engine = NULL, *prog, **helpp; const char *CAfile = NULL, *untrusted = NULL, *prog;
char *configfile = default_config_file; const char *configfile = default_config_file, *engine = NULL;
char *section = NULL, *password = NULL; const char *section = NULL;
char **helpp;
char *password = NULL;
char *data = NULL, *digest = NULL, *rnd = NULL, *policy = NULL; char *data = NULL, *digest = NULL, *rnd = NULL, *policy = NULL;
char *in = NULL, *out = NULL, *queryfile = NULL, *passin = NULL; char *in = NULL, *out = NULL, *queryfile = NULL, *passin = NULL;
char *inkey = NULL, *signer = NULL, *chain = NULL, *CApath = NULL; char *inkey = NULL, *signer = NULL, *chain = NULL, *CApath = NULL;
...@@ -377,7 +379,7 @@ static CONF *load_config_file(const char *configfile) ...@@ -377,7 +379,7 @@ static CONF *load_config_file(const char *configfile)
/* /*
* Query-related method definitions. * Query-related method definitions.
*/ */
static int query_command(const char *data, char *digest, const EVP_MD *md, static int query_command(const char *data, const char *digest, const EVP_MD *md,
const char *policy, int no_nonce, const char *policy, int no_nonce,
int cert, const char *in, const char *out, int text) int cert, const char *in, const char *out, int text)
{ {
...@@ -424,7 +426,7 @@ static int query_command(const char *data, char *digest, const EVP_MD *md, ...@@ -424,7 +426,7 @@ static int query_command(const char *data, char *digest, const EVP_MD *md,
return ret; return ret;
} }
static TS_REQ *create_query(BIO *data_bio, char *digest, const EVP_MD *md, static TS_REQ *create_query(BIO *data_bio, const char *digest, const EVP_MD *md,
const char *policy, int no_nonce, int cert) const char *policy, int no_nonce, int cert)
{ {
int ret = 0; int ret = 0;
...@@ -488,7 +490,7 @@ static TS_REQ *create_query(BIO *data_bio, char *digest, const EVP_MD *md, ...@@ -488,7 +490,7 @@ static TS_REQ *create_query(BIO *data_bio, char *digest, const EVP_MD *md,
return ts_req; return ts_req;
} }
static int create_digest(BIO *input, char *digest, const EVP_MD *md, static int create_digest(BIO *input, const char *digest, const EVP_MD *md,
unsigned char **md_value) unsigned char **md_value)
{ {
int md_value_len; int md_value_len;
...@@ -566,11 +568,11 @@ static ASN1_INTEGER *create_nonce(int bits) ...@@ -566,11 +568,11 @@ static ASN1_INTEGER *create_nonce(int bits)
* Reply-related method definitions. * Reply-related method definitions.
*/ */
static int reply_command(CONF *conf, char *section, char *engine, static int reply_command(CONF *conf, const char *section, const char *engine,
char *queryfile, char *passin, char *inkey, const char *queryfile, const char *passin, const char *inkey,
const EVP_MD *md, char *signer, char *chain, const EVP_MD *md, const char *signer, const char *chain,
const char *policy, char *in, int token_in, const char *policy, const char *in, int token_in,
char *out, int token_out, int text) const char *out, int token_out, int text)
{ {
int ret = 0; int ret = 0;
TS_RESP *response = NULL; TS_RESP *response = NULL;
...@@ -674,10 +676,10 @@ static TS_RESP *read_PKCS7(BIO *in_bio) ...@@ -674,10 +676,10 @@ static TS_RESP *read_PKCS7(BIO *in_bio)
return resp; return resp;
} }
static TS_RESP *create_response(CONF *conf, const char *section, char *engine, static TS_RESP *create_response(CONF *conf, const char *section, const char *engine,
char *queryfile, char *passin, const char *queryfile, const char *passin,
char *inkey, const EVP_MD *md, char *signer, const char *inkey, const EVP_MD *md, const char *signer,
char *chain, const char *policy) const char *chain, const char *policy)
{ {
int ret = 0; int ret = 0;
TS_RESP *response = NULL; TS_RESP *response = NULL;
...@@ -825,9 +827,9 @@ static int save_ts_serial(const char *serialfile, ASN1_INTEGER *serial) ...@@ -825,9 +827,9 @@ static int save_ts_serial(const char *serialfile, ASN1_INTEGER *serial)
* Verify-related method definitions. * Verify-related method definitions.
*/ */
static int verify_command(char *data, char *digest, char *queryfile, static int verify_command(const char *data, const char *digest, const char *queryfile,
char *in, int token_in, const char *in, int token_in,
char *CApath, char *CAfile, char *untrusted, const char *CApath, const char *CAfile, const char *untrusted,
X509_VERIFY_PARAM *vpm) X509_VERIFY_PARAM *vpm)
{ {
BIO *in_bio = NULL; BIO *in_bio = NULL;
...@@ -871,10 +873,10 @@ static int verify_command(char *data, char *digest, char *queryfile, ...@@ -871,10 +873,10 @@ static int verify_command(char *data, char *digest, char *queryfile,
return ret; return ret;
} }
static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest, static TS_VERIFY_CTX *create_verify_ctx(const char *data, const char *digest,
char *queryfile, const char *queryfile,
char *CApath, char *CAfile, const char *CApath, const char *CAfile,
char *untrusted, const char *untrusted,
X509_VERIFY_PARAM *vpm) X509_VERIFY_PARAM *vpm)
{ {
TS_VERIFY_CTX *ctx = NULL; TS_VERIFY_CTX *ctx = NULL;
...@@ -935,7 +937,8 @@ static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest, ...@@ -935,7 +937,8 @@ static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest,
return ctx; return ctx;
} }
static X509_STORE *create_cert_store(char *CApath, char *CAfile, X509_VERIFY_PARAM *vpm) static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
X509_VERIFY_PARAM *vpm)
{ {
X509_STORE *cert_ctx = NULL; X509_STORE *cert_ctx = NULL;
X509_LOOKUP *lookup = NULL; X509_LOOKUP *lookup = NULL;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <openssl/pem.h> #include <openssl/pem.h>
static int cb(int ok, X509_STORE_CTX *ctx); static int cb(int ok, X509_STORE_CTX *ctx);
static int check(X509_STORE *ctx, char *file, static int check(X509_STORE *ctx, const char *file,
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
STACK_OF(X509_CRL) *crls, int show_chain); STACK_OF(X509_CRL) *crls, int show_chain);
static int v_verbose = 0, vflags = 0; static int v_verbose = 0, vflags = 0;
...@@ -64,7 +64,7 @@ int verify_main(int argc, char **argv) ...@@ -64,7 +64,7 @@ int verify_main(int argc, char **argv)
STACK_OF(X509_CRL) *crls = NULL; STACK_OF(X509_CRL) *crls = NULL;
X509_STORE *store = NULL; X509_STORE *store = NULL;
X509_VERIFY_PARAM *vpm = NULL; X509_VERIFY_PARAM *vpm = NULL;
char *prog, *CApath = NULL, *CAfile = NULL; const char *prog, *CApath = NULL, *CAfile = NULL;
int noCApath = 0, noCAfile = 0; int noCApath = 0, noCAfile = 0;
int vpmtouched = 0, crl_download = 0, show_chain = 0, i = 0, ret = 1; int vpmtouched = 0, crl_download = 0, show_chain = 0, i = 0, ret = 1;
OPTION_CHOICE o; OPTION_CHOICE o;
...@@ -194,7 +194,7 @@ int verify_main(int argc, char **argv) ...@@ -194,7 +194,7 @@ int verify_main(int argc, char **argv)
return (ret < 0 ? 2 : ret); return (ret < 0 ? 2 : ret);
} }
static int check(X509_STORE *ctx, char *file, static int check(X509_STORE *ctx, const char *file,
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
STACK_OF(X509_CRL) *crls, int show_chain) STACK_OF(X509_CRL) *crls, int show_chain)
{ {
......
...@@ -33,12 +33,12 @@ ...@@ -33,12 +33,12 @@
static int callb(int ok, X509_STORE_CTX *ctx); static int callb(int ok, X509_STORE_CTX *ctx);
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext,
const EVP_MD *digest, CONF *conf, char *section); const EVP_MD *digest, CONF *conf, const char *section);
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, static int x509_certify(X509_STORE *ctx, const char *CAfile, const EVP_MD *digest,
X509 *x, X509 *xca, EVP_PKEY *pkey, X509 *x, X509 *xca, EVP_PKEY *pkey,
STACK_OF(OPENSSL_STRING) *sigopts, char *serial, STACK_OF(OPENSSL_STRING) *sigopts, const char *serialfile,
int create, int days, int clrext, CONF *conf, int create, int days, int clrext, CONF *conf,
char *section, ASN1_INTEGER *sno, int reqfile); const char *section, ASN1_INTEGER *sno, int reqfile);
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt); static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt);
typedef enum OPTION_choice { typedef enum OPTION_choice {
...@@ -893,7 +893,7 @@ int x509_main(int argc, char **argv) ...@@ -893,7 +893,7 @@ int x509_main(int argc, char **argv)
return (ret); return (ret);
} }
static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile, static ASN1_INTEGER *x509_load_serial(const char *CAfile, const char *serialfile,
int create) int create)
{ {
char *buf = NULL, *p; char *buf = NULL, *p;
...@@ -934,11 +934,11 @@ static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile, ...@@ -934,11 +934,11 @@ static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile,
return bs; return bs;
} }
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, static int x509_certify(X509_STORE *ctx, const char *CAfile, const EVP_MD *digest,
X509 *x, X509 *xca, EVP_PKEY *pkey, X509 *x, X509 *xca, EVP_PKEY *pkey,
STACK_OF(OPENSSL_STRING) *sigopts, STACK_OF(OPENSSL_STRING) *sigopts,
char *serialfile, int create, const char *serialfile, int create,
int days, int clrext, CONF *conf, char *section, int days, int clrext, CONF *conf, const char *section,
ASN1_INTEGER *sno, int reqfile) ASN1_INTEGER *sno, int reqfile)
{ {
int ret = 0; int ret = 0;
...@@ -1051,7 +1051,7 @@ static int callb(int ok, X509_STORE_CTX *ctx) ...@@ -1051,7 +1051,7 @@ static int callb(int ok, X509_STORE_CTX *ctx)
/* self sign */ /* self sign */
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext,
const EVP_MD *digest, CONF *conf, char *section) const EVP_MD *digest, CONF *conf, const char *section)
{ {
if (!X509_set_issuer_name(x, X509_get_subject_name(x))) if (!X509_set_issuer_name(x, X509_get_subject_name(x)))
......
...@@ -954,7 +954,7 @@ static int set_protocol_version(const char *version, SSL *ssl, int setting) ...@@ -954,7 +954,7 @@ static int set_protocol_version(const char *version, SSL *ssl, int setting)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
char *CApath = NULL, *CAfile = NULL; const char *CApath = NULL, *CAfile = NULL;
int badop = 0; int badop = 0;
enum { BIO_MEM, BIO_PAIR, BIO_IPV4, BIO_IPV6 } bio_type = BIO_MEM; enum { BIO_MEM, BIO_PAIR, BIO_IPV4, BIO_IPV6 } bio_type = BIO_MEM;
int force = 0; int force = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册