summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-07-23 11:20:11 +0000
committertb <>2023-07-23 11:20:11 +0000
commita50c7c74b92512423af455aa73f495ebf050f4a3 (patch)
treef07e7db5afdc1f539d999e6a3cb6c69ceb2716f9
parent729e35d2be4f278d1700e348499088f1b459db97 (diff)
downloadopenbsd-a50c7c74b92512423af455aa73f495ebf050f4a3.tar.gz
openbsd-a50c7c74b92512423af455aa73f495ebf050f4a3.tar.bz2
openbsd-a50c7c74b92512423af455aa73f495ebf050f4a3.zip
Remove -stats option from openssl(1) errstr.
This is the only consumer of ERR_get_string_table(), which will go away. ok jsing
-rw-r--r--src/usr.bin/openssl/errstr.c35
-rw-r--r--src/usr.bin/openssl/openssl.111
2 files changed, 5 insertions, 41 deletions
diff --git a/src/usr.bin/openssl/errstr.c b/src/usr.bin/openssl/errstr.c
index cb7cf1d5a3..d4ffd70c39 100644
--- a/src/usr.bin/openssl/errstr.c
+++ b/src/usr.bin/openssl/errstr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: errstr.c,v 1.10 2023/03/06 14:32:06 tb Exp $ */ 1/* $OpenBSD: errstr.c,v 1.11 2023/07/23 11:20:11 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -68,25 +68,14 @@
68#include <openssl/lhash.h> 68#include <openssl/lhash.h>
69#include <openssl/ssl.h> 69#include <openssl/ssl.h>
70 70
71static struct {
72 int stats;
73} cfg;
74
75static const struct option errstr_options[] = { 71static const struct option errstr_options[] = {
76 {
77 .name = "stats",
78 .desc = "Print debugging statistics for the hash table",
79 .type = OPTION_FLAG,
80 .opt.flag = &cfg.stats,
81 },
82 { NULL }, 72 { NULL },
83}; 73};
84 74
85static void 75static void
86errstr_usage() 76errstr_usage(void)
87{ 77{
88 fprintf(stderr, "usage: errstr [-stats] errno ...\n"); 78 fprintf(stderr, "usage: errstr errno ...\n");
89 options_usage(errstr_options);
90} 79}
91 80
92int 81int
@@ -103,29 +92,11 @@ errstr_main(int argc, char **argv)
103 exit(1); 92 exit(1);
104 } 93 }
105 94
106 memset(&cfg, 0, sizeof(cfg));
107
108 if (options_parse(argc, argv, errstr_options, NULL, &argsused) != 0) { 95 if (options_parse(argc, argv, errstr_options, NULL, &argsused) != 0) {
109 errstr_usage(); 96 errstr_usage();
110 return (1); 97 return (1);
111 } 98 }
112 99
113 if (cfg.stats) {
114 BIO *out;
115
116 if ((out = BIO_new_fp(stdout, BIO_NOCLOSE)) == NULL) {
117 fprintf(stderr, "Out of memory");
118 return (1);
119 }
120
121 lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(), out);
122 lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), out);
123 lh_ERR_STRING_DATA_node_usage_stats_bio(
124 ERR_get_string_table(), out);
125
126 BIO_free_all(out);
127 }
128
129 for (i = argsused; i < argc; i++) { 100 for (i = argsused; i < argc; i++) {
130 errno = 0; 101 errno = 0;
131 ularg = argv[i]; 102 ularg = argv[i];
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index 4023061d16..da4c4ffefc 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.150 2023/07/03 08:37:22 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.151 2023/07/23 11:20:11 tb Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -110,7 +110,7 @@
110.\" copied and put under another distribution licence 110.\" copied and put under another distribution licence
111.\" [including the GNU Public Licence.] 111.\" [including the GNU Public Licence.]
112.\" 112.\"
113.Dd $Mdocdate: July 3 2023 $ 113.Dd $Mdocdate: July 23 2023 $
114.Dt OPENSSL 1 114.Dt OPENSSL 1
115.Os 115.Os
116.Sh NAME 116.Sh NAME
@@ -2300,7 +2300,6 @@ Print extra details about the processing.
2300.Tg errstr 2300.Tg errstr
2301.Sh ERRSTR 2301.Sh ERRSTR
2302.Nm openssl errstr 2302.Nm openssl errstr
2303.Op Fl stats
2304.Ar errno ... 2303.Ar errno ...
2305.Pp 2304.Pp
2306The 2305The
@@ -2322,12 +2321,6 @@ The remaining fields
2322and 2321and
2323.Bq reason string 2322.Bq reason string
2324are all ASCII text. 2323are all ASCII text.
2325.Pp
2326The options are as follows:
2327.Bl -tag -width Ds
2328.It Fl stats
2329Print debugging statistics about various aspects of the hash table.
2330.El
2331.Tg gendsa 2324.Tg gendsa
2332.Sh GENDSA 2325.Sh GENDSA
2333.Bl -hang -width "openssl gendsa" 2326.Bl -hang -width "openssl gendsa"