Check for missing engine name, and also, do not count up the number of given algorithms when an engine is given

This commit is contained in:
Richard Levitte 2000-06-30 15:58:37 +00:00
parent e11b297730
commit 5ac85984ec

View file

@ -397,6 +397,11 @@ int MAIN(int argc, char **argv)
{
argc--;
argv++;
if(argc == 0)
{
BIO_printf(bio_err,"no engine given\n");
goto end;
}
if((e = ENGINE_by_id(*argv)) == NULL)
{
BIO_printf(bio_err,"invalid engine \"%s\"\n",
@ -411,6 +416,11 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,"engine \"%s\" set.\n", *argv);
/* Free our "structural" reference. */
ENGINE_free(e);
/* It will be increased again further down. We just
don't want speed to confuse an engine with an
algorithm, especially when none is given (which
means all of them should be run) */
j--;
}
else
#ifndef NO_MD2