diff options
| author | tb <> | 2026-01-30 13:47:22 +0000 |
|---|---|---|
| committer | tb <> | 2026-01-30 13:47:22 +0000 |
| commit | d08c52f7b1df87a6d0b5aa0f42fdeee3f3c0e6b9 (patch) | |
| tree | e823d4052750c9728810a4549e699997baad40d6 /src/lib/libcrypto | |
| parent | 941f37f21fb644009376b73f2065913887fa1bd0 (diff) | |
| download | openbsd-d08c52f7b1df87a6d0b5aa0f42fdeee3f3c0e6b9.tar.gz openbsd-d08c52f7b1df87a6d0b5aa0f42fdeee3f3c0e6b9.tar.bz2 openbsd-d08c52f7b1df87a6d0b5aa0f42fdeee3f3c0e6b9.zip | |
EVP_SealInit: do not return -1 on error
It is documented that EVP_SealInit() returns 0 on error. So -1 is wrong.
Reported by Niels Dossche
ok jsing kenjiro
Diffstat (limited to 'src/lib/libcrypto')
| -rw-r--r-- | src/lib/libcrypto/evp/p_legacy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/p_legacy.c b/src/lib/libcrypto/evp/p_legacy.c index b2fa9dda53..521bddaa02 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.8 2026/01/30 13:42:46 tb Exp $ */ | 1 | /* $OpenBSD: p_legacy.c,v 1.9 2026/01/30 13:47:22 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 | * |
| @@ -188,7 +188,7 @@ EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, | |||
| 188 | ekl[i] = EVP_PKEY_encrypt_old(ek[i], key, | 188 | ekl[i] = EVP_PKEY_encrypt_old(ek[i], key, |
| 189 | EVP_CIPHER_CTX_key_length(ctx), pubk[i]); | 189 | EVP_CIPHER_CTX_key_length(ctx), pubk[i]); |
| 190 | if (ekl[i] <= 0) | 190 | if (ekl[i] <= 0) |
| 191 | return (-1); | 191 | return 0; |
| 192 | } | 192 | } |
| 193 | return (npubk); | 193 | return (npubk); |
| 194 | } | 194 | } |
