From: Pauli Date: Thu, 10 Jul 2025 00:40:55 +0000 (+1000) Subject: params: allow param name aliases X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d221516cdff8e0674a097e5913c16b5ea26bedc;p=thirdparty%2Fopenssl.git params: allow param name aliases We allowed multiple names for the same parameter in a number of places. This is best dealt with in the generated code. Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27923) --- diff --git a/util/perl/OpenSSL/paramnames.pm b/util/perl/OpenSSL/paramnames.pm index 075bbd190e7..e13deb476f9 100644 --- a/util/perl/OpenSSL/paramnames.pm +++ b/util/perl/OpenSSL/paramnames.pm @@ -688,7 +688,7 @@ sub generate_decoder_from_trie { } print ")) {\n"; trie_matched($field, $num, $indent1, $indent2); - printf "%s}\n", $indent0; + printf "%s}\n", $indent0; return; } @@ -817,12 +817,16 @@ sub output_param_decoder { # Output param pointer structure printf "#ifndef %s_st\n", $decoder_name_base; printf "struct %s_st {\n", $decoder_name_base; + my %done_prms = (); foreach my $pident (sort values %prms) { - if (defined($concat_num{$pident})) { - printf " OSSL_PARAM *%s[%s];\n", $pident, $concat_num{$pident}; - printf " int num_%s;\n", $pident; - } else { - printf " OSSL_PARAM *%s;\n", $pident; + if (not defined $done_prms{$pident}) { + $done_prms{$pident} = 1; + if (defined($concat_num{$pident})) { + printf " OSSL_PARAM *%s[%s];\n", $pident, $concat_num{$pident}; + printf " int num_%s;\n", $pident; + } else { + printf " OSSL_PARAM *%s;\n", $pident; + } } } print "};\n#endif\n\n";