X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=apps%2Frsautl.c;h=56025c5f0cc1719bcca6f5a36543139c85d31e42;hp=ba31979618760acdde4232b7bad44cf865146bdb;hb=d66ace9da50de58a17e7ca7eeec8ca6f5a6be189;hpb=cf1b7d96647d55e533f779e476e3d4371f40445a diff --git a/apps/rsautl.c b/apps/rsautl.c index ba31979618..56025c5f0c 100644 --- a/apps/rsautl.c +++ b/apps/rsautl.c @@ -157,38 +157,25 @@ int MAIN(int argc, char **argv) goto end; } - if (engine != NULL) - { - if((e = ENGINE_by_id(engine)) == NULL) - { - BIO_printf(bio_err,"invalid engine \"%s\"\n", - engine); - goto end; - } - if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) - { - BIO_printf(bio_err,"can't use that engine\n"); - goto end; - } - BIO_printf(bio_err,"engine \"%s\" set.\n", engine); - /* Free our "structural" reference. */ - ENGINE_free(e); - } + e = setup_engine(bio_err, engine, 0); /* FIXME: seed PRNG only if needed */ app_RAND_load_file(NULL, bio_err, 0); switch(key_type) { case KEY_PRIVKEY: - pkey = load_key(bio_err, keyfile, keyform, NULL, e); + pkey = load_key(bio_err, keyfile, keyform, + NULL, e, "Private Key"); break; case KEY_PUBKEY: - pkey = load_pubkey(bio_err, keyfile, keyform, e); + pkey = load_pubkey(bio_err, keyfile, keyform, + NULL, e, "Public Key"); break; case KEY_CERT: - x = load_cert(bio_err, keyfile, keyform); + x = load_cert(bio_err, keyfile, keyform, + NULL, e, "Certificate"); if(x) { pkey = X509_get_pubkey(x); X509_free(x); @@ -197,7 +184,6 @@ int MAIN(int argc, char **argv) } if(!pkey) { - BIO_printf(bio_err, "Error loading key\n"); return 1; } @@ -227,7 +213,7 @@ int MAIN(int argc, char **argv) } } else { out = BIO_new_fp(stdout, BIO_NOCLOSE); -#ifdef VMS +#ifdef OPENSSL_SYS_VMS { BIO *tmpbio = BIO_new(BIO_f_linebuffer()); out = BIO_push(tmpbio, out);