summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs7/pk7_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-02-22 18:45:11 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-02-22 18:45:11 +0000
commit4b42658082a3d6224d25f10de8fdb605d30015a9 (patch)
tree6c9ce1e8f0f222d9a1de90de288b184436a23db4 /crypto/pkcs7/pk7_lib.c
parent3f2b5a88ad62c63caae1265f9055fb660c7eb407 (diff)
Make pkcs8 work again.
Make EVP_CIPHER_type() return NID_undef if the cipher has no ASN1 OID, modify code to handle this.
Diffstat (limited to 'crypto/pkcs7/pk7_lib.c')
-rw-r--r--crypto/pkcs7/pk7_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c
index 2012d7c87a..45973fe850 100644
--- a/crypto/pkcs7/pk7_lib.c
+++ b/crypto/pkcs7/pk7_lib.c
@@ -456,11 +456,12 @@ int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
}
/* Check cipher OID exists and has data in it*/
- objtmp = OBJ_nid2obj(EVP_CIPHER_type(cipher));
- if(!objtmp || !objtmp->data) {
+ i = EVP_CIPHER_type(cipher);
+ if(i == NID_undef) {
PKCS7err(PKCS7_F_PKCS7_SET_CIPHER,PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
return(0);
}
+ objtmp = OBJ_nid2obj(i);
ec->cipher = cipher;
return 1;