]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Have the test executables output in text mode
authorRichard Levitte <levitte@openssl.org>
Fri, 4 Sep 2015 12:07:57 +0000 (14:07 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 5 Sep 2015 23:35:54 +0000 (01:35 +0200)
The test executables use standard output and standard error for text output,
so let's open the corresponding BIOs in text mode.

Reviewed-by: Tim Hudson <tjh@openssl.org>
test/bntest.c
test/dhtest.c
test/dsatest.c
test/ecdhtest.c
test/ecdsatest.c
test/exptest.c
test/jpaketest.c
test/srptest.c
test/ssltest.c

index effbd752468201bbadafa5031e934a34a18562da..675d0eb2613a2b3851d4997c11fb32175dbe2d30 100644 (file)
@@ -168,7 +168,7 @@ int main(int argc, char *argv[])
     if (out == NULL)
         EXIT(1);
     if (outfile == NULL) {
-        BIO_set_fp(out, stdout, BIO_NOCLOSE);
+        BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
     } else {
         if (!BIO_write_filename(out, outfile)) {
             perror(outfile);
index 7e46166eeba9c11326fc16115aad3fcbadce8b0e..9ce92ee392832b8f9b09c908fe69c4b5dbc66c49 100644 (file)
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
     out = BIO_new(BIO_s_file());
     if (out == NULL)
         EXIT(1);
-    BIO_set_fp(out, stdout, BIO_NOCLOSE);
+    BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
 
     _cb = BN_GENCB_new();
     if (!_cb)
index e138c641474a39b4de6bfd317d1784114436e1b1..1f4b8379c4d7712fb0027ea2aab8f5fc37c38663 100644 (file)
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
     unsigned int siglen;
 
     if (bio_err == NULL)
-        bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
+        bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
 
     CRYPTO_malloc_debug_init();
     CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
index 47c8185b7701f321bea1cdef6a35b01da5593628..0145b36c7db97ac32eacb264dce28123551c2bf5 100644 (file)
@@ -466,7 +466,7 @@ int main(int argc, char *argv[])
     out = BIO_new(BIO_s_file());
     if (out == NULL)
         EXIT(1);
-    BIO_set_fp(out, stdout, BIO_NOCLOSE);
+    BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
 
     if ((ctx = BN_CTX_new()) == NULL)
         goto err;
index 4b6d0444bf73b3262cb1ce1973a816e21824d8ee..2cf1725d6a1678b08f9c7c7d471d675f37c03218 100644 (file)
@@ -510,7 +510,7 @@ int main(void)
     int ret = 1;
     BIO *out;
 
-    out = BIO_new_fp(stdout, BIO_NOCLOSE);
+    out = BIO_new_fp(stdout, BIO_NOCLOSE | BIO_FP_TEXT);
 
     /* enable memory leak checking unless explicitly disabled */
     if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) &&
index 2da8dc2ffe9564beb242a9cb6a454ef470ef6829..97b74d98d9e1390938ae1a489098612ee299b480 100644 (file)
@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
 
     if (out == NULL)
         EXIT(1);
-    BIO_set_fp(out, stdout, BIO_NOCLOSE);
+    BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
 
     for (i = 0; i < 200; i++) {
         RAND_bytes(&c, 1);
index ef9e54bdb3c9e3d89e1ebd5bd509c2f8fa67f40d..15f00cf2e54c9a7cdcaacbccb88550d40ec89546 100644 (file)
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
     BIGNUM *secret = BN_new();
     BIO *bio_err;
 
-    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
+    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
 
     CRYPTO_malloc_debug_init();
     CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
index 8075218072cf1d1206283401d500a4fd1a8065aa..60cdbc31fd5221af0d87ae76b4b8a996ae9faacf 100644 (file)
@@ -124,7 +124,7 @@ static int run_srp(const char *username, const char *client_pass,
 int main(int argc, char **argv)
 {
     BIO *bio_err;
-    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
+    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
 
     CRYPTO_malloc_debug_init();
     CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
index 6f9d16c51bc29a304f0ac6b446eec787c6f0d0fc..4959aed3ab0b5272121ebcee3b137a6931b0e185 100644 (file)
@@ -1310,7 +1310,7 @@ int main(int argc, char *argv[])
     if (fips_mode) {
         if (!FIPS_mode_set(1)) {
             ERR_load_crypto_strings();
-            ERR_print_errors(BIO_new_fp(stderr, BIO_NOCLOSE));
+            ERR_print_errors(bio_err);
             EXIT(1);
         } else
             fprintf(stderr, "*** IN FIPS MODE ***\n");