]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
params: add features to param parser generator master
authorPauli <ppzgs1@gmail.com>
Fri, 15 Aug 2025 03:34:04 +0000 (13:34 +1000)
committerPauli <ppzgs1@gmail.com>
Sat, 23 Aug 2025 03:31:25 +0000 (13:31 +1000)
Support BN as an available type.

If a param name is repeated, use the extra fields for the first not the last.

Include the parameter name in a comment in the generated parser.  This
Fixes #28257

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28273)

util/perl/OpenSSL/paramnames.pm

index 786b73816324fff21a440e0a83ce0e719911227c..e6462900ae4eba7258b8af62b7848319a598e0bc 100644 (file)
@@ -723,6 +723,7 @@ sub generate_decoder_from_trie {
                 if ($suf ne $trieref->{'suffix'});
         }
         print ")) {\n";
+        printf "%s/* %s */\n", $indent1, $trieref->{'name'};
         trie_matched($field, $num, $indent1, $indent2);
         printf "%s}\n", $indent0;
 
@@ -858,14 +859,15 @@ sub output_param_decoder {
             } elsif (substr($pnum, 0, 3) eq '#if') {
                 # Trim the `#if' from the front
                 $ifdefs{$pident} = substr($pnum, 3);
-            } else {
+            } elsif (not defined $concat_num{$pident}) {
                 $concat_num{$pident} = $pnum;
             }
         }
         output_ifdef($ifdefs{$pident});
         print "    OSSL_PARAM_$ptype(OSSL_$pname, NULL";
         print ", 0" if $ptype eq "octet_string" || $ptype eq "octet_ptr"
-                       || $ptype eq "utf8_string" || $ptype eq "utf8_ptr";
+                       || $ptype eq "utf8_string" || $ptype eq "utf8_ptr"
+                       || $ptype eq "BN";
         printf "),\n";
         output_endifdef($ifdefs{$pident});
     }