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

Further PKCS#12 integration, PBE, PKCS#8 additions.

parent 4b518c26
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -5,9 +5,14 @@

 Changes between 0.9.2b and 0.9.3

  *) Further PKCS#12 integration. Added password based encryption, PKCS#8 and
     packing functions to asn1 and evp. Changed function names and error
     codes along the way.
     [Steve Henson]

  *) PKCS12 integration: and so it begins... First of several patches to
     slowly integrate PKCS#12 functionality into OpenSSL. Add PKCS#12
     objects to object.h
     objects to objects.h
     [Steve Henson]

  *) Add a new 'indent' option to some X509V3 extension code. Initial ASN1
+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
	f_int.c f_string.c i2d_dhp.c i2d_dsap.c d2i_dhp.c d2i_dsap.c n_pkey.c \
	f_enum.c a_hdr.c x_pkey.c a_bool.c x_exten.c \
	asn1_par.c asn1_lib.c $(ERRC).c a_meth.c a_bytes.c \
	evp_asn1.c
	evp_asn1.c asn_pack.c p5_pbe.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 \
@@ -51,7 +51,7 @@ LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \
	f_int.o f_string.o i2d_dhp.o i2d_dsap.o d2i_dhp.o d2i_dsap.o n_pkey.o \
	f_enum.o a_hdr.o x_pkey.o a_bool.o x_exten.o \
	asn1_par.o asn1_lib.o $(ERRC).o a_meth.o a_bytes.o \
	evp_asn1.o
	evp_asn1.o asn_pack.o p5_pbe.o p8_pkey.o

SRC= $(LIBSRC)

+11 −0
Original line number Diff line number Diff line
@@ -19,12 +19,16 @@
#define ASN1_F_ASN1_INTEGER_SET				 111
#define ASN1_F_ASN1_INTEGER_TO_BN			 112
#define ASN1_F_ASN1_OBJECT_NEW				 113
#define ASN1_F_ASN1_PACK_STRING				 245
#define ASN1_F_ASN1_SEQ_PACK				 246
#define ASN1_F_ASN1_SEQ_UNPACK				 247
#define ASN1_F_ASN1_SIGN				 114
#define ASN1_F_ASN1_STRING_NEW				 115
#define ASN1_F_ASN1_STRING_TYPE_NEW			 116
#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING		 117
#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING		 118
#define ASN1_F_ASN1_TYPE_NEW				 119
#define ASN1_F_ASN1_UNPACK_STRING			 248
#define ASN1_F_ASN1_UTCTIME_NEW				 120
#define ASN1_F_ASN1_VERIFY				 121
#define ASN1_F_AUTHORITY_KEYID_NEW			 237
@@ -60,6 +64,7 @@
#define ASN1_F_D2I_NETSCAPE_RSA_2			 142
#define ASN1_F_D2I_NETSCAPE_SPKAC			 143
#define ASN1_F_D2I_NETSCAPE_SPKI			 144
#define ASN1_F_D2I_PBEPARAM				 249
#define ASN1_F_D2I_PKCS7				 145
#define ASN1_F_D2I_PKCS7_DIGEST				 146
#define ASN1_F_D2I_PKCS7_ENCRYPT			 147
@@ -70,6 +75,7 @@
#define ASN1_F_D2I_PKCS7_SIGNED				 152
#define ASN1_F_D2I_PKCS7_SIGNER_INFO			 153
#define ASN1_F_D2I_PKCS7_SIGN_ENVELOPE			 154
#define ASN1_F_D2I_PKCS8_PRIV_KEY_INFO			 250
#define ASN1_F_D2I_PKEY_USAGE_PERIOD			 239
#define ASN1_F_D2I_PRIVATEKEY				 155
#define ASN1_F_D2I_PUBLICKEY				 156
@@ -113,6 +119,7 @@
#define ASN1_F_NETSCAPE_PKEY_NEW			 189
#define ASN1_F_NETSCAPE_SPKAC_NEW			 190
#define ASN1_F_NETSCAPE_SPKI_NEW			 191
#define ASN1_F_PBEPARAM_NEW				 251
#define ASN1_F_PKCS7_DIGEST_NEW				 192
#define ASN1_F_PKCS7_ENCRYPT_NEW			 193
#define ASN1_F_PKCS7_ENC_CONTENT_NEW			 194
@@ -123,6 +130,7 @@
#define ASN1_F_PKCS7_SIGNED_NEW				 199
#define ASN1_F_PKCS7_SIGNER_INFO_NEW			 200
#define ASN1_F_PKCS7_SIGN_ENVELOPE_NEW			 201
#define ASN1_F_PKCS8_PRIV_KEY_INFO_NEW			 252
#define ASN1_F_PKEY_USAGE_PERIOD_NEW			 240
#define ASN1_F_SXNETID_NEW				 244
#define ASN1_F_SXNET_NEW				 242
@@ -159,7 +167,10 @@
#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH			 108
#define ASN1_R_BUFFER_TOO_SMALL				 109
#define ASN1_R_DATA_IS_WRONG				 110
#define ASN1_R_DECODE_ERROR				 155
#define ASN1_R_DECODING_ERROR				 111
#define ASN1_R_DEOCDE_ERROR				 157
#define ASN1_R_ENCODE_ERROR				 156
#define ASN1_R_ERROR_PARSING_SET_ELEMENT		 112
#define ASN1_R_EXPECTING_AN_ENUMERATED			 154
#define ASN1_R_EXPECTING_AN_INTEGER			 113
+23 −0
Original line number Diff line number Diff line
@@ -575,6 +575,13 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
	unsigned char *data, int max_len);

STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
						 void (*free_func)() ); 
unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
								 int *len );
char *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)());
ASN1_STRING *ASN1_pack_string(char *obj, int (*i2d)(), ASN1_OCTET_STRING **oct);

#else

ASN1_TYPE *	ASN1_TYPE_new();
@@ -688,6 +695,11 @@ int ASN1_TYPE_get_int_octetstring();
int i2d_ASN1_BMPSTRING();
ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();

STACK *ASN1_seq_unpack();
unsigned char *ASN1_seq_pack();
char *ASN1_unpack_string();
ASN1_STRING *ASN1_pack_string();

#endif

/* BEGIN ERROR CODES */
@@ -712,12 +724,16 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_F_ASN1_INTEGER_SET				 111
#define ASN1_F_ASN1_INTEGER_TO_BN			 112
#define ASN1_F_ASN1_OBJECT_NEW				 113
#define ASN1_F_ASN1_PACK_STRING				 245
#define ASN1_F_ASN1_SEQ_PACK				 246
#define ASN1_F_ASN1_SEQ_UNPACK				 247
#define ASN1_F_ASN1_SIGN				 114
#define ASN1_F_ASN1_STRING_NEW				 115
#define ASN1_F_ASN1_STRING_TYPE_NEW			 116
#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING		 117
#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING		 118
#define ASN1_F_ASN1_TYPE_NEW				 119
#define ASN1_F_ASN1_UNPACK_STRING			 248
#define ASN1_F_ASN1_UTCTIME_NEW				 120
#define ASN1_F_ASN1_VERIFY				 121
#define ASN1_F_AUTHORITY_KEYID_NEW			 237
@@ -753,6 +769,7 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_F_D2I_NETSCAPE_RSA_2			 142
#define ASN1_F_D2I_NETSCAPE_SPKAC			 143
#define ASN1_F_D2I_NETSCAPE_SPKI			 144
#define ASN1_F_D2I_PBEPARAM				 249
#define ASN1_F_D2I_PKCS7				 145
#define ASN1_F_D2I_PKCS7_DIGEST				 146
#define ASN1_F_D2I_PKCS7_ENCRYPT			 147
@@ -763,6 +780,7 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_F_D2I_PKCS7_SIGNED				 152
#define ASN1_F_D2I_PKCS7_SIGNER_INFO			 153
#define ASN1_F_D2I_PKCS7_SIGN_ENVELOPE			 154
#define ASN1_F_D2I_PKCS8_PRIV_KEY_INFO			 250
#define ASN1_F_D2I_PKEY_USAGE_PERIOD			 239
#define ASN1_F_D2I_PRIVATEKEY				 155
#define ASN1_F_D2I_PUBLICKEY				 156
@@ -806,6 +824,7 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_F_NETSCAPE_PKEY_NEW			 189
#define ASN1_F_NETSCAPE_SPKAC_NEW			 190
#define ASN1_F_NETSCAPE_SPKI_NEW			 191
#define ASN1_F_PBEPARAM_NEW				 251
#define ASN1_F_PKCS7_DIGEST_NEW				 192
#define ASN1_F_PKCS7_ENCRYPT_NEW			 193
#define ASN1_F_PKCS7_ENC_CONTENT_NEW			 194
@@ -816,6 +835,7 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_F_PKCS7_SIGNED_NEW				 199
#define ASN1_F_PKCS7_SIGNER_INFO_NEW			 200
#define ASN1_F_PKCS7_SIGN_ENVELOPE_NEW			 201
#define ASN1_F_PKCS8_PRIV_KEY_INFO_NEW			 252
#define ASN1_F_PKEY_USAGE_PERIOD_NEW			 240
#define ASN1_F_SXNETID_NEW				 244
#define ASN1_F_SXNET_NEW				 242
@@ -852,7 +872,10 @@ ASN1_BMPSTRING *d2i_ASN1_BMPSTRING();
#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH			 108
#define ASN1_R_BUFFER_TOO_SMALL				 109
#define ASN1_R_DATA_IS_WRONG				 110
#define ASN1_R_DECODE_ERROR				 155
#define ASN1_R_DECODING_ERROR				 111
#define ASN1_R_DEOCDE_ERROR				 157
#define ASN1_R_ENCODE_ERROR				 156
#define ASN1_R_ERROR_PARSING_SET_ELEMENT		 112
#define ASN1_R_EXPECTING_AN_ENUMERATED			 154
#define ASN1_R_EXPECTING_AN_INTEGER			 113
+11 −0
Original line number Diff line number Diff line
@@ -81,12 +81,16 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_ASN1_INTEGER_SET,0),	"ASN1_INTEGER_set"},
{ERR_PACK(0,ASN1_F_ASN1_INTEGER_TO_BN,0),	"ASN1_INTEGER_to_BN"},
{ERR_PACK(0,ASN1_F_ASN1_OBJECT_NEW,0),	"ASN1_OBJECT_new"},
{ERR_PACK(0,ASN1_F_ASN1_PACK_STRING,0),	"ASN1_pack_string"},
{ERR_PACK(0,ASN1_F_ASN1_SEQ_PACK,0),	"ASN1_seq_pack"},
{ERR_PACK(0,ASN1_F_ASN1_SEQ_UNPACK,0),	"ASN1_seq_unpack"},
{ERR_PACK(0,ASN1_F_ASN1_SIGN,0),	"ASN1_SIGN"},
{ERR_PACK(0,ASN1_F_ASN1_STRING_NEW,0),	"ASN1_STRING_new"},
{ERR_PACK(0,ASN1_F_ASN1_STRING_TYPE_NEW,0),	"ASN1_STRING_type_new"},
{ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING,0),	"ASN1_TYPE_get_int_octetstring"},
{ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_OCTETSTRING,0),	"ASN1_TYPE_get_octetstring"},
{ERR_PACK(0,ASN1_F_ASN1_TYPE_NEW,0),	"ASN1_TYPE_new"},
{ERR_PACK(0,ASN1_F_ASN1_UNPACK_STRING,0),	"ASN1_unpack_string"},
{ERR_PACK(0,ASN1_F_ASN1_UTCTIME_NEW,0),	"ASN1_UTCTIME_NEW"},
{ERR_PACK(0,ASN1_F_ASN1_VERIFY,0),	"ASN1_VERIFY"},
{ERR_PACK(0,ASN1_F_AUTHORITY_KEYID_NEW,0),	"AUTHORITY_KEYID_NEW"},
@@ -122,6 +126,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA_2,0),	"D2I_NETSCAPE_RSA_2"},
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_SPKAC,0),	"D2I_NETSCAPE_SPKAC"},
{ERR_PACK(0,ASN1_F_D2I_NETSCAPE_SPKI,0),	"D2I_NETSCAPE_SPKI"},
{ERR_PACK(0,ASN1_F_D2I_PBEPARAM,0),	"D2I_PBEPARAM"},
{ERR_PACK(0,ASN1_F_D2I_PKCS7,0),	"D2I_PKCS7"},
{ERR_PACK(0,ASN1_F_D2I_PKCS7_DIGEST,0),	"D2I_PKCS7_DIGEST"},
{ERR_PACK(0,ASN1_F_D2I_PKCS7_ENCRYPT,0),	"D2I_PKCS7_ENCRYPT"},
@@ -132,6 +137,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_D2I_PKCS7_SIGNED,0),	"D2I_PKCS7_SIGNED"},
{ERR_PACK(0,ASN1_F_D2I_PKCS7_SIGNER_INFO,0),	"D2I_PKCS7_SIGNER_INFO"},
{ERR_PACK(0,ASN1_F_D2I_PKCS7_SIGN_ENVELOPE,0),	"D2I_PKCS7_SIGN_ENVELOPE"},
{ERR_PACK(0,ASN1_F_D2I_PKCS8_PRIV_KEY_INFO,0),	"D2I_PKCS8_PRIV_KEY_INFO"},
{ERR_PACK(0,ASN1_F_D2I_PKEY_USAGE_PERIOD,0),	"D2I_PKEY_USAGE_PERIOD"},
{ERR_PACK(0,ASN1_F_D2I_PRIVATEKEY,0),	"D2I_PRIVATEKEY"},
{ERR_PACK(0,ASN1_F_D2I_PUBLICKEY,0),	"D2I_PUBLICKEY"},
@@ -175,6 +181,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_NETSCAPE_PKEY_NEW,0),	"NETSCAPE_PKEY_NEW"},
{ERR_PACK(0,ASN1_F_NETSCAPE_SPKAC_NEW,0),	"NETSCAPE_SPKAC_NEW"},
{ERR_PACK(0,ASN1_F_NETSCAPE_SPKI_NEW,0),	"NETSCAPE_SPKI_NEW"},
{ERR_PACK(0,ASN1_F_PBEPARAM_NEW,0),	"PBEPARAM_NEW"},
{ERR_PACK(0,ASN1_F_PKCS7_DIGEST_NEW,0),	"PKCS7_DIGEST_NEW"},
{ERR_PACK(0,ASN1_F_PKCS7_ENCRYPT_NEW,0),	"PKCS7_ENCRYPT_NEW"},
{ERR_PACK(0,ASN1_F_PKCS7_ENC_CONTENT_NEW,0),	"PKCS7_ENC_CONTENT_NEW"},
@@ -185,6 +192,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_PACK(0,ASN1_F_PKCS7_SIGNED_NEW,0),	"PKCS7_SIGNED_NEW"},
{ERR_PACK(0,ASN1_F_PKCS7_SIGNER_INFO_NEW,0),	"PKCS7_SIGNER_INFO_NEW"},
{ERR_PACK(0,ASN1_F_PKCS7_SIGN_ENVELOPE_NEW,0),	"PKCS7_SIGN_ENVELOPE_NEW"},
{ERR_PACK(0,ASN1_F_PKCS8_PRIV_KEY_INFO_NEW,0),	"PKCS8_PRIV_KEY_INFO_NEW"},
{ERR_PACK(0,ASN1_F_PKEY_USAGE_PERIOD_NEW,0),	"PKEY_USAGE_PERIOD_NEW"},
{ERR_PACK(0,ASN1_F_SXNETID_NEW,0),	"SXNETID_NEW"},
{ERR_PACK(0,ASN1_F_SXNET_NEW,0),	"SXNET_NEW"},
@@ -224,7 +232,10 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
{ASN1_R_BOOLEAN_IS_WRONG_LENGTH          ,"boolean is wrong length"},
{ASN1_R_BUFFER_TOO_SMALL                 ,"buffer too small"},
{ASN1_R_DATA_IS_WRONG                    ,"data is wrong"},
{ASN1_R_DECODE_ERROR                     ,"decode error"},
{ASN1_R_DECODING_ERROR                   ,"decoding error"},
{ASN1_R_DEOCDE_ERROR                     ,"deocde error"},
{ASN1_R_ENCODE_ERROR                     ,"encode error"},
{ASN1_R_ERROR_PARSING_SET_ELEMENT        ,"error parsing set element"},
{ASN1_R_EXPECTING_AN_ENUMERATED          ,"expecting an enumerated"},
{ASN1_R_EXPECTING_AN_INTEGER             ,"expecting an integer"},
Loading