From a760a3805b49736632f14297a1c489290d4c1a6b Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 15 Sep 2015 15:29:02 +0100 Subject: [PATCH] Print out a list of disabled features. New option "openssl list -disabled" this lists a set of disabled features in a form which can be conveniently parsed by the test framework so it knows which tests to skip. Reviewed-by: Richard Levitte --- apps/openssl.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/apps/openssl.c b/apps/openssl.c index 58a2d0f700..e96c211d04 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -158,6 +158,7 @@ static LHASH_OF(FUNCTION) *prog_init(void); static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[]); static void list_pkey(void); static void list_type(FUNC_TYPE ft); +static void list_disabled(void); char *default_config_file = NULL; static CONF *config = NULL; @@ -479,7 +480,7 @@ typedef enum HELPLIST_CHOICE { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, OPT_COMMANDS, OPT_DIGEST_COMMANDS, OPT_DIGEST_ALGORITHMS, OPT_CIPHER_COMMANDS, OPT_CIPHER_ALGORITHMS, - OPT_PK_ALGORITHMS + OPT_PK_ALGORITHMS, OPT_DISABLED } HELPLIST_CHOICE; OPTIONS list_options[] = { @@ -494,6 +495,8 @@ OPTIONS list_options[] = { "List of cipher algorithms"}, {"public-key-algorithms", OPT_PK_ALGORITHMS, '-', "List of public key algorithms"}, + {"disabled", OPT_DISABLED, '-', + "List of disabled features"}, {NULL} }; @@ -530,6 +533,9 @@ int list_main(int argc, char **argv) case OPT_PK_ALGORITHMS: list_pkey(); break; + case OPT_DISABLED: + list_disabled(); + break; } } @@ -714,6 +720,35 @@ static int SortFnByName(const void *_f1, const void *_f2) return strcmp(f1->name, f2->name); } +static void list_disabled(void) +{ +BIO_puts(bio_out, "Disabled algorithms:\n"); +#ifdef OPENSSL_NO_DH + BIO_puts(bio_out, "DH\n"); +#endif +#ifdef OPENSSL_NO_DSA + BIO_puts(bio_out, "DSA\n"); +#endif +#ifdef OPENSSL_NO_RSA + BIO_puts(bio_out, "RSA\n"); +#endif +#ifdef OPENSSL_NO_EC + BIO_puts(bio_out, "EC\n"); +#endif +#ifdef OPENSSL_NO_EC2M + BIO_puts(bio_out, "EC2M\n"); +#endif +#ifndef ZLIB + BIO_puts(bio_out, "ZLIB\n"); +#endif +#ifdef OPENSSL_NO_PSK + BIO_puts(bio_out, "PSK\n"); +#endif +#ifdef OPENSSL_NO_SRP + BIO_puts(bio_out, "SRP\n"); +#endif +} + static LHASH_OF(FUNCTION) *prog_init(void) { LHASH_OF(FUNCTION) *ret; -- 2.25.1