diff options
| author | tb <> | 2024-03-28 01:42:02 +0000 |
|---|---|---|
| committer | tb <> | 2024-03-28 01:42:02 +0000 |
| commit | ce00429616228a540fb507407c63d17c63a0bda5 (patch) | |
| tree | 06571e904b7a14dfcd004ff1fea15d31a753a55c | |
| parent | 2eba7525a2e71749101c2d619288f07950401cdd (diff) | |
| download | openbsd-ce00429616228a540fb507407c63d17c63a0bda5.tar.gz openbsd-ce00429616228a540fb507407c63d17c63a0bda5.tar.bz2 openbsd-ce00429616228a540fb507407c63d17c63a0bda5.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
| -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 | } |
