From f45f40fffff1348ce2b12c9da520a1ea88567294 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 29 Dec 1999 02:59:18 +0000 Subject: Add OIDs for idea and blowfish. Unfortunately these are in the middle of the OID table so the diff is rather large :-( --- crypto/asn1/p5_pbev2.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crypto/asn1/p5_pbev2.c') diff --git a/crypto/asn1/p5_pbev2.c b/crypto/asn1/p5_pbev2.c index 19888473e6..502a8c399d 100644 --- a/crypto/asn1/p5_pbev2.c +++ b/crypto/asn1/p5_pbev2.c @@ -175,15 +175,22 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, PBKDF2PARAM *kdf = NULL; PBE2PARAM *pbe2 = NULL; ASN1_OCTET_STRING *osalt = NULL; + ASN1_OBJECT *obj; + + alg_nid = EVP_CIPHER_type(cipher); + obj = OBJ_nid2obj(alg_nid); + if(!obj || !obj->data) { + ASN1err(ASN1_F_PKCS5_PBE2_SET, + ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER); + goto err; + } if(!(pbe2 = PBE2PARAM_new())) goto merr; /* Setup the AlgorithmIdentifier for the encryption scheme */ scheme = pbe2->encryption; - alg_nid = EVP_CIPHER_type(cipher); - - scheme->algorithm = OBJ_nid2obj(alg_nid); + scheme->algorithm = obj; if(!(scheme->parameter = ASN1_TYPE_new())) goto merr; /* Create random IV */ -- cgit v1.2.3