From: Dmitry Belyavskiy Date: Fri, 8 Aug 2025 09:52:11 +0000 (+0200) Subject: Fix SKEYMGMT enumeration, add tests X-Git-Tag: openssl-3.5.3~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c8a3e06c97e831f241c7b215e3e61acd646de10;p=thirdparty%2Fopenssl.git Fix SKEYMGMT enumeration, add tests Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/28207) (cherry picked from commit f446bf79515f55f55930c5340eb3eb981327f2ac) --- diff --git a/crypto/evp/skeymgmt_meth.c b/crypto/evp/skeymgmt_meth.c index 10a320e58a6..9ecab50fa04 100644 --- a/crypto/evp/skeymgmt_meth.c +++ b/crypto/evp/skeymgmt_meth.c @@ -197,7 +197,7 @@ void EVP_SKEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_SKEYMGMT *skeymgmt, void *arg), void *arg) { - evp_generic_do_all(libctx, OSSL_OP_KEYMGMT, + evp_generic_do_all(libctx, OSSL_OP_SKEYMGMT, (void (*)(void *, void *))fn, arg, skeymgmt_from_algorithm, (int (*)(void *))EVP_SKEYMGMT_up_ref, diff --git a/test/recipes/20-test_cli_list.t b/test/recipes/20-test_cli_list.t new file mode 100644 index 00000000000..2416da47634 --- /dev/null +++ b/test/recipes/20-test_cli_list.t @@ -0,0 +1,25 @@ +#! /usr/bin/env perl +# Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved. +# +# Licensed under the Apache License 2.0 (the "License"). You may not use +# this file except in compliance with the License. You can obtain a copy +# in the file LICENSE in the source distribution or at +# https://www.openssl.org/source/license.html + +use strict; +use warnings; + +use OpenSSL::Test qw/:DEFAULT bldtop_file srctop_file bldtop_dir with/; +use OpenSSL::Test::Utils; + +setup("test_cli_list"); + +plan tests => 2; + +ok(run(app(["openssl", "list", "-skey-managers"], + stdout => "listout.txt")), +"List skey managers - default configuration"); +open DATA, "listout.txt"; +my @match = grep /secret key/, ; +close DATA; +ok(scalar @match > 1 ? 1 : 0, "Several skey managers are listed - default configuration");