]> git.ipfire.org Git - thirdparty/openssl.git/commit
Add test for BIO password callback functionality
authorerbsland-dev <github@erbsland.dev>
Thu, 29 Aug 2024 21:08:46 +0000 (23:08 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 9 Sep 2024 06:58:51 +0000 (08:58 +0200)
commit750028cc51af1713aff815373e19807160b8d0b7
treee73daf0f32c9d85816aeb04b91c277c1a9c9488a
parentb5245178509db0c04c5f74388f9f36ea6a266b4e
Add test for BIO password callback functionality

Related to #8441

This commit introduces a test suite for the password callback mechanism used when reading or writing encrypted and PEM or DER encoded keys via a BIO in OpenSSL. The test is designed to cover various edge cases, particularly focusing on scenarios where the password callback might return unexpected or malformed data from user code.

By simulating different callback behaviors, including negative returns, zero-length passwords, passwords that exactly fill the buffer and wrongly reported lengths. Also testing for the correct behaviour of binary passwords that contain a null byte in the middle.

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 fa6ae88a47a37678e8f8567ec2622bef515ac286)
test/bio_pw_callback_test.c [new file with mode: 0644]
test/build.info
test/recipes/61-test_bio_pw_callback.t [new file with mode: 0644]
test/recipes/61-test_bio_pw_callback_data/private_key.pem [new file with mode: 0644]