Fix a return value confusion in chacha20_poly1305_cipher()
authortb <tb@openbsd.org>
Fri, 15 Dec 2023 13:48:59 +0000 (13:48 +0000)
committertb <tb@openbsd.org>
Fri, 15 Dec 2023 13:48:59 +0000 (13:48 +0000)
commit01dc8a7301f5a8645d65c588dcd1143874d9dc26
tree7ab2c63aab513be05c3d4c68390ca1432c72602d
parent0fbfcfcf292e3f6066a00181243c21166badf2c0
Fix a return value confusion in chacha20_poly1305_cipher()

On overlong input, chacha20_poly1305_cipher() would return 0, which in
EVP_CipherUpdate() and EVP_CipherFinal() signals success with no data
written since EVP_CIPH_FLAG_CUSTOM_CIPHER is set. In order to signal an
error, we need to return -1. Obviously.

ok jsing
lib/libcrypto/evp/e_chacha20poly1305.c