=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/version.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/openssl/version.c 2022/11/11 17:07:39 1.10 --- src/usr.bin/openssl/version.c 2023/03/06 14:32:06 1.11 *************** *** 1,4 **** ! /* $OpenBSD: version.c,v 1.10 2022/11/11 17:07:39 joshua Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * --- 1,4 ---- ! /* $OpenBSD: version.c,v 1.11 2023/03/06 14:32:06 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * *************** *** 142,158 **** int options; int platform; int version; ! } version_config; static int version_all_opts(void) { ! version_config.cflags = 1; ! version_config.date = 1; ! version_config.dir= 1; ! version_config.options = 1; ! version_config.platform = 1; ! version_config.version = 1; return (0); } --- 142,158 ---- int options; int platform; int version; ! } cfg; static int version_all_opts(void) { ! cfg.cflags = 1; ! cfg.date = 1; ! cfg.dir= 1; ! cfg.options = 1; ! cfg.platform = 1; ! cfg.version = 1; return (0); } *************** *** 168,204 **** .name = "b", .desc = "Date the current version of OpenSSL was built", .type = OPTION_FLAG, ! .opt.flag = &version_config.date, }, { .name = "d", .desc = "OPENSSLDIR value", .type = OPTION_FLAG, ! .opt.flag = &version_config.dir, }, { .name = "f", .desc = "Compilation flags", .type = OPTION_FLAG, ! .opt.flag = &version_config.cflags, }, { .name = "o", .desc = "Option information", .type = OPTION_FLAG, ! .opt.flag = &version_config.options, }, { .name = "p", .desc = "Platform settings", .type = OPTION_FLAG, ! .opt.flag = &version_config.platform, }, { .name = "v", .desc = "Current OpenSSL version", .type = OPTION_FLAG, ! .opt.flag = &version_config.version, }, {NULL}, }; --- 168,204 ---- .name = "b", .desc = "Date the current version of OpenSSL was built", .type = OPTION_FLAG, ! .opt.flag = &cfg.date, }, { .name = "d", .desc = "OPENSSLDIR value", .type = OPTION_FLAG, ! .opt.flag = &cfg.dir, }, { .name = "f", .desc = "Compilation flags", .type = OPTION_FLAG, ! .opt.flag = &cfg.cflags, }, { .name = "o", .desc = "Option information", .type = OPTION_FLAG, ! .opt.flag = &cfg.options, }, { .name = "p", .desc = "Platform settings", .type = OPTION_FLAG, ! .opt.flag = &cfg.platform, }, { .name = "v", .desc = "Current OpenSSL version", .type = OPTION_FLAG, ! .opt.flag = &cfg.version, }, {NULL}, }; *************** *** 218,224 **** exit(1); } ! memset(&version_config, 0, sizeof(version_config)); if (options_parse(argc, argv, version_options, NULL, NULL) != 0) { version_usage(); --- 218,224 ---- exit(1); } ! memset(&cfg, 0, sizeof(cfg)); if (options_parse(argc, argv, version_options, NULL, NULL) != 0) { version_usage(); *************** *** 226,234 **** } if (argc == 1) ! version_config.version = 1; ! if (version_config.version) { if (SSLeay() == SSLEAY_VERSION_NUMBER) { printf("%s\n", SSLeay_version(SSLEAY_VERSION)); } else { --- 226,234 ---- } if (argc == 1) ! cfg.version = 1; ! if (cfg.version) { if (SSLeay() == SSLEAY_VERSION_NUMBER) { printf("%s\n", SSLeay_version(SSLEAY_VERSION)); } else { *************** *** 237,247 **** SSLeay_version(SSLEAY_VERSION)); } } ! if (version_config.date) printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON)); ! if (version_config.platform) printf("%s\n", SSLeay_version(SSLEAY_PLATFORM)); ! if (version_config.options) { printf("options: "); printf("%s ", BN_options()); #ifndef OPENSSL_NO_RC4 --- 237,247 ---- SSLeay_version(SSLEAY_VERSION)); } } ! if (cfg.date) printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON)); ! if (cfg.platform) printf("%s\n", SSLeay_version(SSLEAY_PLATFORM)); ! if (cfg.options) { printf("options: "); printf("%s ", BN_options()); #ifndef OPENSSL_NO_RC4 *************** *** 258,266 **** #endif printf("\n"); } ! if (version_config.cflags) printf("%s\n", SSLeay_version(SSLEAY_CFLAGS)); ! if (version_config.dir) printf("%s\n", SSLeay_version(SSLEAY_DIR)); return (0); --- 258,266 ---- #endif printf("\n"); } ! if (cfg.cflags) printf("%s\n", SSLeay_version(SSLEAY_CFLAGS)); ! if (cfg.dir) printf("%s\n", SSLeay_version(SSLEAY_DIR)); return (0);