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

Add support for GeneralName and GeneralNames extensions. Also preliminary

support for subject and issuer alt name. Add a new ASN1 macro and fix a
nasty bug that left an ASN1 buffer modified on an error condition with
IMPLICIT tagging.
parent ebbfd76c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@
#define ASN1_F_D2I_DSAPARAMS				 137
#define ASN1_F_D2I_DSAPRIVATEKEY			 138
#define ASN1_F_D2I_DSAPUBLICKEY				 139
#define ASN1_F_D2I_GENERAL_NAME				 230
#define ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE		 228
#define ASN1_F_D2I_NETSCAPE_PKEY			 140
#define ASN1_F_D2I_NETSCAPE_RSA				 141
@@ -83,6 +84,7 @@
#define ASN1_F_D2I_X509_REVOKED				 173
#define ASN1_F_D2I_X509_SIG				 174
#define ASN1_F_D2I_X509_VAL				 175
#define ASN1_F_GENERAL_NAME_NEW				 231
#define ASN1_F_I2D_ASN1_HEADER				 176
#define ASN1_F_I2D_ASN1_TIME				 225
#define ASN1_F_I2D_DHPARAMS				 177
+2 −0
Original line number Diff line number Diff line
@@ -700,6 +700,7 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_F_D2I_DSAPARAMS				 137
#define ASN1_F_D2I_DSAPRIVATEKEY			 138
#define ASN1_F_D2I_DSAPUBLICKEY				 139
#define ASN1_F_D2I_GENERAL_NAME				 230
#define ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE		 228
#define ASN1_F_D2I_NETSCAPE_PKEY			 140
#define ASN1_F_D2I_NETSCAPE_RSA				 141
@@ -737,6 +738,7 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_F_D2I_X509_REVOKED				 173
#define ASN1_F_D2I_X509_SIG				 174
#define ASN1_F_D2I_X509_VAL				 175
#define ASN1_F_GENERAL_NAME_NEW				 231
#define ASN1_F_I2D_ASN1_HEADER				 176
#define ASN1_F_I2D_ASN1_TIME				 225
#define ASN1_F_I2D_DHPARAMS				 177
+2 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_D2I_DSAPARAMS,0),	"D2I_DSAPARAMS"},
{ERR_PACK(0,ASN1_F_D2I_DSAPRIVATEKEY,0),	"D2I_DSAPRIVATEKEY"},
{ERR_PACK(0,ASN1_F_D2I_DSAPUBLICKEY,0),	"D2I_DSAPUBLICKEY"},
{ERR_PACK(0,ASN1_F_D2I_GENERAL_NAME,0),	"D2I_GENERAL_NAME"},
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE,0),	"D2I_NETSCAPE_CERT_SEQUENCE"},
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_PKEY,0),	"D2I_NETSCAPE_PKEY"},
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA,0),	"D2I_NETSCAPE_RSA"},
@@ -145,6 +146,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_D2I_X509_REVOKED,0),	"D2I_X509_REVOKED"},
{ERR_PACK(0,ASN1_F_D2I_X509_SIG,0),	"D2I_X509_SIG"},
{ERR_PACK(0,ASN1_F_D2I_X509_VAL,0),	"D2I_X509_VAL"},
{ERR_PACK(0,ASN1_F_GENERAL_NAME_NEW,0),	"GENERAL_NAME_NEW"},
{ERR_PACK(0,ASN1_F_I2D_ASN1_HEADER,0),	"i2d_ASN1_HEADER"},
{ERR_PACK(0,ASN1_F_I2D_ASN1_TIME,0),	"i2d_ASN1_TIME"},
{ERR_PACK(0,ASN1_F_I2D_DHPARAMS,0),	"I2D_DHPARAMS"},
+10 −5
Original line number Diff line number Diff line
@@ -134,15 +134,20 @@ err:\
		M_ASN1_D2I_get(b,func); \
		}

#define M_ASN1_D2I_get_imp(b,func, type) \
	M_ASN1_next=(_tmp& ~V_ASN1_PRIMATIVE_TAG)|type; \
	c.q=c.p; \
	if (func(&(b),&c.p,c.slen) == NULL) \
		{c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \
	c.slen-=(c.p-c.q);\
	M_ASN1_next_prev=_tmp;

#define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \
	if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \
		(V_ASN1_CONTEXT_SPECIFIC|(tag)))) \
		{ \
		unsigned char tmp; \
		tmp=M_ASN1_next; \
		M_ASN1_next=(tmp& ~V_ASN1_PRIMATIVE_TAG)|type; \
		M_ASN1_D2I_get(b,func); \
		M_ASN1_next_prev=tmp; \
		unsigned char _tmp = M_ASN1_next; \
		M_ASN1_D2I_get_imp(b,func, type);\
		}

#define M_ASN1_D2I_get_set(r,func,free_func) \
+2 −2
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@ APPS=

LIB=$(TOP)/libcrypto.a
LIBSRC=	v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c \
v3_lib.c v3_prn.c v3_utl.c v3err.c 
v3_lib.c v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c
LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \
v3_prn.o v3_utl.o v3err.o
v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o

SRC= $(LIBSRC)

Loading