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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user