Co-authored-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May 7 15:41:15 2026
(Merged from https://github.com/openssl/openssl/pull/31046)
# Compare DER; prefer shorter; if some length, use the "smaller" encoding.
sub obj_cmp
{
- my $A = defined($obj_len{$obj{$nid{$a}}}) ? $obj_len{$obj{$nid{$a}}} : 0;
- my $B = defined($obj_len{$obj{$nid{$b}}}) ? $obj_len{$obj{$nid{$b}}} : 0;
+ my $A = $obj_len{$obj{$nid{$a}}} // 0;
+ my $B = $obj_len{$obj{$nid{$b}}} // 0;
my $r = $A - $B;
return $r if $r != 0;
return 0 if $A == 0;