openssl-util: Set expected object type to private keys

Configures the store to only try to fetch private keys and nothing
else.
This commit is contained in:
Daan De Meyer
2024-11-06 18:07:11 +01:00
parent 4047b99c00
commit 5619a61829

View File

@@ -1340,6 +1340,9 @@ static int load_key_from_provider(
if (!store)
return log_openssl_errors("Failed to open OpenSSL store via '%s'", private_key_uri);
if (OSSL_STORE_expect(store, OSSL_STORE_INFO_PKEY) == 0)
return log_openssl_errors("Failed to filter store by private keys");
_cleanup_(OSSL_STORE_INFO_freep) OSSL_STORE_INFO *info = OSSL_STORE_load(store);
if (!info)
return log_openssl_errors("Failed to load OpenSSL store via '%s'", private_key_uri);