]> git.ipfire.org Git - thirdparty/openssl.git/commit
decoders: Fix prioritization of decoders via property query
authorDaniel Van Geest <daniel.vangeest@cryptonext-security.com>
Mon, 23 Jun 2025 11:45:59 +0000 (12:45 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 1 Jul 2025 17:06:57 +0000 (19:06 +0200)
commit60775e31123e6ef66a7cf86f199289d6e250dceb
tree63d5599f6fb722cb4a898eabeb5ee5db35c224cd
parentf3867bb25bee6267eb292ebdb0528de17710828f
decoders: Fix prioritization of decoders via property query

When a property query string was used, it was not being applied to decoders.
When multiple providers supporting the same algorithm were loaded, it was
undefined which provider would be used when decoding a key, even when a
propquery string was provided.  This fix scores decoder instances based on
property query matching and selects the highest scored decoder instance when
building the decoder chain.

The fake_rsa test provider is updated to support basic encoding and decoding.
A test is added using the fake_rsa provider to ensure that property query
strings are respected when loading decoders.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27876)
crypto/encode_decode/decoder_lib.c
crypto/encode_decode/decoder_pkey.c
crypto/encode_decode/encoder_local.h
test/fake_rsaprov.c
test/provider_pkey_test.c