2 # Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
15 my ($mac_file, $xref_file) = @ARGV;
17 open(IN, $mac_file) || die "Can't open $mac_file, $!\n";
19 # Read in OID nid values for a lookup table.
23 s|\R$||; # Better chomp
24 my ($name, $num) = /^(\S+)\s+(\S+)$/;
25 $oid_tbl{$name} = $num;
29 open(IN, $xref_file) || die "Can't open $xref_file, $!\n";
35 s|\R$||; # Better chomp
38 my ($xr, $p1, $p2) = /^(\S+)\s+(\S+)\s+(\S+)/;
42 $xref_tbl{$xr} = [$p1, $p2, $ln];
45 my @xrkeys = keys %xref_tbl;
47 my @srt1 = sort { $oid_tbl{$a} <=> $oid_tbl{$b}} @xrkeys;
50 for($i = 0; $i <= $#srt1; $i++)
52 $xref_tbl{$srt1[$i]}[2] = $i;
57 my$ap1 = $oid_tbl{$xref_tbl{$a}[0]};
58 my$bp1 = $oid_tbl{$xref_tbl{$b}[0]};
59 return $ap1 - $bp1 if ($ap1 != $bp1);
60 my$ap2 = $oid_tbl{$xref_tbl{$a}[1]};
61 my$bp2 = $oid_tbl{$xref_tbl{$b}[1]};
71 * WARNING: do not edit!
74 * Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved.
76 * Licensed under the OpenSSL license (the "License"). You may not use
77 * this file except in compliance with the License. You can obtain a copy
78 * in the file LICENSE in the source distribution or at
79 * https://www.openssl.org/source/license.html
89 DEFINE_STACK_OF(nid_triple)
91 static const nid_triple sigoid_srt[] = {
97 my ($p1, $p2) = @{$xref_tbl{$_}};
98 my $o1 = " {NID_$xr, NID_$p1,";
100 if (length("$o1 $o2") < 78)
114 static const nid_triple *const sigoid_srt_xref[] = {
119 my ($p1, $p2, $x) = @{$xref_tbl{$_}};
120 # If digest or signature algorithm is "undef" then the algorithm
121 # needs special handling and is excluded from the cross reference table.
122 next if $p1 eq "undef" || $p2 eq "undef";
123 print " \&sigoid_srt\[$x\],\n";
131 if (!exists $oid_tbl{$chk})
133 die "Can't find \"$chk\"\n";