Branch: refs/heads/master
Home:
https://github.com/openssl/openssl
Commit: cb9a9021752b0c3499fccbb965e1e525b357a0f0
https://github.com/openssl/openssl/commit/cb9a9021752b0c3499fccbb965e1e525b357a0f0
Author: Neil Horman <
nho...@openssl.org>
Date: 2026-07-16 (Thu, 16 Jul 2026)
Changed paths:
M apps/lib/apps.c
Log Message:
-----------
Fix dsaparams decoding from DER files
The tests addded in commit d8a7e8e uncovered an odd error case.
https://github.com/openssl/openssl/actions/runs/29303845665/job/86993085732
Is failing when attempting to read in a der file converting from a
corresponding PEM file containing DSA parameters.
Interestingly The problem was only occuring when:
1) The input was a DER file
and
2) Blake2 was not configured
Doing some tracing of the decoder operation showed that this is occuring
because the OSSL_STORE lookup used to find the proper decoder uses a
"first successful decode wins" approach, after which the loading code
checks to see if the decoded type matches the expected key type.
When decoding PEM, this isn't a problem, as the PEM armoring gives the
decoder a hint as to why type of data the input file is.
But with DER, there is no such hint, and we're at the mercy of whichever
decoder happens to decode the data correctly first. Normally it works
just fine, but when features are disabled or enabled, the order in which
the decoders are attempted may change, affecting the outcome. In this
particular case, disabling blake2 caused the DHX decoder to be attempted
first, which decodes the input der file without issue. That in turn
caused the subsequent EVP_PKEY_is_a check to fail (as we were expecting
a DSA key), and so the test fails.
Fortunately, the code that the dsaparam applet uses to do this decode
provides a keytype hint, which we can use to guide the decode process.
keep the old store lookup method around in case anyone doesn't pass a
uri that is a file path or provide a keytype, but if we do both those
things, we can use OSSL_DECODER_CTX_new_for_pkey to specifically tell
the decoder that we want to decode the input data as the expected type
(in this case a DSA key).
Fixes #31944
Reviewed-by: Milan Broz <
mb...@openssl.org>
Reviewed-by: Tomas Mraz <to...@openssl.foundation>
Reviewed-by: Tim Hudson <
t...@openssl.org>
MergeDate: Thu Jul 16 15:28:32 2026
(Merged from
https://github.com/openssl/openssl/pull/31954)
To unsubscribe from these emails, change your notification settings at
https://github.com/openssl/openssl/settings/notifications