summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs7/pk7_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-12-29 02:59:18 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-12-29 02:59:18 +0000
commitf45f40fffff1348ce2b12c9da520a1ea88567294 (patch)
treeb2db6279ebb534b83d5dc653f96d97b9fe8f238f /crypto/pkcs7/pk7_lib.c
parent6447cce37251e6d947279a3fd6874e59ed0d3d2d (diff)
Add OIDs for idea and blowfish. Unfortunately these are in
the middle of the OID table so the diff is rather large :-(
Diffstat (limited to 'crypto/pkcs7/pk7_lib.c')
-rw-r--r--crypto/pkcs7/pk7_lib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c
index 889fb9b355..2012d7c87a 100644
--- a/crypto/pkcs7/pk7_lib.c
+++ b/crypto/pkcs7/pk7_lib.c
@@ -438,6 +438,7 @@ X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si)
int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
{
int i;
+ ASN1_OBJECT *objtmp;
PKCS7_ENC_CONTENT *ec;
i=OBJ_obj2nid(p7->type);
@@ -454,7 +455,12 @@ int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
return(0);
}
- /* Setup cipher OID */
+ /* Check cipher OID exists and has data in it*/
+ objtmp = OBJ_nid2obj(EVP_CIPHER_type(cipher));
+ if(!objtmp || !objtmp->data) {
+ PKCS7err(PKCS7_F_PKCS7_SET_CIPHER,PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
+ return(0);
+ }
ec->cipher = cipher;
return 1;