]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix Edge Cases in Password Callback Handling
authorerbsland-dev <github@erbsland.dev>
Fri, 30 Aug 2024 08:56:58 +0000 (10:56 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 9 Sep 2024 06:58:03 +0000 (08:58 +0200)
commit5387b71acb833f1f635ab4a20ced0863747ef5c1
treec8ede64fc54cd05fe7d2c59818f92d56c9d53ccf
parentfa6ae88a47a37678e8f8567ec2622bef515ac286
Fix Edge Cases in Password Callback Handling

Fixes #8441: Modify the password callback handling to reserve one byte in the buffer for a null terminator, ensuring compatibility with legacy behavior that puts a terminating null byte at the end.

Additionally, validate the length returned by the callback to ensure it does not exceed the given buffer size. If the returned length is too large, the process now stops gracefully with an appropriate error, enhancing robustness by preventing crashes from out-of-bounds access.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25330)
crypto/pem/pem_pk8.c
crypto/ui/ui_util.c