diff options
author | tb <> | 2023-03-01 11:16:06 +0000 |
---|---|---|
committer | tb <> | 2023-03-01 11:16:06 +0000 |
commit | f5e0861acadab7b2625681b497a31647ae1ac5e2 (patch) | |
tree | ddd86c921e987eb4b4fd9638484ec09a25f73f4a /src/lib/libcrypto/evp/e_chacha20poly1305.c | |
parent | 570f472a828e4bb99852360fc02874847bbe787a (diff) | |
download | openbsd-f5e0861acadab7b2625681b497a31647ae1ac5e2.tar.gz openbsd-f5e0861acadab7b2625681b497a31647ae1ac5e2.tar.bz2 openbsd-f5e0861acadab7b2625681b497a31647ae1ac5e2.zip |
Make the cleanup() method return an int again
This partially reverts jsing's OpenBSD commit b8185953, but without adding
back the error check that potentialy results in dumb leaks. No cleanup()
method in the wild returns anything but 1. Since that's the signature in
the EVP_CIPHER_meth_* API, we have no choice...
ok jsing
Diffstat (limited to 'src/lib/libcrypto/evp/e_chacha20poly1305.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_chacha20poly1305.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/e_chacha20poly1305.c b/src/lib/libcrypto/evp/e_chacha20poly1305.c index 2635b6f675..1bd04c1f1f 100644 --- a/src/lib/libcrypto/evp/e_chacha20poly1305.c +++ b/src/lib/libcrypto/evp/e_chacha20poly1305.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_chacha20poly1305.c,v 1.27 2022/11/26 16:08:52 tb Exp $ */ | 1 | /* $OpenBSD: e_chacha20poly1305.c,v 1.28 2023/03/01 11:16:06 tb Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> |
@@ -530,12 +530,14 @@ chacha20_poly1305_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | |||
530 | return len; | 530 | return len; |
531 | } | 531 | } |
532 | 532 | ||
533 | static void | 533 | static int |
534 | chacha20_poly1305_cleanup(EVP_CIPHER_CTX *ctx) | 534 | chacha20_poly1305_cleanup(EVP_CIPHER_CTX *ctx) |
535 | { | 535 | { |
536 | struct chacha20_poly1305_ctx *cpx = ctx->cipher_data; | 536 | struct chacha20_poly1305_ctx *cpx = ctx->cipher_data; |
537 | 537 | ||
538 | explicit_bzero(cpx, sizeof(*cpx)); | 538 | explicit_bzero(cpx, sizeof(*cpx)); |
539 | |||
540 | return 1; | ||
539 | } | 541 | } |
540 | 542 | ||
541 | static int | 543 | static int |