summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/apps.c
diff options
context:
space:
mode:
authortb <>2024-08-29 17:01:02 +0000
committertb <>2024-08-29 17:01:02 +0000
commit482529e0eb9abf923bbc35107ad61a209528d296 (patch)
tree7ea546b46cd3970f3bc3adc5466a9a5dc89fd00d /src/usr.bin/openssl/apps.c
parentde7d0ab1c83083dedcf2e492963189bc2ba71ef0 (diff)
downloadopenbsd-482529e0eb9abf923bbc35107ad61a209528d296.tar.gz
openbsd-482529e0eb9abf923bbc35107ad61a209528d296.tar.bz2
openbsd-482529e0eb9abf923bbc35107ad61a209528d296.zip
Remove check and pubcheck from openssl pkey and pkeyparam
The underlying API will be removed, so these commands have to go. ok beck
Diffstat (limited to 'src/usr.bin/openssl/apps.c')
-rw-r--r--src/usr.bin/openssl/apps.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c
index f58aa5365f..a04190910d 100644
--- a/src/usr.bin/openssl/apps.c
+++ b/src/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: apps.c,v 1.68 2024/08/18 20:24:11 tb Exp $ */ 1/* $OpenBSD: apps.c,v 1.69 2024/08/29 17:01:02 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -2156,31 +2156,3 @@ show_cipher(const OBJ_NAME *name, void *arg)
2156 2156
2157 fprintf(stderr, " -%-24s%s", name->name, (++*n % 3 != 0 ? "" : "\n")); 2157 fprintf(stderr, " -%-24s%s", name->name, (++*n % 3 != 0 ? "" : "\n"));
2158} 2158}
2159
2160int
2161pkey_check(BIO *out, EVP_PKEY *pkey, int (check_fn)(EVP_PKEY_CTX *),
2162 const char *desc)
2163{
2164 EVP_PKEY_CTX *ctx;
2165
2166 if ((ctx = EVP_PKEY_CTX_new(pkey, NULL)) == NULL) {
2167 ERR_print_errors(bio_err);
2168 return 0;
2169 }
2170
2171 if (check_fn(ctx) == 1) {
2172 BIO_printf(out, "%s valid\n", desc);
2173 } else {
2174 unsigned long err;
2175
2176 BIO_printf(out, "%s invalid\n", desc);
2177
2178 while ((err = ERR_get_error()) != 0)
2179 BIO_printf(out, "Detailed error: %s\n",
2180 ERR_reason_error_string(err));
2181 }
2182
2183 EVP_PKEY_CTX_free(ctx);
2184
2185 return 1;
2186}