Commit 7d727231 authored by Nils Larsch's avatar Nils Larsch
Browse files

some const fixes

parent 69740c2b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@
#undef NON_MAIN

typedef struct {
	char *name;
	const char *name;
	unsigned long flag;
	unsigned long mask;
} NAME_EX_TBL;
@@ -1269,7 +1269,7 @@ static int set_table_opts(unsigned long *flags, const char *arg, const NAME_EX_T
	return 0;
}

void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags)
{
	char *buf;
	char mline = 0;
@@ -1774,7 +1774,7 @@ int index_index(CA_DB *db)
	return 1;
	}

int save_index(char *dbfile, char *suffix, CA_DB *db)
int save_index(const char *dbfile, const char *suffix, CA_DB *db)
	{
	char buf[3][BSIZE];
	BIO *out = BIO_new(BIO_s_file());
@@ -1841,7 +1841,7 @@ int save_index(char *dbfile, char *suffix, CA_DB *db)
	return 0;
	}

int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix)
	{
	char buf[5][BSIZE];
	int i,j;
@@ -2281,7 +2281,8 @@ int args_verify(char ***pargs, int *pargc,

	}

static void nodes_print(BIO *out, char *name, STACK_OF(X509_POLICY_NODE) *nodes)
static void nodes_print(BIO *out, const char *name,
	STACK_OF(X509_POLICY_NODE) *nodes)
	{
	X509_POLICY_NODE *node;
	int i;
+4 −4
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ void program_name(char *in,char *out,int size);
int chopup_args(ARGS *arg,char *buf, int *argc, char **argv[]);
#ifdef HEADER_X509_H
int dump_cert_text(BIO *out, X509 *x);
void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags);
void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags);
#endif
int set_cert_ex(unsigned long *flags, const char *arg);
int set_name_ex(unsigned long *flags, const char *arg);
@@ -280,7 +280,7 @@ char *make_config_name(void);

/* Functions defined in ca.c and also used in ocsp.c */
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
			ASN1_GENERALIZEDTIME **pinvtm, char *str);
			ASN1_GENERALIZEDTIME **pinvtm, const char *str);

#define DB_type         0
#define DB_exp_date     1
@@ -310,8 +310,8 @@ int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
int index_index(CA_DB *db);
int save_index(char *dbfile, char *suffix, CA_DB *db);
int rotate_index(char *dbfile, char *new_suffix, char *old_suffix);
int save_index(const char *dbfile, const char *suffix, CA_DB *db);
int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix);
void free_index(CA_DB *db);
int index_name_cmp(const char **a, const char **b);
int parse_yesno(char *str, int def);
+13 −11
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@
#define REV_KEY_COMPROMISE	3	/* Value is cert key compromise time */
#define REV_CA_COMPROMISE	4	/* Value is CA key compromise time */

static char *ca_usage[]={
static const char *ca_usage[]={
"usage: ca args\n",
"\n",
" -verbose        - Talk alot while doing things\n",
@@ -192,7 +192,7 @@ extern int EF_PROTECT_BELOW;
extern int EF_ALIGNMENT;
#endif

static void lookup_fail(char *name,char *tag);
static void lookup_fail(const char *name, const char *tag);
static int certify(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
		   const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy,CA_DB *db,
		   BIGNUM *serial, char *subj, int multirdn, int email_dn, char *startdate,
@@ -225,7 +225,7 @@ static int get_certificate_status(const char *ser_status, CA_DB *db);
static int do_updatedb(CA_DB *db);
static int check_time_format(char *str);
char *make_revocation_str(int rev_type, char *rev_arg);
int make_revoked(X509_REVOKED *rev, char *str);
int make_revoked(X509_REVOKED *rev, const char *str);
int old_entry_print(BIO *bp, ASN1_OBJECT *obj, ASN1_STRING *str);
static CONF *conf=NULL;
static CONF *extconf=NULL;
@@ -300,7 +300,8 @@ int MAIN(int argc, char **argv)
	X509_REVOKED *r=NULL;
	ASN1_TIME *tmptm;
	ASN1_INTEGER *tmpser;
	char **pp,*p,*f;
	char *p,*f;
	const char **pp;
	int i,j;
	const EVP_MD *dgst=NULL;
	STACK_OF(CONF_VALUE) *attribs=NULL;
@@ -857,7 +858,7 @@ bad:
	/* Lets check some fields */
	for (i=0; i<sk_num(db->db->data); i++)
		{
		pp=(char **)sk_value(db->db->data,i);
		pp=(const char **)sk_value(db->db->data,i);
		if ((pp[DB_type][0] != DB_TYPE_REV) &&
			(pp[DB_rev_date][0] != '\0'))
			{
@@ -1501,7 +1502,7 @@ err:
	OPENSSL_EXIT(ret);
	}

static void lookup_fail(char *name, char *tag)
static void lookup_fail(const char *name, const char *tag)
	{
	BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag);
	}
@@ -1646,7 +1647,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
	X509_NAME_ENTRY *tne,*push;
	EVP_PKEY *pktmp;
	int ok= -1,i,j,last,nid;
	char *p;
	const char *p;
	CONF_VALUE *cv;
	char *row[DB_NUMBER],**rrow=NULL,**irow=NULL;
	char buf[25];
@@ -2654,7 +2655,7 @@ err:
	return (cnt);
	}

static char *crl_reasons[] = {
static const char *crl_reasons[] = {
	/* CRL reason strings */
	"unspecified",
	"keyCompromise",
@@ -2682,7 +2683,8 @@ static char *crl_reasons[] = {

char *make_revocation_str(int rev_type, char *rev_arg)
	{
	char *reason = NULL, *other = NULL, *str;
	char *other = NULL, *str;
	const char *reason = NULL;
	ASN1_OBJECT *otmp;
	ASN1_UTCTIME *revtm = NULL;
	int i;
@@ -2776,7 +2778,7 @@ char *make_revocation_str(int rev_type, char *rev_arg)
 */


int make_revoked(X509_REVOKED *rev, char *str)
int make_revoked(X509_REVOKED *rev, const char *str)
	{
	char *tmp = NULL;
	int reason_code = -1;
@@ -2869,7 +2871,7 @@ int old_entry_print(BIO *bp, ASN1_OBJECT *obj, ASN1_STRING *str)
	return 1;
	}

int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, const char *str)
	{
	char *tmp = NULL;
	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
+2 −2
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@
#undef PROG
#define PROG	ciphers_main

static char *ciphers_usage[]={
static const char *ciphers_usage[]={
"usage: ciphers args\n",
" -v          - verbose mode, a textual listing of the ciphers in SSLeay\n",
" -ssl2       - SSL2 mode\n",
@@ -84,7 +84,7 @@ int MAIN(int argc, char **argv)
	{
	int ret=1,i;
	int verbose=0;
	char **pp;
	const char **pp;
	const char *p;
	int badops=0;
	SSL_CTX *ctx=NULL;
+2 −2
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@
#undef POSTFIX
#define	POSTFIX	".rvk"

static char *crl_usage[]={
static const char *crl_usage[]={
"usage: crl args\n",
"\n",
" -inform arg     - input format - default PEM (DER or PEM)\n",
@@ -108,7 +108,7 @@ int MAIN(int argc, char **argv)
	char *infile=NULL,*outfile=NULL;
	int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
	int fingerprint = 0;
	char **pp;
	const char **pp;
	X509_STORE *store = NULL;
	X509_STORE_CTX ctx;
	X509_LOOKUP *lookup = NULL;
Loading