diff options
author | tb <> | 2024-03-28 01:42:02 +0000 |
---|---|---|
committer | tb <> | 2024-03-28 01:42:02 +0000 |
commit | f00df7e0320e9afb5a3162efa32063f0b168aea3 (patch) | |
tree | 06571e904b7a14dfcd004ff1fea15d31a753a55c /src | |
parent | 3464202a67bd692f85f993dcb7a602dcc8a8bd9c (diff) | |
download | openbsd-f00df7e0320e9afb5a3162efa32063f0b168aea3.tar.gz openbsd-f00df7e0320e9afb5a3162efa32063f0b168aea3.tar.bz2 openbsd-f00df7e0320e9afb5a3162efa32063f0b168aea3.zip |
Check the return value of EVP_CIPHER_CTX_reset()
The function call can't actually fail, but all other calls check its
return value.
ok joshua jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/evp/p_legacy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/p_legacy.c b/src/lib/libcrypto/evp/p_legacy.c index a444309f1d..adb6dc9174 100644 --- a/src/lib/libcrypto/evp/p_legacy.c +++ b/src/lib/libcrypto/evp/p_legacy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: p_legacy.c,v 1.4 2024/03/26 05:22:50 joshua Exp $ */ | 1 | /* $OpenBSD: p_legacy.c,v 1.5 2024/03/28 01:42:02 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -99,7 +99,8 @@ EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | |||
99 | int i, size = 0, ret = 0; | 99 | int i, size = 0, ret = 0; |
100 | 100 | ||
101 | if (type) { | 101 | if (type) { |
102 | EVP_CIPHER_CTX_reset(ctx); | 102 | if (!EVP_CIPHER_CTX_reset(ctx)) |
103 | return 0; | ||
103 | if (!EVP_DecryptInit_ex(ctx, type, NULL, NULL, NULL)) | 104 | if (!EVP_DecryptInit_ex(ctx, type, NULL, NULL, NULL)) |
104 | return 0; | 105 | return 0; |
105 | } | 106 | } |
@@ -154,7 +155,8 @@ EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, | |||
154 | int i, iv_len; | 155 | int i, iv_len; |
155 | 156 | ||
156 | if (type) { | 157 | if (type) { |
157 | EVP_CIPHER_CTX_reset(ctx); | 158 | if (!EVP_CIPHER_CTX_reset(ctx)) |
159 | return 0; | ||
158 | if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL)) | 160 | if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL)) |
159 | return 0; | 161 | return 0; |
160 | } | 162 | } |