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

Add support for VISIBLESTRING and UTF8String

parent cfdcfede
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@

 Changes between 0.9.2b and 0.9.3

  *) Add support for ASN1 types UTF8String and VISIBLESTRING.
     [Steve Henson]

  *) Add code to allow r2i extensions to access the configuration database,
     add an LHASH database driver and add several ctx helper functions.
     [Steve Henson]
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC=	a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
	a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c \
	a_enum.c a_sign.c a_digest.c a_verify.c \
	a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c \
	x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c \
	x_name.c x_cinf.c x_x509.c x_crl.c x_info.c x_spki.c nsseq.c \
	d2i_r_pr.c i2d_r_pr.c d2i_r_pu.c i2d_r_pu.c \
@@ -39,7 +39,7 @@ LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
	evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c
LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \
	a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o \
	a_enum.o a_sign.o a_digest.o a_verify.o \
	a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o \
	x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o \
	x_name.o x_cinf.o x_x509.o x_crl.o x_info.o x_spki.o nsseq.o \
	d2i_r_pr.o i2d_r_pr.o d2i_r_pu.o i2d_r_pu.o \
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@
#include "cryptlib.h"
#include "asn1.h"

/* ASN1err(ASN1_F_D2I_ASN1_INTEGER,ASN1_R_EXPECTING_AN_INTEGER);
/* ASN1err(ASN1_F_D2I_ASN1_BMPSTRING,ASN1_R_EXPECTING_AN_INTEGER);
 */

int i2d_ASN1_BMPSTRING(a, pp)
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ static unsigned long tag2bit[32]={
0,	0,	0,	B_ASN1_BIT_STRING,	/* tags  0 -  3 */
B_ASN1_OCTET_STRING,	0,	0,		B_ASN1_UNKNOWN,/* tags  4- 7 */
B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,/* tags  8-11 */
B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,/* tags 12-15 */
B_ASN1_UTF8STRING,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,/* tags 12-15 */
0,	0,	B_ASN1_NUMERICSTRING,B_ASN1_PRINTABLESTRING,
B_ASN1_T61STRING,B_ASN1_VIDEOTEXSTRING,B_ASN1_IA5STRING,0,
0,B_ASN1_GRAPHICSTRING,B_ASN1_ISO64STRING,B_ASN1_GENERALSTRING,
@@ -81,7 +81,7 @@ static int asn1_collate_primative(ASN1_STRING *a, ASN1_CTX *c);
static int asn1_collate_primative();
#endif

/* type is a 'bitmap' of acceptable string types to be accepted.
/* type is a 'bitmap' of acceptable string types.
 */
ASN1_STRING *d2i_ASN1_type_bytes(a, pp, length, type)
ASN1_STRING **a;
+17 −0
Original line number Diff line number Diff line
@@ -117,6 +117,12 @@ unsigned char **pp;
	case V_ASN1_UNIVERSALSTRING:
		r=M_i2d_ASN1_UNIVERSALSTRING(a->value.universalstring,pp);
		break;
	case V_ASN1_UTF8STRING:
		r=M_i2d_ASN1_UTF8STRING(a->value.utf8string,pp);
		break;
	case V_ASN1_VISIBLESTRING:
		r=M_i2d_ASN1_VISIBLESTRING(a->value.visiblestring,pp);
		break;
	case V_ASN1_BMPSTRING:
		r=M_i2d_ASN1_BMPSTRING(a->value.bmpstring,pp);
		break;
@@ -196,6 +202,16 @@ long length;
			d2i_ASN1_OCTET_STRING(NULL,&p,max-p)) == NULL)
			goto err;
		break;
	case V_ASN1_VISIBLESTRING:
		if ((ret->value.visiblestring=
			d2i_ASN1_VISIBLESTRING(NULL,&p,max-p)) == NULL)
			goto err;
		break;
	case V_ASN1_UTF8STRING:
		if ((ret->value.utf8string=
			d2i_ASN1_UTF8STRING(NULL,&p,max-p)) == NULL)
			goto err;
		break;
	case V_ASN1_OBJECT:
		if ((ret->value.object=
			d2i_ASN1_OBJECT(NULL,&p,max-p)) == NULL)
@@ -336,6 +352,7 @@ ASN1_TYPE *a;
		case V_ASN1_GENERALSTRING:
		case V_ASN1_UNIVERSALSTRING:
		case V_ASN1_BMPSTRING:
		case V_ASN1_UTF8STRING:
			ASN1_STRING_free((ASN1_STRING *)a->value.ptr);
			break;
		default:
Loading