From dab2cd68e7cc304c9b1a4e7cee18a98711771a53 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 31 Jan 2018 11:13:10 +0100 Subject: [PATCH] apps: Don't include progs.h in apps.h Everything in apps includes apps.h, because that one declares apps internal library routines. However, progs.h doesn't declare library routines, but rather the main commands and their options, and there's no reason why the library modules should include it. So, remove the inclusion of progs.h from apps.h and add that inclusion in all command source files. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5222) --- apps/apps.h | 2 -- apps/asn1pars.c | 1 + apps/ca.c | 1 + apps/ciphers.c | 1 + apps/cms.c | 1 + apps/crl.c | 1 + apps/crl2p7.c | 1 + apps/dgst.c | 1 + apps/dhparam.c | 1 + apps/dsa.c | 1 + apps/dsaparam.c | 1 + apps/ec.c | 1 + apps/ecparam.c | 1 + apps/enc.c | 1 + apps/engine.c | 1 + apps/errstr.c | 1 + apps/gendsa.c | 1 + apps/genpkey.c | 1 + apps/genrsa.c | 1 + apps/nseq.c | 1 + apps/ocsp.c | 1 + apps/openssl.c | 3 ++- apps/passwd.c | 1 + apps/pkcs12.c | 1 + apps/pkcs7.c | 1 + apps/pkcs8.c | 1 + apps/pkey.c | 1 + apps/pkeyparam.c | 1 + apps/pkeyutl.c | 1 + apps/prime.c | 1 + apps/rand.c | 1 + apps/rehash.c | 1 + apps/req.c | 1 + apps/rsa.c | 1 + apps/rsautl.c | 1 + apps/s_client.c | 1 + apps/s_server.c | 1 + apps/s_time.c | 1 + apps/sess_id.c | 1 + apps/smime.c | 1 + apps/speed.c | 1 + apps/spkac.c | 1 + apps/srp.c | 1 + apps/storeutl.c | 1 + apps/ts.c | 1 + apps/verify.c | 1 + apps/version.c | 1 + apps/x509.c | 1 + 48 files changed, 48 insertions(+), 3 deletions(-) diff --git a/apps/apps.h b/apps/apps.h index 601797b1b6..a740ad4599 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -600,6 +600,4 @@ typedef struct verify_options_st { extern VERIFY_CB_ARGS verify_args; -# include "progs.h" - #endif diff --git a/apps/asn1pars.c b/apps/asn1pars.c index 56a9adc2ff..f1d3211626 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/ca.c b/apps/ca.c index 9b1d9bdaac..477d8b4aa0 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -32,6 +32,7 @@ #endif #include "apps.h" +#include "progs.h" #ifndef W_OK # define F_OK 0 diff --git a/apps/ciphers.c b/apps/ciphers.c index d171b865eb..744589da84 100644 --- a/apps/ciphers.c +++ b/apps/ciphers.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include diff --git a/apps/cms.c b/apps/cms.c index 45ab259706..e9d760c999 100644 --- a/apps/cms.c +++ b/apps/cms.c @@ -12,6 +12,7 @@ #include #include #include "apps.h" +#include "progs.h" #ifndef OPENSSL_NO_CMS diff --git a/apps/crl.c b/apps/crl.c index 5e1f109a6b..c81c323315 100644 --- a/apps/crl.c +++ b/apps/crl.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/crl2p7.c b/apps/crl2p7.c index 79217e9efc..282e3cc5fb 100644 --- a/apps/crl2p7.c +++ b/apps/crl2p7.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/dgst.c b/apps/dgst.c index ba63e123de..80e8e843b2 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/dhparam.c b/apps/dhparam.c index 2a78ce28fc..82ecc94a8f 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -17,6 +17,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/dsa.c b/apps/dsa.c index 74a68ff64b..e9b6f05ca9 100644 --- a/apps/dsa.c +++ b/apps/dsa.c @@ -17,6 +17,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/dsaparam.c b/apps/dsaparam.c index ff66fcc64c..69a85aa2f6 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -17,6 +17,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/ec.c b/apps/ec.c index 6fc6a6f625..c9d7ded070 100644 --- a/apps/ec.c +++ b/apps/ec.c @@ -16,6 +16,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/ecparam.c b/apps/ecparam.c index 1f3770e284..5e6ee2a3b4 100644 --- a/apps/ecparam.c +++ b/apps/ecparam.c @@ -18,6 +18,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/enc.c b/apps/enc.c index af882598cc..5153251b31 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -12,6 +12,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/engine.c b/apps/engine.c index 8ada13dce5..328fe1ff76 100644 --- a/apps/engine.c +++ b/apps/engine.c @@ -13,6 +13,7 @@ NON_EMPTY_TRANSLATION_UNIT #else # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/errstr.c b/apps/errstr.c index 3ce4acf744..af33a68c8c 100644 --- a/apps/errstr.c +++ b/apps/errstr.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/gendsa.c b/apps/gendsa.c index c57511cfa1..14bfeacd8f 100644 --- a/apps/gendsa.c +++ b/apps/gendsa.c @@ -17,6 +17,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/genpkey.c b/apps/genpkey.c index 469ea1c943..7e7a1cc293 100644 --- a/apps/genpkey.c +++ b/apps/genpkey.c @@ -10,6 +10,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/genrsa.c b/apps/genrsa.c index f147852902..93df823083 100644 --- a/apps/genrsa.c +++ b/apps/genrsa.c @@ -17,6 +17,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/nseq.c b/apps/nseq.c index 82850b8118..fe6eab8c60 100644 --- a/apps/nseq.c +++ b/apps/nseq.c @@ -10,6 +10,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include diff --git a/apps/ocsp.c b/apps/ocsp.c index 4a68e52d74..122aee6770 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -25,6 +25,7 @@ NON_EMPTY_TRANSLATION_UNIT /* Needs to be included before the openssl headers */ # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/openssl.c b/apps/openssl.c index 8b75a8affb..fe1eabdede 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -27,8 +27,9 @@ #ifdef OPENSSL_SYS_VMS # include #endif -#define INCLUDE_FUNCTION_TABLE #include "apps.h" +#define INCLUDE_FUNCTION_TABLE +#include "progs.h" /* Structure to hold the number of columns to be displayed and the * field width used to display them. diff --git a/apps/passwd.c b/apps/passwd.c index 85e7a6ebcd..a01f1e7dcd 100644 --- a/apps/passwd.c +++ b/apps/passwd.c @@ -10,6 +10,7 @@ #include #include "apps.h" +#include "progs.h" #include #include diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 6a2f7c0043..1a353e169d 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -16,6 +16,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/pkcs7.c b/apps/pkcs7.c index 8dc77927f1..afeae64fba 100644 --- a/apps/pkcs7.c +++ b/apps/pkcs7.c @@ -12,6 +12,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/pkcs8.c b/apps/pkcs8.c index dfc23e5b59..ca6ab0156f 100644 --- a/apps/pkcs8.c +++ b/apps/pkcs8.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/pkey.c b/apps/pkey.c index 6160e5a381..0e961dd95e 100644 --- a/apps/pkey.c +++ b/apps/pkey.c @@ -10,6 +10,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/pkeyparam.c b/apps/pkeyparam.c index 35cdd8dc92..b3c610b2f3 100644 --- a/apps/pkeyparam.c +++ b/apps/pkeyparam.c @@ -10,6 +10,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c index 07646c8639..e24782fc52 100644 --- a/apps/pkeyutl.c +++ b/apps/pkeyutl.c @@ -8,6 +8,7 @@ */ #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/prime.c b/apps/prime.c index 9aa32d02b0..27f4e2849b 100644 --- a/apps/prime.c +++ b/apps/prime.c @@ -10,6 +10,7 @@ #include #include "apps.h" +#include "progs.h" #include typedef enum OPTION_choice { diff --git a/apps/rand.c b/apps/rand.c index 0ab22a99c8..b9f4598f66 100644 --- a/apps/rand.c +++ b/apps/rand.c @@ -8,6 +8,7 @@ */ #include "apps.h" +#include "progs.h" #include #include diff --git a/apps/rehash.c b/apps/rehash.c index c14bce4007..e049bfeb49 100644 --- a/apps/rehash.c +++ b/apps/rehash.c @@ -9,6 +9,7 @@ */ #include "apps.h" +#include "progs.h" #if defined(OPENSSL_SYS_UNIX) || defined(__APPLE__) || \ (defined(__VMS) && defined(__DECC) && __CRTL_VER >= 80300000) diff --git a/apps/req.c b/apps/req.c index dca6038a28..f67f93a1f7 100644 --- a/apps/req.c +++ b/apps/req.c @@ -12,6 +12,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/rsa.c b/apps/rsa.c index 698c046437..d7a5ab8da9 100644 --- a/apps/rsa.c +++ b/apps/rsa.c @@ -17,6 +17,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/rsautl.c b/apps/rsautl.c index ca9cb791c7..f146a489a9 100644 --- a/apps/rsautl.c +++ b/apps/rsautl.c @@ -13,6 +13,7 @@ NON_EMPTY_TRANSLATION_UNIT #else # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/s_client.c b/apps/s_client.c index 814a52a934..774345e256 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -30,6 +30,7 @@ typedef unsigned int u_int; #endif #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/s_server.c b/apps/s_server.c index bbe44f79a4..f124b12a48 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -37,6 +37,7 @@ typedef unsigned int u_int; #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/s_time.c b/apps/s_time.c index 7e24988721..b5c8b6324f 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -18,6 +18,7 @@ #ifndef OPENSSL_NO_SOCK #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/sess_id.c b/apps/sess_id.c index f0c76b1917..838a63d4e6 100644 --- a/apps/sess_id.c +++ b/apps/sess_id.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/smime.c b/apps/smime.c index 43d63704f9..1c00b0f439 100644 --- a/apps/smime.c +++ b/apps/smime.c @@ -12,6 +12,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/speed.c b/apps/speed.c index db4b14fab6..c59f266fc9 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -20,6 +20,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/spkac.c b/apps/spkac.c index c0817517c2..eeee6e398e 100644 --- a/apps/spkac.c +++ b/apps/spkac.c @@ -12,6 +12,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/srp.c b/apps/srp.c index b8fcf71609..123b5579b0 100644 --- a/apps/srp.c +++ b/apps/srp.c @@ -22,6 +22,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # define BASE_SECTION "srp" # define CONFIG_FILE "openssl.cnf" diff --git a/apps/storeutl.c b/apps/storeutl.c index 77f0f3f0f5..55a11e594d 100644 --- a/apps/storeutl.c +++ b/apps/storeutl.c @@ -10,6 +10,7 @@ #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/ts.c b/apps/ts.c index 96da50e51e..13cca9e025 100644 --- a/apps/ts.c +++ b/apps/ts.c @@ -15,6 +15,7 @@ NON_EMPTY_TRANSLATION_UNIT # include # include # include "apps.h" +# include "progs.h" # include # include # include diff --git a/apps/verify.c b/apps/verify.c index 1dccf76130..765782e9c8 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/version.c b/apps/version.c index 7fc9a27d67..5066482a07 100644 --- a/apps/version.c +++ b/apps/version.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include diff --git a/apps/x509.c b/apps/x509.c index 001c3959aa..7803124729 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -11,6 +11,7 @@ #include #include #include "apps.h" +#include "progs.h" #include #include #include