summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-05-10 00:47:42 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-05-10 00:47:42 +0000
commit884e8ec61533ee6361d72151066a808a0cfcd6d3 (patch)
tree45ea7a5baeef816089ea84b81e41e773762d0b9c /crypto/evp/evp_lib.c
parent9d5cceac6fb0eca8945f630afff1a2288aa6332a (diff)
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.
Diffstat (limited to 'crypto/evp/evp_lib.c')
-rw-r--r--crypto/evp/evp_lib.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c
index 6b677fdf6f..d49ae90c77 100644
--- a/crypto/evp/evp_lib.c
+++ b/crypto/evp/evp_lib.c
@@ -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;
+ }
+}
+