diff options
author | Richard Levitte <levitte@openssl.org> | 2019-08-24 12:40:10 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-08-27 18:44:36 +0200 |
commit | 096978f09908ba0f679ff905b0db4861a57eb1c8 (patch) | |
tree | 68410e1446437b1a891a6036aa308e497459d479 /apps/version.c | |
parent | b5a276884b8e945815732845540af3c8143e8457 (diff) |
OPENSSL_info(): add the item OPENSSL_INFO_SEED_SOURCE and use it
'openssl version -r' prints the seed source based on compiler macros.
This does not necessarily reflect the library's idea of what seed
sources to use, so we reimplement the list of seed sources as a
OPENSSL_info() item and display that instead.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9689)
Diffstat (limited to 'apps/version.c')
-rw-r--r-- | apps/version.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/apps/version.c b/apps/version.c index 35bfb95c09..caa3e76ffe 100644 --- a/apps/version.c +++ b/apps/version.c @@ -157,40 +157,8 @@ opthelp: printf("%s\n", OpenSSL_version(OPENSSL_ENGINES_DIR)); if (moddir) printf("%s\n", OpenSSL_version(OPENSSL_MODULES_DIR)); - if (seed) { - printf("Seeding source:"); -#ifdef OPENSSL_RAND_SEED_RTDSC - printf(" rtdsc"); -#endif -#ifdef OPENSSL_RAND_SEED_RDCPU - printf(" rdrand ( rdseed rdrand )"); -#endif -#ifdef OPENSSL_RAND_SEED_LIBRANDOM - printf(" C-library-random"); -#endif -#ifdef OPENSSL_RAND_SEED_GETRANDOM - printf(" getrandom-syscall"); -#endif -#ifdef OPENSSL_RAND_SEED_DEVRANDOM - { - static const char *dev[] = { DEVRANDOM, NULL }; - printlist(" random-device", dev); - } -#endif -#ifdef OPENSSL_RAND_SEED_EGD - { - static const char *dev[] = { DEVRANDOM_EGD, NULL }; - printlist(" EGD", dev); - } -#endif -#ifdef OPENSSL_RAND_SEED_NONE - printf(" none"); -#endif -#ifdef OPENSSL_RAND_SEED_OS - printf(" os-specific"); -#endif - printf("\n"); - } + if (seed) + printf("Seeding source: %s\n", OPENSSL_info(OPENSSL_INFO_SEED_SOURCE)); ret = 0; end: return ret; |