diff options
| author | tb <> | 2023-07-23 11:20:11 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-23 11:20:11 +0000 |
| commit | 91e5b3ea5555b90293adb136335a30f71b62b6ec (patch) | |
| tree | f07e7db5afdc1f539d999e6a3cb6c69ceb2716f9 /src/usr.bin/openssl/errstr.c | |
| parent | 3a42767608796b85d23feb072c21b21446462ca2 (diff) | |
| download | openbsd-91e5b3ea5555b90293adb136335a30f71b62b6ec.tar.gz openbsd-91e5b3ea5555b90293adb136335a30f71b62b6ec.tar.bz2 openbsd-91e5b3ea5555b90293adb136335a30f71b62b6ec.zip | |
Remove -stats option from openssl(1) errstr.
This is the only consumer of ERR_get_string_table(), which will go away.
ok jsing
Diffstat (limited to 'src/usr.bin/openssl/errstr.c')
| -rw-r--r-- | src/usr.bin/openssl/errstr.c | 35 |
1 files changed, 3 insertions, 32 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 | ||
| 71 | static struct { | ||
| 72 | int stats; | ||
| 73 | } cfg; | ||
| 74 | |||
| 75 | static const struct option errstr_options[] = { | 71 | static 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 | ||
| 85 | static void | 75 | static void |
| 86 | errstr_usage() | 76 | errstr_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 | ||
| 92 | int | 81 | int |
| @@ -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]; |
