summaryrefslogtreecommitdiffstats
path: root/apps/openssl.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2015-05-29 08:07:10 +0200
committerRichard Levitte <levitte@openssl.org>2015-05-29 12:41:50 +0200
commit296f54ee211edbf8d21479091b4c20a9ee7698ad (patch)
tree4f746de806c85723368d65c4ab36d8e34974b214 /apps/openssl.c
parent21425195009e4daf6971453f8a0be08375ae9eec (diff)
Restore module loading
The module loading feature got broken a while ago, so restore it, but have it a bit more explicit this time around. Reviewed-by: Stephen Henson <steve@openssl.org>
Diffstat (limited to 'apps/openssl.c')
-rw-r--r--apps/openssl.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/apps/openssl.c b/apps/openssl.c
index 7713f9fbdb..e04ddce3c9 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -289,12 +289,16 @@ void unbuffer(FILE *fp)
setbuf(fp, NULL);
}
-BIO *bio_open_default(const char *filename, const char *mode)
+static BIO *bio_open_default_(const char *filename, const char *mode, int quiet)
{
BIO *ret;
if (filename == NULL || strcmp(filename, "-") == 0) {
ret = *mode == 'r' ? dup_bio_in() : dup_bio_out();
+ if (quiet) {
+ ERR_clear_error();
+ return ret;
+ }
if (ret != NULL)
return ret;
BIO_printf(bio_err,
@@ -302,6 +306,10 @@ BIO *bio_open_default(const char *filename, const char *mode)
*mode == 'r' ? "stdin" : "stdout", strerror(errno));
} else {
ret = BIO_new_file(filename, mode);
+ if (quiet) {
+ ERR_clear_error();
+ return ret;
+ }
if (ret != NULL)
return ret;
BIO_printf(bio_err,
@@ -312,6 +320,14 @@ BIO *bio_open_default(const char *filename, const char *mode)
ERR_print_errors(bio_err);
return NULL;
}
+BIO *bio_open_default(const char *filename, const char *mode)
+{
+ return bio_open_default_(filename, mode, 0);
+}
+BIO *bio_open_default_quiet(const char *filename, const char *mode)
+{
+ return bio_open_default_(filename, mode, 1);
+}
#if defined( OPENSSL_SYS_VMS)
extern char **copy_argv(int *argc, char **argv);