/*
- * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
#include <string.h>
#include "apps.h"
+#include "progs.h"
#include <openssl/bn.h>
typedef enum OPTION_choice {
switch (o) {
case OPT_EOF:
case OPT_ERR:
+opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto end;
case OPT_HELP:
argc = opt_num_rest();
argv = opt_rest();
- if (argc == 0 && !generate) {
+ if (generate) {
+ if (argc != 0) {
+ BIO_printf(bio_err, "Extra arguments given.\n");
+ goto opthelp;
+ }
+ } else if (argc == 0) {
BIO_printf(bio_err, "%s: No prime specified\n", prog);
- goto end;
+ goto opthelp;
}
if (generate) {
else
r = BN_dec2bn(&bn, argv[0]);
- if(!r) {
+ if (!r) {
BIO_printf(bio_err, "Failed to process value (%s)\n", argv[0]);
goto end;
}