Changeset 94082 in vbox for trunk/src/libs/openssl-3.0.1/apps/version.c
- Timestamp:
- Mar 3, 2022 7:17:34 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150325
- Location:
- trunk/src/libs/openssl-3.0.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/openssl-3.0.1
- Property svn:mergeinfo
-
old new 12 12 /vendor/openssl/1.1.1c:131722-131725 13 13 /vendor/openssl/1.1.1k:145841-145843 14 /vendor/openssl/3.0.1:150323-150324 15 /vendor/openssl/current:147554-150322
-
- Property svn:mergeinfo
-
trunk/src/libs/openssl-3.0.1/apps/version.c
r91772 r94082 1 1 /* 2 * Copyright 1995-20 18The OpenSSL Project Authors. All Rights Reserved.2 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. 3 3 * 4 * Licensed under the OpenSSL license(the "License"). You may not use4 * Licensed under the Apache License 2.0 (the "License"). You may not use 5 5 * this file except in compliance with the License. You can obtain a copy 6 6 * in the file LICENSE in the source distribution or at … … 16 16 #include <openssl/crypto.h> 17 17 #include <openssl/bn.h> 18 #ifndef OPENSSL_NO_MD219 # include <openssl/md2.h>20 #endif21 #ifndef OPENSSL_NO_RC422 # include <openssl/rc4.h>23 #endif24 #ifndef OPENSSL_NO_DES25 # include <openssl/des.h>26 #endif27 #ifndef OPENSSL_NO_IDEA28 # include <openssl/idea.h>29 #endif30 #ifndef OPENSSL_NO_BF31 # include <openssl/blowfish.h>32 #endif33 18 34 19 typedef enum OPTION_choice { 35 OPT_ ERR = -1, OPT_EOF = 0, OPT_HELP,36 OPT_B, OPT_D, OPT_E, OPT_ F, OPT_O, OPT_P, OPT_V, OPT_A, OPT_R20 OPT_COMMON, 21 OPT_B, OPT_D, OPT_E, OPT_M, OPT_F, OPT_O, OPT_P, OPT_V, OPT_A, OPT_R, OPT_C 37 22 } OPTION_CHOICE; 38 23 39 24 const OPTIONS version_options[] = { 25 OPT_SECTION("General"), 40 26 {"help", OPT_HELP, '-', "Display this summary"}, 27 28 OPT_SECTION("Output"), 41 29 {"a", OPT_A, '-', "Show all data"}, 42 30 {"b", OPT_B, '-', "Show build date"}, 43 31 {"d", OPT_D, '-', "Show configuration directory"}, 44 32 {"e", OPT_E, '-', "Show engines directory"}, 33 {"m", OPT_M, '-', "Show modules directory"}, 45 34 {"f", OPT_F, '-', "Show compiler flags used"}, 46 35 {"o", OPT_O, '-', "Show some internal datatype options"}, … … 48 37 {"r", OPT_R, '-', "Show random seeding options"}, 49 38 {"v", OPT_V, '-', "Show library version"}, 39 {"c", OPT_C, '-', "Show CPU settings info"}, 50 40 {NULL} 51 41 }; 52 53 #if defined(OPENSSL_RAND_SEED_DEVRANDOM) || defined(OPENSSL_RAND_SEED_EGD)54 static void printlist(const char *prefix, const char **dev)55 {56 printf("%s (", prefix);57 for ( ; *dev != NULL; dev++)58 printf(" \"%s\"", *dev);59 printf(" )");60 }61 #endif62 42 63 43 int version_main(int argc, char **argv) … … 65 45 int ret = 1, dirty = 0, seed = 0; 66 46 int cflags = 0, version = 0, date = 0, options = 0, platform = 0, dir = 0; 67 int engdir = 0 ;47 int engdir = 0, moddir = 0, cpuinfo = 0; 68 48 char *prog; 69 49 OPTION_CHOICE o; … … 90 70 dirty = engdir = 1; 91 71 break; 72 case OPT_M: 73 dirty = moddir = 1; 74 break; 92 75 case OPT_F: 93 76 dirty = cflags = 1; … … 105 88 dirty = version = 1; 106 89 break; 90 case OPT_C: 91 dirty = cpuinfo = 1; 92 break; 107 93 case OPT_A: 108 seed = options = cflags = version = date = platform = dir = engdir 94 seed = options = cflags = version = date = platform 95 = dir = engdir = moddir = cpuinfo 109 96 = 1; 110 97 break; 111 98 } 112 99 } 113 if (opt_num_rest() != 0) { 114 BIO_printf(bio_err, "Extra parameters given.\n"); 100 101 /* No extra arguments. */ 102 argc = opt_num_rest(); 103 if (argc != 0) 115 104 goto opthelp; 116 } 105 117 106 if (!dirty) 118 107 version = 1; 119 108 120 if (version) { 121 if (OpenSSL_version_num() == OPENSSL_VERSION_NUMBER) 122 printf("%s\n", OpenSSL_version(OPENSSL_VERSION)); 123 else 124 printf("%s (Library: %s)\n", 125 OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION)); 126 } 109 if (version) 110 printf("%s (Library: %s)\n", 111 OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION)); 127 112 if (date) 128 113 printf("%s\n", OpenSSL_version(OPENSSL_BUILT_ON)); … … 130 115 printf("%s\n", OpenSSL_version(OPENSSL_PLATFORM)); 131 116 if (options) { 132 printf("options: "); 133 printf("%s ", BN_options()); 134 #ifndef OPENSSL_NO_MD2 135 printf("%s ", MD2_options()); 136 #endif 137 #ifndef OPENSSL_NO_RC4 138 printf("%s ", RC4_options()); 139 #endif 140 #ifndef OPENSSL_NO_DES 141 printf("%s ", DES_options()); 142 #endif 143 #ifndef OPENSSL_NO_IDEA 144 printf("%s ", IDEA_options()); 145 #endif 146 #ifndef OPENSSL_NO_BF 147 printf("%s ", BF_options()); 148 #endif 117 printf("options: "); 118 printf(" %s", BN_options()); 149 119 printf("\n"); 150 120 } … … 155 125 if (engdir) 156 126 printf("%s\n", OpenSSL_version(OPENSSL_ENGINES_DIR)); 127 if (moddir) 128 printf("%s\n", OpenSSL_version(OPENSSL_MODULES_DIR)); 157 129 if (seed) { 158 printf("Seeding source:"); 159 #ifdef OPENSSL_RAND_SEED_RTDSC 160 printf(" rtdsc"); 161 #endif 162 #ifdef OPENSSL_RAND_SEED_RDCPU 163 printf(" rdrand ( rdseed rdrand )"); 164 #endif 165 #ifdef OPENSSL_RAND_SEED_LIBRANDOM 166 printf(" C-library-random"); 167 #endif 168 #ifdef OPENSSL_RAND_SEED_GETRANDOM 169 printf(" getrandom-syscall"); 170 #endif 171 #ifdef OPENSSL_RAND_SEED_DEVRANDOM 172 { 173 static const char *dev[] = { DEVRANDOM, NULL }; 174 printlist(" random-device", dev); 175 } 176 #endif 177 #ifdef OPENSSL_RAND_SEED_EGD 178 { 179 static const char *dev[] = { DEVRANDOM_EGD, NULL }; 180 printlist(" EGD", dev); 181 } 182 #endif 183 #ifdef OPENSSL_RAND_SEED_NONE 184 printf(" none"); 185 #endif 186 #ifdef OPENSSL_RAND_SEED_OS 187 printf(" os-specific"); 188 #endif 189 printf("\n"); 130 const char *src = OPENSSL_info(OPENSSL_INFO_SEED_SOURCE); 131 printf("Seeding source: %s\n", src ? src : "N/A"); 190 132 } 133 if (cpuinfo) 134 printf("%s\n", OpenSSL_version(OPENSSL_CPU_INFO)); 191 135 ret = 0; 192 136 end: 193 137 return ret; 194 138 } 139 140 141 #if defined(__TANDEM) && defined(OPENSSL_VPROC) 142 /* 143 * Define a VPROC function for the openssl program. 144 * This is used by platform version identification tools. 145 * Do not inline this procedure or make it static. 146 */ 147 # define OPENSSL_VPROC_STRING_(x) x##_OPENSSL 148 # define OPENSSL_VPROC_STRING(x) OPENSSL_VPROC_STRING_(x) 149 # define OPENSSL_VPROC_FUNC OPENSSL_VPROC_STRING(OPENSSL_VPROC) 150 void OPENSSL_VPROC_FUNC(void) {} 151 #endif
Note:
See TracChangeset
for help on using the changeset viewer.