Add support for RSA-PSS to X509_certificate_type()
[openssl.git] / crypto / objects / objects.pl
index 20f726d44fe8288a08c3d5ff6bc40f5107759c7a..8f9b67f95991ad015a5e26e4874f72a3d7de269a 100644 (file)
@@ -6,7 +6,12 @@
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
 
-# Output year depends on the year of the script and the input files.
+use Getopt::Std;
+
+our($opt_n);
+getopts('n');
+
+# Output year depends on the year of the script and the input file.
 my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
 my $iYEAR = [localtime([stat($ARGV[0])]->[9])]->[5] + 1900;
 $YEAR = $iYEAR if $iYEAR > $YEAR;
@@ -123,15 +128,15 @@ print STDERR "Added OID $Cname\n";
        }
 close IN;
 
-open (NUMOUT,">$ARGV[1]") || die "Can't open output file $ARGV[1]";
-foreach (sort { $a <=> $b } keys %nidn)
-       {
-       print NUMOUT $nidn{$_},"\t\t",$_,"\n";
-       }
-close NUMOUT;
+if ( $opt_n ) {
+    foreach (sort { $a <=> $b } keys %nidn)
+            {
+            print $nidn{$_},"\t\t",$_,"\n";
+            }
+    exit;
+}
 
-open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
-print OUT <<"EOF";
+print <<"EOF";
 /*
  * WARNING: do not edit!
  * Generated by crypto/objects/objects.pl
@@ -161,15 +166,13 @@ sub expand
 foreach (sort { $a <=> $b } keys %ordern)
        {
        $Cname=$ordern{$_};
-       print OUT "\n";
-       print OUT expand("#define SN_$Cname\t\t\"$sn{$Cname}\"\n") if $sn{$Cname} ne "";
-       print OUT expand("#define LN_$Cname\t\t\"$ln{$Cname}\"\n") if $ln{$Cname} ne "";
-       print OUT expand("#define NID_$Cname\t\t$nid{$Cname}\n") if $nid{$Cname} ne "";
-       print OUT expand("#define OBJ_$Cname\t\t$obj{$Cname}\n") if $obj{$Cname} ne "";
+       print "\n";
+       print expand("#define SN_$Cname\t\t\"$sn{$Cname}\"\n") if $sn{$Cname} ne "";
+       print expand("#define LN_$Cname\t\t\"$ln{$Cname}\"\n") if $ln{$Cname} ne "";
+       print expand("#define NID_$Cname\t\t$nid{$Cname}\n") if $nid{$Cname} ne "";
+       print expand("#define OBJ_$Cname\t\t$obj{$Cname}\n") if $obj{$Cname} ne "";
        }
 
-close OUT;
-
 sub process_oid
        {
        local($oid)=@_;