summaryrefslogtreecommitdiffstats
path: root/apps/s_time.c
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-08-01 21:30:57 +0200
committerRichard Levitte <levitte@openssl.org>2016-08-04 17:07:58 +0200
commitacc00492130d53d2d6a25bbe5409240aeba98420 (patch)
treeed8342a6f56f8169a109ff7a17e4378126f21f98 /apps/s_time.c
parente7932c1eb7daa1f8778df57687f6983fe6712734 (diff)
Pack globals variables used to control apps/verify_callback()
into a structure , to avoid any accident . Plus some few cleanups Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/s_time.c')
-rw-r--r--apps/s_time.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/apps/s_time.c b/apps/s_time.c
index a08a14d83a..de25319929 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -50,9 +50,6 @@
#define SECONDS 30
#define SECONDSSTR "30"
-extern int verify_depth;
-extern int verify_error;
-
static SSL *doConnection(SSL *scon, const char *host, SSL_CTX *ctx);
static const char fmt_http_get_cmd[] = "GET %s HTTP/1.0\r\n\r\n";
@@ -116,8 +113,6 @@ int s_time_main(int argc, char **argv)
size_t buf_size;
meth = TLS_client_method();
- verify_depth = 0;
- verify_error = X509_V_OK;
prog = opt_init(argc, argv, s_time_options);
while ((o = opt_next()) != OPT_EOF) {
@@ -141,10 +136,10 @@ int s_time_main(int argc, char **argv)
perform = 1;
break;
case OPT_VERIFY:
- if (!opt_int(opt_arg(), &verify_depth))
+ if (!opt_int(opt_arg(), &verify_args.depth))
goto opthelp;
BIO_printf(bio_err, "%s: verify depth is %d\n",
- prog, verify_depth);
+ prog, verify_args.depth);
break;
case OPT_CERT:
certfile = opt_arg();
@@ -415,9 +410,9 @@ static SSL *doConnection(SSL *scon, const char *host, SSL_CTX *ctx)
}
if (i <= 0) {
BIO_printf(bio_err, "ERROR\n");
- if (verify_error != X509_V_OK)
+ if (verify_args.error != X509_V_OK)
BIO_printf(bio_err, "verify error:%s\n",
- X509_verify_cert_error_string(verify_error));
+ X509_verify_cert_error_string(verify_args.error));
else
ERR_print_errors(bio_err);
if (scon == NULL)