diff options
Diffstat (limited to '')
-rw-r--r-- | src/usr.bin/openssl/apps.c | 11 | ||||
-rw-r--r-- | src/usr.bin/openssl/apps.h | 5 | ||||
-rw-r--r-- | src/usr.bin/openssl/crl.c | 4 | ||||
-rw-r--r-- | src/usr.bin/openssl/ecparam.c | 4 | ||||
-rw-r--r-- | src/usr.bin/openssl/prime.c | 4 | ||||
-rw-r--r-- | src/usr.bin/openssl/rand.c | 4 | ||||
-rw-r--r-- | src/usr.bin/openssl/version.c | 4 |
7 files changed, 22 insertions, 14 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index 506e421cc1..7c774e4077 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.17 2014/12/28 15:05:38 jsing Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.18 2014/12/28 15:48:52 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -2242,7 +2242,8 @@ options_usage(struct option *opts) | |||
2242 | } | 2242 | } |
2243 | 2243 | ||
2244 | int | 2244 | int |
2245 | options_parse(int argc, char **argv, struct option *opts, char **unnamed) | 2245 | options_parse(int argc, char **argv, struct option *opts, char **unnamed, |
2246 | int *argsused) | ||
2246 | { | 2247 | { |
2247 | const char *errstr; | 2248 | const char *errstr; |
2248 | struct option *opt; | 2249 | struct option *opt; |
@@ -2260,6 +2261,8 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed) | |||
2260 | 2261 | ||
2261 | /* Single unnamed argument (without leading hyphen). */ | 2262 | /* Single unnamed argument (without leading hyphen). */ |
2262 | if (*p++ != '-') { | 2263 | if (*p++ != '-') { |
2264 | if (argsused != NULL) | ||
2265 | goto done; | ||
2263 | if (unnamed == NULL) | 2266 | if (unnamed == NULL) |
2264 | goto unknown; | 2267 | goto unknown; |
2265 | if (*unnamed != NULL) | 2268 | if (*unnamed != NULL) |
@@ -2344,6 +2347,10 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed) | |||
2344 | } | 2347 | } |
2345 | } | 2348 | } |
2346 | 2349 | ||
2350 | done: | ||
2351 | if (argsused != NULL) | ||
2352 | *argsused = i; | ||
2353 | |||
2347 | return (0); | 2354 | return (0); |
2348 | 2355 | ||
2349 | toomany: | 2356 | toomany: |
diff --git a/src/usr.bin/openssl/apps.h b/src/usr.bin/openssl/apps.h index b069d2d29b..c448e85d87 100644 --- a/src/usr.bin/openssl/apps.h +++ b/src/usr.bin/openssl/apps.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: apps.h,v 1.10 2014/12/28 14:21:42 jsing Exp $ */ | 1 | /* $OpenBSD: apps.h,v 1.11 2014/12/28 15:48:52 jsing 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 | * |
@@ -305,6 +305,7 @@ struct option { | |||
305 | }; | 305 | }; |
306 | 306 | ||
307 | void options_usage(struct option *opts); | 307 | void options_usage(struct option *opts); |
308 | int options_parse(int argc, char **argv, struct option *opts, char **unnamed); | 308 | int options_parse(int argc, char **argv, struct option *opts, char **unnamed, |
309 | int *argsused); | ||
309 | 310 | ||
310 | #endif | 311 | #endif |
diff --git a/src/usr.bin/openssl/crl.c b/src/usr.bin/openssl/crl.c index 0391e6e4dc..2b6a4a3e5d 100644 --- a/src/usr.bin/openssl/crl.c +++ b/src/usr.bin/openssl/crl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crl.c,v 1.5 2014/10/13 02:46:14 bcook Exp $ */ | 1 | /* $OpenBSD: crl.c,v 1.6 2014/12/28 15:48:52 jsing 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 | * |
@@ -244,7 +244,7 @@ crl_main(int argc, char **argv) | |||
244 | crl_config.informat = FORMAT_PEM; | 244 | crl_config.informat = FORMAT_PEM; |
245 | crl_config.outformat = FORMAT_PEM; | 245 | crl_config.outformat = FORMAT_PEM; |
246 | 246 | ||
247 | if (options_parse(argc, argv, crl_options, &digest_name) != 0) { | 247 | if (options_parse(argc, argv, crl_options, &digest_name, NULL) != 0) { |
248 | crl_usage(); | 248 | crl_usage(); |
249 | goto end; | 249 | goto end; |
250 | } | 250 | } |
diff --git a/src/usr.bin/openssl/ecparam.c b/src/usr.bin/openssl/ecparam.c index 57797a8e4e..c958c1f51b 100644 --- a/src/usr.bin/openssl/ecparam.c +++ b/src/usr.bin/openssl/ecparam.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecparam.c,v 1.7 2014/12/28 14:21:42 jsing Exp $ */ | 1 | /* $OpenBSD: ecparam.c,v 1.8 2014/12/28 15:48:52 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -277,7 +277,7 @@ ecparam_main(int argc, char **argv) | |||
277 | ecparam_config.informat = FORMAT_PEM; | 277 | ecparam_config.informat = FORMAT_PEM; |
278 | ecparam_config.outformat = FORMAT_PEM; | 278 | ecparam_config.outformat = FORMAT_PEM; |
279 | 279 | ||
280 | if (options_parse(argc, argv, ecparam_options, NULL) != 0) { | 280 | if (options_parse(argc, argv, ecparam_options, NULL, NULL) != 0) { |
281 | ecparam_usage(); | 281 | ecparam_usage(); |
282 | goto end; | 282 | goto end; |
283 | } | 283 | } |
diff --git a/src/usr.bin/openssl/prime.c b/src/usr.bin/openssl/prime.c index d9237f9070..fca3701632 100644 --- a/src/usr.bin/openssl/prime.c +++ b/src/usr.bin/openssl/prime.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: prime.c,v 1.3 2014/10/13 02:46:14 bcook Exp $ */ | 1 | /* $OpenBSD: prime.c,v 1.4 2014/12/28 15:48:52 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -123,7 +123,7 @@ prime_main(int argc, char **argv) | |||
123 | /* Default iterations for Miller-Rabin probabilistic primality test. */ | 123 | /* Default iterations for Miller-Rabin probabilistic primality test. */ |
124 | prime_config.checks = 20; | 124 | prime_config.checks = 20; |
125 | 125 | ||
126 | if (options_parse(argc, argv, prime_options, &prime) != 0) { | 126 | if (options_parse(argc, argv, prime_options, &prime, NULL) != 0) { |
127 | prime_usage(); | 127 | prime_usage(); |
128 | return (1); | 128 | return (1); |
129 | } | 129 | } |
diff --git a/src/usr.bin/openssl/rand.c b/src/usr.bin/openssl/rand.c index 6de2208b42..eccf4dee86 100644 --- a/src/usr.bin/openssl/rand.c +++ b/src/usr.bin/openssl/rand.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rand.c,v 1.5 2014/10/22 13:54:03 jsing Exp $ */ | 1 | /* $OpenBSD: rand.c,v 1.6 2014/12/28 15:48:52 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -123,7 +123,7 @@ rand_main(int argc, char **argv) | |||
123 | 123 | ||
124 | memset(&rand_config, 0, sizeof(rand_config)); | 124 | memset(&rand_config, 0, sizeof(rand_config)); |
125 | 125 | ||
126 | if (options_parse(argc, argv, rand_options, &num_bytes) != 0) { | 126 | if (options_parse(argc, argv, rand_options, &num_bytes, NULL) != 0) { |
127 | rand_usage(); | 127 | rand_usage(); |
128 | return (1); | 128 | return (1); |
129 | } | 129 | } |
diff --git a/src/usr.bin/openssl/version.c b/src/usr.bin/openssl/version.c index 953d0c3afe..2e28fa4345 100644 --- a/src/usr.bin/openssl/version.c +++ b/src/usr.bin/openssl/version.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: version.c,v 1.4 2014/12/28 14:21:42 jsing Exp $ */ | 1 | /* $OpenBSD: version.c,v 1.5 2014/12/28 15:48:52 jsing 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 | * |
@@ -217,7 +217,7 @@ version_main(int argc, char **argv) | |||
217 | { | 217 | { |
218 | memset(&version_config, 0, sizeof(version_config)); | 218 | memset(&version_config, 0, sizeof(version_config)); |
219 | 219 | ||
220 | if (options_parse(argc, argv, version_options, NULL) != 0) { | 220 | if (options_parse(argc, argv, version_options, NULL, NULL) != 0) { |
221 | version_usage(); | 221 | version_usage(); |
222 | return (1); | 222 | return (1); |
223 | } | 223 | } |