mirror of
https://github.com/openssl/openssl.git
synced 2024-12-17 05:53:49 +08:00
Have 'openssl engine' exit with non-zero when some engine fails to load
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
5fc2c6896d
commit
9e64457d1e
@ -342,6 +342,7 @@ int engine_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
for (i = 0; i < sk_OPENSSL_CSTRING_num(engines); i++) {
|
for (i = 0; i < sk_OPENSSL_CSTRING_num(engines); i++) {
|
||||||
const char *id = sk_OPENSSL_CSTRING_value(engines, i);
|
const char *id = sk_OPENSSL_CSTRING_value(engines, i);
|
||||||
if ((e = ENGINE_by_id(id)) != NULL) {
|
if ((e = ENGINE_by_id(id)) != NULL) {
|
||||||
@ -424,11 +425,14 @@ int engine_main(int argc, char **argv)
|
|||||||
if ((verbose > 0) && !util_verbose(e, verbose, out, indent))
|
if ((verbose > 0) && !util_verbose(e, verbose, out, indent))
|
||||||
goto end;
|
goto end;
|
||||||
ENGINE_free(e);
|
ENGINE_free(e);
|
||||||
} else
|
} else {
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
|
/* because exit codes above 127 have special meaning on Unix */
|
||||||
|
if (++ret > 127)
|
||||||
|
ret = 127;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
end:
|
end:
|
||||||
|
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
|
Loading…
Reference in New Issue
Block a user