diff options
author | 2019-02-09 06:27:37 +0000 | |
---|---|---|
committer | 2019-02-09 06:27:37 +0000 | |
commit | 4071f8002cf25851a867dc74d6d58cdc40d6a874 (patch) | |
tree | f001b70acffacb8ef7e07247fa15d7951f7ea0c8 | |
parent | major() and minor() are documented as returning unsigned, so do so (diff) | |
download | wireguard-openbsd-4071f8002cf25851a867dc74d6d58cdc40d6a874.tar.xz wireguard-openbsd-4071f8002cf25851a867dc74d6d58cdc40d6a874.zip |
Summarize the 4 same name functions and move it to apps.c
ok tb@ jsing@
-rw-r--r-- | usr.bin/openssl/apps.c | 14 | ||||
-rw-r--r-- | usr.bin/openssl/apps.h | 4 | ||||
-rw-r--r-- | usr.bin/openssl/dsa.c | 16 | ||||
-rw-r--r-- | usr.bin/openssl/ec.c | 16 | ||||
-rw-r--r-- | usr.bin/openssl/enc.c | 16 | ||||
-rw-r--r-- | usr.bin/openssl/pkey.c | 16 | ||||
-rw-r--r-- | usr.bin/openssl/rsa.c | 16 |
7 files changed, 26 insertions, 72 deletions
diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c index 3febc15d2b4..d8d9256dc5c 100644 --- a/usr.bin/openssl/apps.c +++ b/usr.bin/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.49 2018/08/16 16:56:51 tb Exp $ */ +/* $OpenBSD: apps.c,v 1.50 2019/02/09 06:27:37 inoguchi Exp $ */ /* * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> * @@ -2320,3 +2320,15 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed, fprintf(stderr, "unknown option '%s'\n", arg); return (1); } + +void +show_cipher(const OBJ_NAME *name, void *arg) +{ + static int n; + + if (!islower((unsigned char)*name->name)) + return; + + fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); +} + diff --git a/usr.bin/openssl/apps.h b/usr.bin/openssl/apps.h index cfc6036ccfb..bb2340a545c 100644 --- a/usr.bin/openssl/apps.h +++ b/usr.bin/openssl/apps.h @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.h,v 1.21 2018/07/13 18:36:56 cheloha Exp $ */ +/* $OpenBSD: apps.h,v 1.22 2019/02/09 06:27:37 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -321,4 +321,6 @@ void options_usage(struct option *opts); int options_parse(int argc, char **argv, struct option *opts, char **unnamed, int *argsused); +void show_cipher(const OBJ_NAME *name, void *arg); + #endif diff --git a/usr.bin/openssl/dsa.c b/usr.bin/openssl/dsa.c index 0b99dedca63..d2460a7aaaf 100644 --- a/usr.bin/openssl/dsa.c +++ b/usr.bin/openssl/dsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ +/* $OpenBSD: dsa.c,v 1.12 2019/02/09 06:27:37 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -58,7 +58,6 @@ #include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */ -#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <time.h> @@ -205,17 +204,6 @@ static struct option dsa_options[] = { }; static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - -static void dsa_usage(void) { fprintf(stderr, @@ -227,7 +215,7 @@ dsa_usage(void) fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, NULL); fprintf(stderr, "\n"); } diff --git a/usr.bin/openssl/ec.c b/usr.bin/openssl/ec.c index f2dad6dfef2..917a7a15e51 100644 --- a/usr.bin/openssl/ec.c +++ b/usr.bin/openssl/ec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ +/* $OpenBSD: ec.c,v 1.12 2019/02/09 06:27:37 inoguchi Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -60,7 +60,6 @@ #ifndef OPENSSL_NO_EC -#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -240,17 +239,6 @@ static struct option ec_options[] = { }; static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - -static void ec_usage(void) { fprintf(stderr, @@ -263,7 +251,7 @@ ec_usage(void) fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, NULL); fprintf(stderr, "\n"); } diff --git a/usr.bin/openssl/enc.c b/usr.bin/openssl/enc.c index 7daeafe9d7e..863a048c122 100644 --- a/usr.bin/openssl/enc.c +++ b/usr.bin/openssl/enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enc.c,v 1.16 2019/01/18 22:47:34 naddy Exp $ */ +/* $OpenBSD: enc.c,v 1.17 2019/02/09 06:27:37 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -56,7 +56,6 @@ * [including the GNU Public Licence.] */ -#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -305,17 +304,6 @@ static struct option enc_options[] = { }; static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - -static void enc_usage(void) { fprintf(stderr, "usage: enc -ciphername [-AadePp] [-base64] " @@ -328,7 +316,7 @@ enc_usage(void) fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, NULL); fprintf(stderr, "\n"); } diff --git a/usr.bin/openssl/pkey.c b/usr.bin/openssl/pkey.c index a5ed21fc3b7..f7e7e87e48c 100644 --- a/usr.bin/openssl/pkey.c +++ b/usr.bin/openssl/pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkey.c,v 1.12 2019/02/05 12:45:47 inoguchi Exp $ */ +/* $OpenBSD: pkey.c,v 1.13 2019/02/09 06:27:37 inoguchi Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006 */ @@ -56,7 +56,6 @@ * */ -#include <ctype.h> #include <stdio.h> #include <string.h> @@ -182,17 +181,6 @@ static struct option pkey_options[] = { }; static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - -static void pkey_usage() { fprintf(stderr, @@ -205,7 +193,7 @@ pkey_usage() fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, NULL); fprintf(stderr, "\n"); } diff --git a/usr.bin/openssl/rsa.c b/usr.bin/openssl/rsa.c index c6ab617ac82..49f67a3c174 100644 --- a/usr.bin/openssl/rsa.c +++ b/usr.bin/openssl/rsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa.c,v 1.11 2019/02/05 12:45:47 inoguchi Exp $ */ +/* $OpenBSD: rsa.c,v 1.12 2019/02/09 06:27:37 inoguchi Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -58,7 +58,6 @@ #include <openssl/opensslconf.h> -#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -236,17 +235,6 @@ static struct option rsa_options[] = { }; static void -show_ciphers(const OBJ_NAME *name, void *arg) -{ - static int n; - - if (!islower((unsigned char)*name->name)) - return; - - fprintf(stderr, " -%-24s%s", name->name, (++n % 3 ? "" : "\n")); -} - -static void rsa_usage() { fprintf(stderr, @@ -259,7 +247,7 @@ rsa_usage() fprintf(stderr, "\n"); fprintf(stderr, "Valid ciphername values:\n\n"); - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_ciphers, NULL); + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, show_cipher, NULL); fprintf(stderr, "\n"); } |