Commit c869da88 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Update from 1.0.0-stable

parent d8086604
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1488,7 +1488,7 @@ char *make_config_name()
	return p;
	}

static unsigned long index_serial_hash(const CSTRING *a)
static unsigned long index_serial_hash(const OPENSSL_CSTRING *a)
	{
	const char *n;

@@ -1497,7 +1497,7 @@ static unsigned long index_serial_hash(const CSTRING *a)
	return(lh_strhash(n));
	}

static int index_serial_cmp(const CSTRING *a, const CSTRING *b)
static int index_serial_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
	{
	const char *aa,*bb;

@@ -1509,16 +1509,16 @@ static int index_serial_cmp(const CSTRING *a, const CSTRING *b)
static int index_name_qual(char **a)
	{ return(a[0][0] == 'V'); }

static unsigned long index_name_hash(const CSTRING *a)
static unsigned long index_name_hash(const OPENSSL_CSTRING *a)
	{ return(lh_strhash(a[DB_name])); }

int index_name_cmp(const CSTRING *a, const CSTRING *b)
int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
	{ return(strcmp(a[DB_name], b[DB_name])); }

static IMPLEMENT_LHASH_HASH_FN(index_serial, CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_serial, CSTRING)
static IMPLEMENT_LHASH_HASH_FN(index_name, CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_name, CSTRING)
static IMPLEMENT_LHASH_HASH_FN(index_serial, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING)

#undef BSIZE
#define BSIZE 256
+3 −3
Original line number Diff line number Diff line
@@ -295,9 +295,9 @@ 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);
#define index_name_cmp_noconst(a, b) \
	index_name_cmp((const CSTRING *)CHECKED_PTR_OF(STRING, a), \
	(const CSTRING *)CHECKED_PTR_OF(STRING, b))
