summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2022-05-24 22:59:41 +0800
committerTomas Mraz <tomas@openssl.org>2022-05-27 07:58:47 +0200
commit275037b3fd7c0b3d3a22eaa66fdb41ed86510b96 (patch)
tree8a23649eccc26afb07af3d12872ce7afbc2bdeaf /apps
parentacd6338ff0afa31730a0cff62d993a8ebc63db5c (diff)
Fix the incorrect checks of EVP_CIPHER_CTX_rand_key
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18397) (cherry picked from commit f15e3f3aa95df743f0da793da952f87370efb4ff)
Diffstat (limited to 'apps')
-rw-r--r--apps/speed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/speed.c b/apps/speed.c
index f16c78baab..535e0f45c2 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -3607,7 +3607,7 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single,
goto err;
}
key = app_malloc(keylen, "evp_cipher key");
- if (!EVP_CIPHER_CTX_rand_key(ctx, key))
+ if (EVP_CIPHER_CTX_rand_key(ctx, key) <= 0)
app_bail_out("failed to generate random cipher key\n");
if (!EVP_EncryptInit_ex(ctx, NULL, NULL, key, NULL))
app_bail_out("failed to set cipher key\n");