]> git.ipfire.org Git - thirdparty/gnutls.git/commit
x509: fix return error code for failed decryption without key
authorCraig Gallek <cgallek@gmail.com>
Sun, 27 Feb 2022 15:39:07 +0000 (10:39 -0500)
committerCraig Gallek <cgallek@gmail.com>
Sun, 27 Feb 2022 15:39:07 +0000 (10:39 -0500)
commitcd81b42afa3d14fbf4273cb3dbc48fe795909603
tree39294b4dda57352fc300bd24c29f8d4cbfe13963
parent15b43385c1f3a903e430fc79feabcb68b164df2b
x509: fix return error code for failed decryption without key

Decrypting an encrypted private key previously returned
GNUTLS_E_DECRYPTION_FAILED when no password was supplied.  This changed when
decryption via pin callbacks was added in d31b89de.

That change should have included a check for callback existence in order to
preserve the error path of the no-password case.

This adds the check and a test for the previous behavior.
Resolves bug #1321

Signed-off-by: Craig Gallek <cgallek@gmail.com>
lib/x509/privkey.c
tests/key-openssl.c