Commit 5ce278a7 authored by Ben Laurie's avatar Ben Laurie
Browse files

More type-checking.

parent 37cf49a3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4,6 +4,14 @@

 Changes between 0.9.8g and 0.9.9  [xx XXX xxxx]

  *) Removed effectively defunct crypto/store from the build.
     [Ben Laurie]

  *) Revamp of STACK to provide stronger type-checking. Still to come:
     TXT_DB, bsearch(?), OBJ_bsearch, qsort, CRYPTO_EX_DATA, ASN1_VALUE,
     ASN1_STRING, CONF_VALUE.
     [Ben Laurie]

  *) Add a new SSL_MODE_RELEASE_BUFFERS mode flag to release unused buffer
     RAM on SSL connections.  This option can save about 34k per idle SSL.
     [Nick Mathewson]
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ SDIRS= \
	bn ec rsa dsa ecdsa dh ecdh dso engine \
	buffer bio stack lhash rand err \
	evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
	store cms pqueue ts 
	cms pqueue ts 
# keep in mind that the above list is adjusted by ./Configure
# according to no-xxx arguments...

+20 −21
Original line number Diff line number Diff line
@@ -362,10 +362,10 @@ dsaparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h
dsaparam.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
dsaparam.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
dsaparam.o: ../include/openssl/sha.h ../include/openssl/stack.h
dsaparam.o: ../include/openssl/store.h ../include/openssl/symhacks.h
dsaparam.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
dsaparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
dsaparam.o: ../include/openssl/x509v3.h apps.h dsaparam.c
dsaparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
dsaparam.o: ../include/openssl/ui.h ../include/openssl/x509.h
dsaparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
dsaparam.o: dsaparam.c
ec.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
ec.o: ../include/openssl/buffer.h ../include/openssl/conf.h
ec.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
@@ -470,10 +470,10 @@ gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h
gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
gendh.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
gendh.o: ../include/openssl/sha.h ../include/openssl/stack.h
gendh.o: ../include/openssl/store.h ../include/openssl/symhacks.h
gendh.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
gendh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
gendh.o: ../include/openssl/x509v3.h apps.h gendh.c
gendh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
gendh.o: ../include/openssl/ui.h ../include/openssl/x509.h
gendh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
gendh.o: gendh.c
gendsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
gendsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
@@ -522,10 +522,10 @@ genrsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
genrsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
genrsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
genrsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
genrsa.o: ../include/openssl/store.h ../include/openssl/symhacks.h
genrsa.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
genrsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
genrsa.o: ../include/openssl/x509v3.h apps.h genrsa.c
genrsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
genrsa.o: ../include/openssl/ui.h ../include/openssl/x509.h
genrsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
genrsa.o: genrsa.c
nseq.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
nseq.o: ../include/openssl/buffer.h ../include/openssl/conf.h
nseq.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
@@ -741,10 +741,9 @@ req.o: ../include/openssl/pem.h ../include/openssl/pem2.h
req.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
req.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
req.o: ../include/openssl/sha.h ../include/openssl/stack.h
req.o: ../include/openssl/store.h ../include/openssl/symhacks.h
req.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
req.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
req.o: ../include/openssl/x509v3.h apps.h req.c
req.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
req.o: ../include/openssl/ui.h ../include/openssl/x509.h
req.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h req.c
rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
rsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
rsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
@@ -839,11 +838,11 @@ s_server.o: ../include/openssl/rand.h ../include/openssl/rsa.h
s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h
s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
s_server.o: ../include/openssl/stack.h ../include/openssl/store.h
s_server.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
s_server.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
s_server.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
s_server.o: ../include/openssl/x509v3.h apps.h s_apps.h s_server.c timeouts.h
s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
s_server.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
s_server.o: ../include/openssl/ui.h ../include/openssl/x509.h
s_server.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
s_server.o: s_apps.h s_server.c timeouts.h
s_socket.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
s_socket.o: ../include/openssl/buffer.h ../include/openssl/comp.h
s_socket.o: ../include/openssl/conf.h ../include/openssl/crypto.h
+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 *osk=NULL;
	STACK_OF(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_new_null()) == NULL)
	if ((osk=sk_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_push(osk,*(++argv));
			sk_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_num(osk))
	if (sk_STRING_num(osk))
		{
		tmpbuf=(unsigned char *)str;
		tmplen=num;
		for (i=0; i<sk_num(osk); i++)
		for (i=0; i<sk_STRING_num(osk); i++)
			{
			ASN1_TYPE *atmp;
			int typ;
			j=atoi(sk_value(osk,i));
			j=atoi(sk_STRING_value(osk,i));
			if (j == 0)
				{
				BIO_printf(bio_err,"'%s' is an invalid number\n",sk_value(osk,i));
				BIO_printf(bio_err,"'%s' is an invalid number\n",sk_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_free(osk);
	if (osk != NULL) sk_STRING_free(osk);
	OBJ_cleanup();
	apps_shutdown();
	OPENSSL_EXIT(ret);
+13 −10
Original line number Diff line number Diff line
@@ -306,7 +306,8 @@ int MAIN(int argc, char **argv)
	ASN1_TIME *tmptm;
	ASN1_INTEGER *tmpser;
	char *f;
	const char *p, **pp;
	const char *p;
	char * const *pp;
	int i,j;
	const EVP_MD *dgst=NULL;
	STACK_OF(CONF_VALUE) *attribs=NULL;
@@ -555,8 +556,10 @@ bad:

	if (badops)
		{
		for (pp=ca_usage; (*pp != NULL); pp++)
			BIO_printf(bio_err,"%s",*pp);
		const char **pp2;

		for (pp2=ca_usage; (*pp2 != NULL); pp2++)
			BIO_printf(bio_err,"%s",*pp2);
		goto err;
		}

@@ -876,9 +879,9 @@ bad:
	if (db == NULL) goto err;

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

		ASN1_TIME_free(tmptm);

		for (i=0; i<sk_num(db->db->data); i++)
		for (i=0; i<sk_PSTRING_num(db->db->data); i++)
			{
			pp=(const char **)sk_value(db->db->data,i);
			pp=sk_PSTRING_value(db->db->data,i);
			if (pp[DB_type][0] == DB_TYPE_REV)
				{
				if ((r=X509_REVOKED_new()) == NULL) goto err;
@@ -2630,9 +2633,9 @@ static int do_updatedb (CA_DB *db)
	else
		a_y2k = 0;

	for (i = 0; i < sk_num(db->db->data); i++)
	for (i = 0; i < sk_PSTRING_num(db->db->data); i++)
		{
		rrow = (char **) sk_value(db->db->data, i);
		rrow = sk_PSTRING_value(db->db->data, i);

		if (rrow[DB_type][0] == 'V')
		 	{
Loading