From 3228b0c4b8598ac2f799f997d457a8ba24307bec Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 23 Jul 2023 11:20:11 +0000 Subject: [PATCH] Remove -stats option from openssl(1) errstr. This is the only consumer of ERR_get_string_table(), which will go away. ok jsing --- usr.bin/openssl/errstr.c | 35 +++-------------------------------- usr.bin/openssl/openssl.1 | 11 ++--------- 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/usr.bin/openssl/errstr.c b/usr.bin/openssl/errstr.c index cb7cf1d5a34..d4ffd70c399 100644 --- a/usr.bin/openssl/errstr.c +++ b/usr.bin/openssl/errstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: errstr.c,v 1.10 2023/03/06 14:32:06 tb Exp $ */ +/* $OpenBSD: errstr.c,v 1.11 2023/07/23 11:20:11 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -68,25 +68,14 @@ #include #include -static struct { - int stats; -} cfg; - static const struct option errstr_options[] = { - { - .name = "stats", - .desc = "Print debugging statistics for the hash table", - .type = OPTION_FLAG, - .opt.flag = &cfg.stats, - }, { NULL }, }; static void -errstr_usage() +errstr_usage(void) { - fprintf(stderr, "usage: errstr [-stats] errno ...\n"); - options_usage(errstr_options); + fprintf(stderr, "usage: errstr errno ...\n"); } int @@ -103,29 +92,11 @@ errstr_main(int argc, char **argv) exit(1); } - memset(&cfg, 0, sizeof(cfg)); - if (options_parse(argc, argv, errstr_options, NULL, &argsused) != 0) { errstr_usage(); return (1); } - if (cfg.stats) { - BIO *out; - - if ((out = BIO_new_fp(stdout, BIO_NOCLOSE)) == NULL) { - fprintf(stderr, "Out of memory"); - return (1); - } - - lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(), out); - lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), out); - lh_ERR_STRING_DATA_node_usage_stats_bio( - ERR_get_string_table(), out); - - BIO_free_all(out); - } - for (i = argsused; i < argc; i++) { errno = 0; ularg = argv[i]; diff --git a/usr.bin/openssl/openssl.1 b/usr.bin/openssl/openssl.1 index 4023061d165..da4c4ffefc5 100644 --- a/usr.bin/openssl/openssl.1 +++ b/usr.bin/openssl/openssl.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: openssl.1,v 1.150 2023/07/03 08:37:22 jmc Exp $ +.\" $OpenBSD: openssl.1,v 1.151 2023/07/23 11:20:11 tb Exp $ .\" ==================================================================== .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. .\" @@ -110,7 +110,7 @@ .\" copied and put under another distribution licence .\" [including the GNU Public Licence.] .\" -.Dd $Mdocdate: July 3 2023 $ +.Dd $Mdocdate: July 23 2023 $ .Dt OPENSSL 1 .Os .Sh NAME @@ -2300,7 +2300,6 @@ Print extra details about the processing. .Tg errstr .Sh ERRSTR .Nm openssl errstr -.Op Fl stats .Ar errno ... .Pp The @@ -2322,12 +2321,6 @@ The remaining fields and .Bq reason string are all ASCII text. -.Pp -The options are as follows: -.Bl -tag -width Ds -.It Fl stats -Print debugging statistics about various aspects of the hash table. -.El .Tg gendsa .Sh GENDSA .Bl -hang -width "openssl gendsa" -- 2.20.1