Add PSS algorithm printing. This is an initial step towards full PSS support.
[openssl.git] / crypto / objects / objects.pl
index 04fcdec2070a2e97502dcf2016c55fc423c4ebc5..15c00bbd526997144e6304a31a085638f5e5add2 100644 (file)
@@ -9,9 +9,13 @@ while(<NUMIN>)
        $o++;
        s/#.*$//;
        next if /^\s*$/;
+       $_ = 'X'.$_;
        ($Cname,$mynum) = split;
+       $Cname =~ s/^X//;
        if (defined($nidn{$mynum}))
                { die "$ARGV[1]:$o:There's already an object with NID ",$mynum," on line ",$order{$mynum},"\n"; }
+       if (defined($nid{$Cname}))
+               { die "$ARGV[1]:$o:There's already an object with name ",$Cname," on line ",$order{$nid{$Cname}},"\n"; }
        $nid{$Cname} = $mynum;
        $nidn{$mynum} = $Cname;
        $order{$mynum} = $o;
@@ -100,6 +104,7 @@ while (<IN>)
                $max_nid++;
                $nid{$Cname} = $max_nid;
                $nidn{$max_nid} = $Cname;
+print STDERR "Added OID $Cname\n";
                }
        $Cname="";
        }
@@ -114,7 +119,13 @@ close NUMOUT;
 
 open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
 print OUT <<'EOF';
-/* lib/obj/obj_mac.h */
+/* crypto/objects/obj_mac.h */
+
+/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
+ * following command:
+ * perl objects.pl objects.txt obj_mac.num obj_mac.h
+ */
+
 /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -172,11 +183,6 @@ print OUT <<'EOF';
  * [including the GNU Public Licence.]
  */
 
-/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
- * following command:
- * perl objects.pl objects.txt obj_mac.num obj_mac.h
- */
-
 #define SN_undef                       "UNDEF"
 #define LN_undef                       "undefined"
 #define NID_undef                      0
@@ -203,11 +209,24 @@ sub process_oid
 
        @a = split(/\s+/,$myoid);
        $pref_oid = "";
+       $pref_sep = "";
        if (!($a[0] =~ /^[0-9]+$/))
                {
                $a[0] =~ s/-/_/g;
-               $pref_oid = "OBJ_" . $a[0] . ',';
+               if (!defined($obj{$a[0]}))
+                       { die "$ARGV[0]:$o:Undefined identifier ",$a[0],"\n"; }
+               $pref_oid = "OBJ_" . $a[0];
+               $pref_sep = ",";
                shift @a;
                }
-       return($pref_oid . join('L,',@a) . 'L');
+       $oids = join('L,',@a) . "L";
+       if ($oids ne "L")
+               {
+               $oids = $pref_oid . $pref_sep . $oids;
+               }
+       else
+               {
+               $oids = $pref_oid;
+               }
+       return($oids);
        }