summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/p5_pbev2.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/asn1/p5_pbev2.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/asn1/p5_pbev2.c')
-rw-r--r--crypto/asn1/p5_pbev2.c13
1 files changed, 10 insertions, 3 deletions
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 */