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

Various PKCS#7 fixes to properly (maybe!) handle PKCS#7 enveloped data.

Containts elements of code by Sebastian Akerman <sak@parallelconsulting.com>
and made a bit less "naughty" by Steve.
parent 9d5cceac
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5,6 +5,10 @@

 Changes between 0.9.2b and 0.9.3

  *) Various fixes to the EVP and PKCS#7 code. It may now be able to
     handle PKCS#7 enveloped data properly.
     [Sebastian Akerman <sak@parallelconsulting.com>, modified by Steve]

  *) Create a duplicate of the SSL_CTX's CERT in SSL_new instead of
     copying pointers.  The cert_st handling is changed by this in
     various ways (and thus what used to be known as ctx->default_cert
+2 −2
Original line number Diff line number Diff line

  OpenSSL STATUS                           Last modified at
  ______________                           $Date: 1999/04/29 21:56:13 $
  ______________                           $Date: 1999/05/10 00:47:37 $

  DEVELOPMENT STATE

    o  OpenSSL 0.9.3:  Under development...
                       Proposed freeze  date: Mon May  8th, 1999
                       Proposed freeze  date: Mon May 10th, 1999
                       Proposed release date: Mon May 17th, 1999
    o  OpenSSL 0.9.2b: Released on March    22th, 1999
    o  OpenSSL 0.9.1c: Released on December 23th, 1998
+3 −3
Original line number Diff line number Diff line
@@ -155,9 +155,9 @@ static int rc2_meth_to_magic(const EVP_CIPHER *e)
	int i;

	i=EVP_CIPHER_key_length(e);
	if 	(i == 128) return(RC2_128_MAGIC);
	else if (i == 64)  return(RC2_64_MAGIC);
	else if (i == 40)  return(RC2_40_MAGIC);
	if 	(i == 16) return(RC2_128_MAGIC);
	else if (i == 8)  return(RC2_64_MAGIC);
	else if (i == 5)  return(RC2_40_MAGIC);
	else return(0);
	}

+3 −0
Original line number Diff line number Diff line
@@ -433,6 +433,7 @@ typedef int (EVP_PBE_KEYGEN)(const char *pass, int passlen,
#define EVP_CIPHER_CTX_iv_length(e)	((e)->cipher->iv_len)
#define EVP_CIPHER_CTX_get_app_data(e)	((e)->app_data)
#define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d))
#define EVP_CIPHER_CTX_type(c)         EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))

#define EVP_ENCODE_LENGTH(l)	(((l+2)/3*4)+(l/48+1)*2+80)
#define EVP_DECODE_LENGTH(l)	((l+3)/4*3+80)
@@ -623,6 +624,8 @@ 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);

/* calls methods */
int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+26 −0
Original line number Diff line number Diff line
@@ -110,3 +110,29 @@ int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
		}
	return(i);
	}

/* Convert the various cipher NIDs and dummies to a proper OID NID */
int EVP_CIPHER_type(EVP_CIPHER *ctx)
{
	int nid;
	nid = EVP_CIPHER_nid(ctx);

	switch(nid) {

		case NID_rc2_cbc:
		case NID_rc2_64_cbc:
		case NID_rc2_40_cbc:

		return NID_rc2_cbc;

		case NID_rc4:
		case NID_rc4_40:

		return NID_rc4;

		default:

		return nid;
	}
}
Loading