diff options
author | Rich Salz <rsalz@akamai.com> | 2020-03-04 22:52:22 +0100 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2020-04-10 15:24:02 +0200 |
commit | 1ae56f2f43d36618e54cbb8dd47a7107b74505b6 (patch) | |
tree | a2704c85168a338361457a3b9765fcb02d9d2bb3 /apps/pkcs12.c | |
parent | Fix krb5 external test (diff) | |
download | openssl-1ae56f2f43d36618e54cbb8dd47a7107b74505b6.tar.xz openssl-1ae56f2f43d36618e54cbb8dd47a7107b74505b6.zip |
Don't compile commands if disabled
Rather than wrapping whole files in "ifndef OPENSSL_NO_xxx" we handle
the changes in build.info
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/11250)
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r-- | apps/pkcs12.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c index c2448a74f5..f5ad949872 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -8,25 +8,22 @@ */ #include <openssl/opensslconf.h> -#if defined(OPENSSL_NO_DES) -NON_EMPTY_TRANSLATION_UNIT -#else -# include <stdio.h> -# include <stdlib.h> -# include <string.h> -# include "apps.h" -# include "progs.h" -# include <openssl/crypto.h> -# include <openssl/err.h> -# include <openssl/pem.h> -# include <openssl/pkcs12.h> - -# define NOKEYS 0x1 -# define NOCERTS 0x2 -# define INFO 0x4 -# define CLCERTS 0x8 -# define CACERTS 0x10 +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "apps.h" +#include "progs.h" +#include <openssl/crypto.h> +#include <openssl/err.h> +#include <openssl/pem.h> +#include <openssl/pkcs12.h> + +#define NOKEYS 0x1 +#define NOCERTS 0x2 +#define INFO 0x4 +#define CLCERTS 0x8 +#define CACERTS 0x10 #define PASSWD_BUF_SIZE 2048 @@ -64,9 +61,9 @@ typedef enum OPTION_choice { const OPTIONS pkcs12_options[] = { OPT_SECTION("General"), {"help", OPT_HELP, '-', "Display this summary"}, -# ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -# endif +#endif OPT_SECTION("CA"), {"CApath", OPT_CAPATH, '/', "PEM-format directory of CA's"}, @@ -112,15 +109,15 @@ const OPTIONS pkcs12_options[] = { {"keysig", OPT_KEYSIG, '-', "Set MS key signature type"}, OPT_SECTION("Encryption"), -# ifndef OPENSSL_NO_RC2 +#ifndef OPENSSL_NO_RC2 {"descert", OPT_DESCERT, '-', "Encrypt output with 3DES (default RC2-40)"}, {"certpbe", OPT_CERTPBE, 's', "Certificate PBE algorithm (default RC2-40)"}, -# else +#else {"descert", OPT_DESCERT, '-', "Encrypt output with 3DES (the default)"}, {"certpbe", OPT_CERTPBE, 's', "Certificate PBE algorithm (default 3DES)"}, -# endif +#endif {"iter", OPT_ITER, 'p', "Specify the iteration count for encryption key and MAC"}, {"noiter", OPT_NOITER, '-', "Don't use encryption key iteration"}, {"maciter", OPT_MACITER, '-', "Unused, kept for backwards compatibility"}, @@ -141,11 +138,11 @@ int pkcs12_main(int argc, char **argv) char pass[PASSWD_BUF_SIZE] = "", macpass[PASSWD_BUF_SIZE] = ""; int export_cert = 0, options = 0, chain = 0, twopass = 0, keytype = 0; int iter = PKCS12_DEFAULT_ITER, maciter = PKCS12_DEFAULT_ITER; -# ifndef OPENSSL_NO_RC2 +#ifndef OPENSSL_NO_RC2 int cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC; -# else +#else int cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; -# endif +#endif int key_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; int ret = 1, macver = 1, add_lmk = 0, private = 0; int noprompt = 0; @@ -1008,5 +1005,3 @@ static int set_pbe(int *ppbe, const char *str) } return 1; } - -#endif |