]> 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 07:05:45 +0000 (09:05 +0200)
commit412ca384e45574013900a286a5cee87c220e0158
treeb41b87c861cf58a5574e2c1cea1ce9f605624d11
parent8753a73827812bf807bea4dfa94c6662dd015cba
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)

(cherry picked from commit 5387b71acb833f1f635ab4a20ced0863747ef5c1)
crypto/pem/pem_pk8.c
crypto/ui/ui_util.c