diff --git a/lib/hx509/ks_file.c b/lib/hx509/ks_file.c index 026c6a935..fd7e54bf6 100644 --- a/lib/hx509/ks_file.c +++ b/lib/hx509/ks_file.c @@ -179,7 +179,12 @@ parse_rsa_private_key(hx509_context context, struct hx509_collector *c, return ENOMEM; } - cipher = EVP_aes_256_cbc(); + cipher = EVP_get_cipherbyname(type); + if (cipher == NULL) { + free(type); + free(ivdata); + return EINVAL; + } #define PKCS5_SALT_LEN 8