int index_name_cmp(const CSTRING *a, const CSTRING *b);
	index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
	(const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
int parse_yesno(const char *str, int def);

X509_NAME *parse_name(char *str, long chtype, int multirdn);
+8 −8
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ int MAIN(int argc, char **argv)
	unsigned char *tmpbuf;
	const unsigned char *ctmpbuf;
	BUF_MEM *buf=NULL;
	STACK_OF(STRING) *osk=NULL;
	STACK_OF(OPENSSL_STRING) *osk=NULL;
	ASN1_TYPE *at=NULL;

	informat=FORMAT_PEM;
@@ -113,7 +113,7 @@ int MAIN(int argc, char **argv)
	prog=argv[0];
	argc--;
	argv++;
	if ((osk=sk_STRING_new_null()) == NULL)
	if ((osk=sk_OPENSSL_STRING_new_null()) == NULL)
		{
		BIO_printf(bio_err,"Memory allocation failure\n");
		goto end;
@@ -169,7 +169,7 @@ int MAIN(int argc, char **argv)
		else if (strcmp(*argv,"-strparse") == 0)
			{
			if (--argc < 1) goto bad;
			sk_STRING_push(osk,*(++argv));
			sk_OPENSSL_STRING_push(osk,*(++argv));
			}
		else if (strcmp(*argv,"-genstr") == 0)
			{
@@ -302,18 +302,18 @@ bad:

	/* If any structs to parse go through in sequence */

	if (sk_STRING_num(osk))
	if (sk_OPENSSL_STRING_num(osk))
		{
		tmpbuf=(unsigned char *)str;
		tmplen=num;
		for (i=0; i<sk_STRING_num(osk); i++)
		for (i=0; i<sk_OPENSSL_STRING_num(osk); i++)
			{
			ASN1_TYPE *atmp;
			int typ;
			j=atoi(sk_STRING_value(osk,i));
			j=atoi(sk_OPENSSL_STRING_value(osk,i));
			if (j == 0)
				{
				BIO_printf(bio_err,"'%s' is an invalid number\n",sk_STRING_value(osk,i));
				BIO_printf(bio_err,"'%s' is an invalid number\n",sk_OPENSSL_STRING_value(osk,i));
				continue;
				}
			tmpbuf+=j;
@@ -378,7 +378,7 @@ end:
		ERR_print_errors(bio_err);
	if (buf != NULL) BUF_MEM_free(buf);
	if (at != NULL) ASN1_TYPE_free(at);
	if (osk != NULL) sk_STRING_free(osk);
	if (osk != NULL) sk_OPENSSL_STRING_free(osk);
	OBJ_cleanup();
	apps_shutdown();
	OPENSSL_EXIT(ret);
+11 −11
Original line number Diff line number Diff line
@@ -883,9 +883,9 @@ bad:
	if (db == NULL) goto err;

	/* Lets check some fields */
	for (i=0; i<sk_PSTRING_num(db->db->data); i++)
	for (i=0; i<sk_OPENSSL_PSTRING_num(db->db->data); i++)
		{
		pp=sk_PSTRING_value(db->db->data,i);
		pp=sk_OPENSSL_PSTRING_value(db->db->data,i);
		if ((pp[DB_type][0] != DB_TYPE_REV) &&
			(pp[DB_rev_date][0] != '\0'))
			{
@@ -938,7 +938,7 @@ bad:
#endif
		TXT_DB_write(out,db->db);
		BIO_printf(bio_err,"%d entries loaded from the database\n",
			   sk_PSTRING_num(db->db->data));
			   sk_OPENSSL_PSTRING_num(db->db->data));
		BIO_printf(bio_err,"generating index\n");
		}
	
@@ -1408,9 +1408,9 @@ bad:

		ASN1_TIME_free(tmptm);

		for (i=0; i<sk_PSTRING_num(db->db->data); i++)
		for (i=0; i<sk_OPENSSL_PSTRING_num(db->db->data); i++)
			{
			pp=sk_PSTRING_value(db->db->data,i);
			pp=sk_OPENSSL_PSTRING_value(db->db->data,i);
			if (pp[DB_type][0] == DB_TYPE_REV)
				{
				if ((r=X509_REVOKED_new()) == NULL) goto err;
@@ -1685,9 +1685,9 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
	int ok= -1,i,j,last,nid;
	const char *p;
	CONF_VALUE *cv;
	STRING row[DB_NUMBER];
	STRING *irow=NULL;
	STRING *rrow=NULL;
	OPENSSL_STRING row[DB_NUMBER];
	OPENSSL_STRING *irow=NULL;
	OPENSSL_STRING *rrow=NULL;
	char buf[25];

	tmptm=ASN1_UTCTIME_new();
@@ -1929,7 +1929,7 @@ again2:

	if (db->attributes.unique_subject)
		{
		STRING *crow=row;
		OPENSSL_STRING *crow=row;

		rrow=TXT_DB_get_by_index(db->db,DB_name,crow);
		if (rrow != NULL)
@@ -2632,9 +2632,9 @@ static int do_updatedb (CA_DB *db)
	else
		a_y2k = 0;

	for (i = 0; i < sk_PSTRING_num(db->db->data); i++)
	for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
		{
		rrow = sk_PSTRING_value(db->db->data, i);
		rrow = sk_OPENSSL_PSTRING_value(db->db->data, i);

		if (rrow[DB_type][0] == 'V')
		 	{
+32 −32
Original line number Diff line number Diff line
@@ -71,9 +71,9 @@
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
static int cms_cb(int ok, X509_STORE_CTX *ctx);
static void receipt_request_print(BIO *out, CMS_ContentInfo *cms);
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to,
						int rr_allorfirst,
						STACK_OF(STRING) *rr_from);
					STACK_OF(OPENSSL_STRING) *rr_from);

#define SMIME_OP	0x10
#define SMIME_IP	0x20
@@ -108,7 +108,7 @@ int MAIN(int argc, char **argv)
	const char *inmode = "r", *outmode = "w";
	char *infile = NULL, *outfile = NULL, *rctfile = NULL;
	char *signerfile = NULL, *recipfile = NULL;
	STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL;
	STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL;
	char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
	char *certsoutfile = NULL;
	const EVP_CIPHER *cipher = NULL;
@@ -122,7 +122,7 @@ int MAIN(int argc, char **argv)
	int flags = CMS_DETACHED, noout = 0, print = 0;
	int verify_retcode = 0;
	int rr_print = 0, rr_allorfirst = -1;
	STACK_OF(STRING) *rr_to = NULL, *rr_from = NULL;
	STACK_OF(OPENSSL_STRING) *rr_to = NULL, *rr_from = NULL;
	CMS_ReceiptRequest *rr = NULL;
	char *to = NULL, *from = NULL, *subject = NULL;
	char *CAfile = NULL, *CApath = NULL;
@@ -281,8 +281,8 @@ int MAIN(int argc, char **argv)
				goto argerr;
			args++;
			if (!rr_from)
				rr_from = sk_STRING_new_null();
			sk_STRING_push(rr_from, *args);
				rr_from = sk_OPENSSL_STRING_new_null();
			sk_OPENSSL_STRING_push(rr_from, *args);
			}
		else if (!strcmp(*args,"-receipt_request_to"))
			{
@@ -290,8 +290,8 @@ int MAIN(int argc, char **argv)
				goto argerr;
			args++;
			if (!rr_to)
				rr_to = sk_STRING_new_null();
			sk_STRING_push(rr_to, *args);
				rr_to = sk_OPENSSL_STRING_new_null();
			sk_OPENSSL_STRING_push(rr_to, *args);
			}
		else if (!strcmp (*args, "-print"))
				{
@@ -387,13 +387,13 @@ int MAIN(int argc, char **argv)
			if (signerfile)
				{
				if (!sksigners)
					sksigners = sk_STRING_new_null();
				sk_STRING_push(sksigners, signerfile);
					sksigners = sk_OPENSSL_STRING_new_null();
				sk_OPENSSL_STRING_push(sksigners, signerfile);
				if (!keyfile)
					keyfile = signerfile;
				if (!skkeys)
					skkeys = sk_STRING_new_null();
				sk_STRING_push(skkeys, keyfile);
					skkeys = sk_OPENSSL_STRING_new_null();
				sk_OPENSSL_STRING_push(skkeys, keyfile);
				keyfile = NULL;
				}
			signerfile = *++args;
@@ -435,12 +435,12 @@ int MAIN(int argc, char **argv)
					goto argerr;
					}
				if (!sksigners)
					sksigners = sk_STRING_new_null();
				sk_STRING_push(sksigners, signerfile);
					sksigners = sk_OPENSSL_STRING_new_null();
				sk_OPENSSL_STRING_push(sksigners, signerfile);
				signerfile = NULL;
				if (!skkeys)
					skkeys = sk_STRING_new_null();
				sk_STRING_push(skkeys, keyfile);
					skkeys = sk_OPENSSL_STRING_new_null();
				sk_OPENSSL_STRING_push(skkeys, keyfile);
				}
			keyfile = *++args;
			}
@@ -539,13 +539,13 @@ int MAIN(int argc, char **argv)
		if (signerfile)
			{
			if (!sksigners)
				sksigners = sk_STRING_new_null();
			sk_STRING_push(sksigners, signerfile);
				sksigners = sk_OPENSSL_STRING_new_null();
			sk_OPENSSL_STRING_push(sksigners, signerfile);
			if (!skkeys)
				skkeys = sk_STRING_new_null();
				skkeys = sk_OPENSSL_STRING_new_null();
			if (!keyfile)
				keyfile = signerfile;
			sk_STRING_push(skkeys, keyfile);
			sk_OPENSSL_STRING_push(skkeys, keyfile);
			}
		if (!sksigners)
			{
@@ -980,11 +980,11 @@ int MAIN(int argc, char **argv)
			}
		else
			flags |= CMS_REUSE_DIGEST;
		for (i = 0; i < sk_STRING_num(sksigners); i++)
		for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++)
			{
			CMS_SignerInfo *si;
			signerfile = sk_STRING_value(sksigners, i);
			keyfile = sk_STRING_value(skkeys, i);
			signerfile = sk_OPENSSL_STRING_value(sksigners, i);
			keyfile = sk_OPENSSL_STRING_value(skkeys, i);
			signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
					e, "signer certificate");
			if (!signer)
@@ -1160,9 +1160,9 @@ end:
	if (vpm)
		X509_VERIFY_PARAM_free(vpm);
	if (sksigners)
		sk_STRING_free(sksigners);
		sk_OPENSSL_STRING_free(sksigners);
	if (skkeys)
		sk_STRING_free(skkeys);
		sk_OPENSSL_STRING_free(skkeys);
	if (secret_key)
		OPENSSL_free(secret_key);
	if (secret_keyid)
@@ -1172,9 +1172,9 @@ end:
	if (rr)
		CMS_ReceiptRequest_free(rr);
	if (rr_to)
		sk_STRING_free(rr_to);
		sk_OPENSSL_STRING_free(rr_to);
	if (rr_from)
		sk_STRING_free(rr_from);
		sk_OPENSSL_STRING_free(rr_from);
	X509_STORE_free(store);
	X509_free(cert);
	X509_free(recip);
@@ -1296,7 +1296,7 @@ static void receipt_request_print(BIO *out, CMS_ContentInfo *cms)
		}
	}

static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(OPENSSL_STRING) *ns)
	{
	int i;
	STACK_OF(GENERAL_NAMES) *ret;
@@ -1305,9 +1305,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
	ret = sk_GENERAL_NAMES_new_null();
	if (!ret)
		goto err;
	for (i = 0; i < sk_STRING_num(ns); i++)
	for (i = 0; i < sk_OPENSSL_STRING_num(ns); i++)
		{
		char *str = sk_STRING_value(ns, i);
		char *str = sk_OPENSSL_STRING_value(ns, i);
		gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0);
		if (!gen)
			goto err;
@@ -1335,9 +1335,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
	}


static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to,
						int rr_allorfirst,
						STACK_OF(STRING) *rr_from)
						STACK_OF(OPENSSL_STRING) *rr_from)
	{
	STACK_OF(GENERAL_NAMES) *rct_to, *rct_from;
	CMS_ReceiptRequest *rr;
Loading