/*
- * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2000-2017 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
OPT_V = 100, OPT_VV, OPT_VVV, OPT_VVVV
} OPTION_CHOICE;
-OPTIONS engine_options[] = {
+const OPTIONS engine_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] engine...\n"},
{OPT_HELP_STR, 1, '-',
" engine... Engines to load\n"},
}
cmds = sk_OPENSSL_STRING_new_null();
- if (!cmds)
+ if (cmds == NULL)
goto err;
do {
if (!ENGINE_ctrl_cmd_string(e, buf, arg, 0))
res = 0;
}
- if (res)
+ if (res) {
BIO_printf(out, "[Success]: %s\n", cmd);
- else {
+ } else {
BIO_printf(out, "[Failure]: %s\n", cmd);
ERR_print_errors(out);
}
break;
case OPT_TT:
test_avail_noise++;
+ /* fall thru */
case OPT_T:
test_avail++;
break;
}
}
+ ret = 0;
for (i = 0; i < sk_OPENSSL_CSTRING_num(engines); i++) {
const char *id = sk_OPENSSL_CSTRING_value(engines, i);
if ((e = ENGINE_by_id(id)) != NULL) {
goto end;
fn_c = ENGINE_get_ciphers(e);
- if (!fn_c)
+ if (fn_c == NULL)
goto skip_ciphers;
n = fn_c(e, NULL, &nids, 0);
for (k = 0; k < n; ++k)
skip_ciphers:
fn_d = ENGINE_get_digests(e);
- if (!fn_d)
+ if (fn_d == NULL)
goto skip_digests;
n = fn_d(e, NULL, &nids, 0);
for (k = 0; k < n; ++k)
skip_digests:
fn_pk = ENGINE_get_pkey_meths(e);
- if (!fn_pk)
+ if (fn_pk == NULL)
goto skip_pmeths;
n = fn_pk(e, NULL, &nids, 0);
for (k = 0; k < n; ++k)
if (!append_buf(&cap_buf, &cap_size, OBJ_nid2sn(nids[k])))
goto end;
skip_pmeths:
- if (cap_buf && (*cap_buf != '\0'))
+ if (cap_buf != NULL && (*cap_buf != '\0'))
BIO_printf(out, " [%s]\n", cap_buf);
OPENSSL_free(cap_buf);
if ((verbose > 0) && !util_verbose(e, verbose, out, indent))
goto end;
ENGINE_free(e);
- } else
+ } else {
ERR_print_errors(bio_err);
+ /* because exit codes above 127 have special meaning on Unix */
+ if (++ret > 127)
+ ret = 127;
+ }
}
- ret = 0;
end:
ERR_print_errors(bio_err);