Get rid of warn_binary
[openssl.git] / apps / progs.pl
index add4e674992d34d4baeeb745cd1f1f86d37e3886..8a5759a961cbed23c17c63d5fe22b4e26cfcebcf 100644 (file)
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -28,7 +28,8 @@ my $YEAR         = [localtime()]->[5] + 1900;
 # the lookups in %unified_info
 my @openssl_source =
     map { @{$unified_info{sources}->{$_}} }
-    grep { /\.o$/ }
+    grep { /\.o$/
+           && !$unified_info{attributes}->{sources}->{$apps_openssl}->{$_}->{nocheck} }
         @{$unified_info{sources}->{$apps_openssl}};
 
 foreach my $filename (@openssl_source) {
@@ -98,23 +99,21 @@ EOF
         gendh    => "dh",
         dhparam  => "dh",
         ecparam  => "ec",
-        pkcs12   => "des",
     );
     my %cmd_deprecated = (
 # The format of this table is:
-#   [0] = 0/1, 1 means deprecated and gone, 0 is deprecated but still present
-#   [1] = alternative command to use instead
-#   [2] = deprecented in this version
-#   [3] = preprocessor conditional for exclusing irrespective of deprecation
-        rsa      => [ 0, "pkey",      "3_0", "rsa" ],
-        genrsa   => [ 1, "genpkey",   "3_0", "rsa" ],
-        rsautl   => [ 0, "pkeyutl",   "3_0", "rsa" ],
-        dhparam  => [ 1, "pkeyparam", "3_0", "dh"  ],
-        dsaparam => [ 1, "pkeyparam", "3_0", "dsa" ],
-        dsa      => [ 0, "pkey",      "3_0", "dsa" ],
-        gendsa   => [ 1, "genpkey",   "3_0", "dsa" ],
-        ec       => [ 0, "pkey",      "3_0", "ec"  ],
-        ecparam  => [ 0, "pkeyparam", "3_0", "ec"  ],
+#   [0] = alternative command to use instead
+#   [1] = deprecented in this version
+#   [2] = preprocessor conditional for exclusing irrespective of deprecation
+#        rsa      => [ "pkey",      "3_0", "rsa" ],
+#        genrsa   => [ "genpkey",   "3_0", "rsa" ],
+        rsautl   => [ "pkeyutl",   "3_0", "rsa" ],
+#        dhparam  => [ "pkeyparam", "3_0", "dh"  ],
+#        dsaparam => [ "pkeyparam", "3_0", "dsa" ],
+#        dsa      => [ "pkey",      "3_0", "dsa" ],
+#        gendsa   => [ "genpkey",   "3_0", "dsa" ],
+#        ec       => [ "pkey",      "3_0", "ec"  ],
+#        ecparam  => [ "pkeyparam", "3_0", "ec"  ],
     );
 
     print "FUNCTION functions[] = {\n";
@@ -125,18 +124,16 @@ EOF
             print "#ifndef OPENSSL_NO_SOCK\n${str}#endif\n";
         } elsif (my $deprecated = $cmd_deprecated{$cmd}) {
             my @dep = @{$deprecated};
-            print "#if ";
-            if ($dep[0]) {
-                print "!defined(OPENSSL_NO_DEPRECATED_" . $dep[2] . ")";
+            my $daltprg = $dep[0];
+            my $dver = $dep[1];
+            my $dsys = $dep[2];
+            print "#if !defined(OPENSSL_NO_DEPRECATED_" . $dver . ")";
+            if ($dsys) {
+                print " && !defined(OPENSSL_NO_" . uc($dsys) . ")";
             }
-            if ($dep[3]) {
-                if ($dep[0]) {
-                    print " && ";
-                }
-                print "!defined(OPENSSL_NO_" . uc($dep[3]) . ")";
-            }
-            my $dalt = "\"" . $dep[1] . "\"";
-            $str =~ s/NULL/$dalt/;
+            $dver =~ s/_/./g;
+            my $dalt = "\"" . $daltprg . "\", \"" . $dver . "\"";
+            $str =~ s/NULL, NULL/$dalt/;
             print "\n${str}#endif\n";
         } elsif (grep { $cmd eq $_ } @disablables) {
             print "#ifndef OPENSSL_NO_" . uc($cmd) . "\n${str}#endif\n";
@@ -153,7 +150,6 @@ EOF
     );
     foreach my $cmd (
         "md2", "md4", "md5",
-        "gost",
         "sha1", "sha224", "sha256", "sha384",
         "sha512", "sha512-224", "sha512-256",
         "sha3-224", "sha3-256", "sha3-384", "sha3-512",