[openssl/openssl] 786d03: Make the generated params_idx.c file deterministic...

Shane noreply at github.com
Mon Mar 11 12:16:16 UTC 2024


  Branch: refs/heads/openssl-3.2
  Home:   https://github.com/openssl/openssl
  Commit: 786d03930cf04ee98be123113d0c76550b76018e
      https://github.com/openssl/openssl/commit/786d03930cf04ee98be123113d0c76550b76018e
  Author: slontis <shane.lontis at oracle.com>
  Date:   2024-03-11 (Mon, 11 Mar 2024)

  Changed paths:
    M util/perl/OpenSSL/paramnames.pm

  Log Message:
  -----------
  Make the generated params_idx.c file deterministic if run multiple
times.

Fixes #23672

There are many name/value pairs currently that have duplicate names e.g.

    'CAPABILITY_TLS_GROUP_MAX_TLS' =>           "tls-max-tls",
    'CAPABILITY_TLS_SIGALG_MAX_TLS' =>          "tls-max-tls",

Stripping the .pm file down to just the above entries and running
multiple times gives different results for the produce_decoder.

On multiple runs any iterations over the unordered hash table keys using
foreach my $name (keys %params) results in a different order on multiple
runs. Because of this the mapping from the hash 'value' back to the
'key' will be different.

Note that the code also uses another mechanism in places that uses
"name1" => "value"
"name2" => "*name1"
Rather than fix all the strings the change done was to sort the keys. If
we were to chose to fix the strings then the perl code should be changed
to detect duplicates.

Reviewed-by: Paul Dale <ppzgs1 at gmail.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Richard Levitte <levitte at openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove at arm.com>
(Merged from https://github.com/openssl/openssl/pull/23688)

(cherry picked from commit 5df34ca70a6edc4c0698a6e98add6450b9ce24ff)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications


More information about the openssl-commits mailing list