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

Fix some obvious bugs in the PKCS#7 library handling. It didn't try to

find the right RecipientInfo based on the recipient certificate (so would
fail a lot of the time) and fixup cipher structures to correctly (maybe)
modify the AlgorithmIdentifiers.  Largely untested at present... this will be
fixed in due course. Well the stuff was broken to begin with so if its broken
now then you haven't lost anything :-)
parent a74c55cd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -10,6 +10,11 @@
                                   [23-Dec-1998] down below; but in later
                                   versions, these hyphens are gone.]

  *) Reorganise the PKCS#7 library and get rid of some of the more obvious
     problems: find RecipientInfo structure that matches recipient certificate
     and initialise the ASN1 structures properly based on passed cipher.
     [Steve Henson]

  *) Belatedly make the BN tests actually check the results.
     [Ben Laurie]

+1 −1
Original line number Diff line number Diff line
@@ -624,7 +624,7 @@ int EVP_PKEY_missing_parameters(EVP_PKEY *pkey);
int EVP_PKEY_save_parameters(EVP_PKEY *pkey,int mode);
int EVP_PKEY_cmp_parameters(EVP_PKEY *a,EVP_PKEY *b);

int EVP_CIPHER_type(EVP_CIPHER *ctx);
int EVP_CIPHER_type(const EVP_CIPHER *ctx);

/* calls methods */
int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static ERR_STRING_DATA EVP_str_functs[]=
{ERR_PACK(0,EVP_F_EVP_OPENINIT,0),	"EVP_OpenInit"},
{ERR_PACK(0,EVP_F_EVP_PBE_ALGOR_CIPHERINIT,0),	"EVP_PBE_ALGOR_CipherInit"},
{ERR_PACK(0,EVP_F_EVP_PBE_ALG_ADD,0),	"EVP_PBE_alg_add"},
{ERR_PACK(0,EVP_F_EVP_PBE_CIPHERINIT,0),	"EVP_PBE_CIPHERINIT"},
{ERR_PACK(0,EVP_F_EVP_PBE_CIPHERINIT,0),	"EVP_PBE_CipherInit"},
{ERR_PACK(0,EVP_F_EVP_PKCS82PKEY,0),	"EVP_PKCS82PKEY"},
{ERR_PACK(0,EVP_F_EVP_PKCS8_SET_BROKEN,0),	"EVP_PKCS8_SET_BROKEN"},
{ERR_PACK(0,EVP_F_EVP_PKEY2PKCS8,0),	"EVP_PKEY2PKCS8"},
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
	}

/* Convert the various cipher NIDs and dummies to a proper OID NID */
int EVP_CIPHER_type(EVP_CIPHER *ctx)
int EVP_CIPHER_type(const EVP_CIPHER *ctx)
{
	int nid;
	nid = EVP_CIPHER_nid(ctx);
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ again:

	/* We need to process the data */
	/* We cannot support detached encryption */
	p7bio=PKCS7_dataDecode(p7,pkey,detached,cert_store);
	p7bio=PKCS7_dataDecode(p7,pkey,detached,x509);
	
	if (p7bio == NULL)
		{
Loading