Fix the effect of no-dso in crypto/init.c
[openssl.git] / apps / rsa.c
index f67387e27f6facb42aeb8398479fd2bbca3a54a7..73579a61a6c529dd3a076f41626e1c4880fb7654 100644 (file)
@@ -35,7 +35,7 @@ typedef enum OPTION_choice {
     OPT_NOOUT, OPT_TEXT, OPT_MODULUS, OPT_CHECK, OPT_CIPHER
 } OPTION_CHOICE;
 
-OPTIONS rsa_options[] = {
+const OPTIONS rsa_options[] = {
     {"help", OPT_HELP, '-', "Display this summary"},
     {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"},
     {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"},
@@ -230,10 +230,7 @@ int rsa_main(int argc, char **argv)
                            ERR_reason_error_string(err));
                 ERR_get_error(); /* remove e from error stack */
             }
-        }
-
-        /* should happen only if r == -1 */
-        if (r == -1 || ERR_peek_error() != 0) {
+        } else if (r == -1) {
             ERR_print_errors(bio_err);
             goto end;
         }
@@ -297,6 +294,7 @@ int rsa_main(int argc, char **argv)
     } else
         ret = 0;
  end:
+    release_engine(e);
     BIO_free_all(out);
     RSA_free(rsa);
     OPENSSL_free(passin);