[openssl-commits] [openssl] master update

Viktor Dukhovni viktor at openssl.org
Mon Dec 10 03:03:38 UTC 2018


The branch master has been updated
       via  1057c2c39f5df45c36c0fc4d78dc9d3b91f78bc6 (commit)
       via  9b340281873643d2b8a33047dc8bfa607f7e0c3c (commit)
       via  73ff6d6847b1bbabe4ae052a3bde1f37c78aecb4 (commit)
       via  ec91206fbe5e14731f9c9fa0b3dd859854d3e8b9 (commit)
       via  5db120dc351177173bb25e963be095404c31fbce (commit)
       via  bda1f0c0d6987232f1f8ca2a72755ac62a99fc4c (commit)
       via  d8adf68cd6b7c934f12e7db14ddfc33b8cdd5797 (commit)
       via  8343229bc4b8ac04e3a15d0645c453da84cab8d8 (commit)
       via  82f518acee36754cb6f64d39ba926b32daae2534 (commit)
       via  706a8af01556334dd250b6d252536e78fa8f9063 (commit)
       via  15f77f2cae7f845811fbeabafe620a3b1d6315d8 (commit)
       via  4b6ae3c3c2ce37a766049491af8e8b2426b1a46f (commit)
       via  f53537b1fabdb38baf43e930b9c546ffb50a86cf (commit)
      from  91d0fd1c2753f0f7d6e0953eed3cfb6eb96d8ff4 (commit)


- Log -----------------------------------------------------------------
commit 1057c2c39f5df45c36c0fc4d78dc9d3b91f78bc6
Author: Viktor Dukhovni <openssl-users at dukhovni.org>
Date:   Sun Dec 9 18:37:56 2018 -0500

    Cleaner disposal of ephemeral engine ids and names
    
    Engine names and ids are typically static strings.  If an application
    actually dynamically allocated these, the application owns the
    storage, and should dispose of it via the original handle, rather
    than the "const char *" returned by the engine.
    
    In any case, this resolves the test code issue without resort to
    "unconst" macros/casts.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit 9b340281873643d2b8a33047dc8bfa607f7e0c3c
Author: Viktor Dukhovni <openssl-users at dukhovni.org>
Date:   Sun Dec 9 18:37:26 2018 -0500

    Eliminate NOP cast
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit 73ff6d6847b1bbabe4ae052a3bde1f37c78aecb4
Author: Christos Zoulas <christos at zoulas.com>
Date:   Mon Oct 1 19:09:16 2018 -0400

    change into hex string constants to avoid overflow warnings
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit ec91206fbe5e14731f9c9fa0b3dd859854d3e8b9
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 17:16:07 2018 -0400

    Add a format attribute to the format functions and fix the broken format
    strings.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit 5db120dc351177173bb25e963be095404c31fbce
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:59:46 2018 -0400

    Fix const issues
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit bda1f0c0d6987232f1f8ca2a72755ac62a99fc4c
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:57:56 2018 -0400

    Avoid const castaway warning
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit d8adf68cd6b7c934f12e7db14ddfc33b8cdd5797
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:57:14 2018 -0400

    Use a const variable
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit 8343229bc4b8ac04e3a15d0645c453da84cab8d8
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:56:49 2018 -0400

    Use the proper fonst cast
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit 82f518acee36754cb6f64d39ba926b32daae2534
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:56:14 2018 -0400

    don't pass const string where a modifyable string is expected
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit 706a8af01556334dd250b6d252536e78fa8f9063
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:55:05 2018 -0400

    add missing "void" in prototype.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit 15f77f2cae7f845811fbeabafe620a3b1d6315d8
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:54:25 2018 -0400

    add missing const in cast
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit 4b6ae3c3c2ce37a766049491af8e8b2426b1a46f
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:53:22 2018 -0400

    add missing const
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit f53537b1fabdb38baf43e930b9c546ffb50a86cf
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Sep 30 16:52:44 2018 -0400

    use the proper types to eliminate casts
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 test/destest.c                |  2 +-
 test/enginetest.c             | 15 +++++++-------
 test/hmactest.c               | 46 ++++++++++++++++++++-----------------------
 test/ideatest.c               |  4 ++--
 test/testutil/driver.c        |  2 +-
 test/testutil/format_output.c | 23 +++++++++++-----------
 test/testutil/main.c          |  2 +-
 test/testutil/output.h        | 34 +++++++++++++++++++++++++++-----
 test/testutil/stanza.c        |  3 ++-
 test/testutil/tap_bio.c       |  3 ++-
 test/testutil/tests.c         |  2 +-
 11 files changed, 80 insertions(+), 56 deletions(-)

diff --git a/test/destest.c b/test/destest.c
index 6b57911..fe56d9a 100644
--- a/test/destest.c
+++ b/test/destest.c
@@ -287,7 +287,7 @@ static char *pt(const unsigned char *p, char buf[DATA_BUF_SIZE])
 {
     char *ret;
     int i;
-    static char *f = "0123456789ABCDEF";
+    static const char *f = "0123456789ABCDEF";
 
     ret = &(buf[0]);
     for (i = 0; i < 8; i++) {
diff --git a/test/enginetest.c b/test/enginetest.c
index 096a334..4836cbe 100644
--- a/test/enginetest.c
+++ b/test/enginetest.c
@@ -44,8 +44,9 @@ static void display_engine_list(void)
 static int test_engines(void)
 {
     ENGINE *block[NUMTOADD];
+    char *eid[NUMTOADD];
+    char *ename[NUMTOADD];
     char buf[256];
-    const char *id, *name;
     ENGINE *ptr;
     int loop;
     int to_return = 0;
@@ -138,12 +139,12 @@ static int test_engines(void)
     TEST_info("About to beef up the engine-type list");
     for (loop = 0; loop < NUMTOADD; loop++) {
         sprintf(buf, "id%d", loop);
-        id = OPENSSL_strdup(buf);
+        eid[loop] = OPENSSL_strdup(buf);
         sprintf(buf, "Fake engine type %d", loop);
-        name = OPENSSL_strdup(buf);
+        ename[loop] = OPENSSL_strdup(buf);
         if (!TEST_ptr(block[loop] = ENGINE_new())
-                || !TEST_true(ENGINE_set_id(block[loop], id))
-                || !TEST_true(ENGINE_set_name(block[loop], name)))
+                || !TEST_true(ENGINE_set_id(block[loop], eid[loop]))
+                || !TEST_true(ENGINE_set_name(block[loop], ename[loop])))
             goto end;
     }
     for (loop = 0; loop < NUMTOADD; loop++) {
@@ -162,8 +163,8 @@ static int test_engines(void)
         ENGINE_free(ptr);
     }
     for (loop = 0; loop < NUMTOADD; loop++) {
-        OPENSSL_free((void *)ENGINE_get_id(block[loop]));
-        OPENSSL_free((void *)ENGINE_get_name(block[loop]));
+        OPENSSL_free(eid[loop]);
+        OPENSSL_free(ename[loop]);
     }
     to_return = 1;
 
diff --git a/test/hmactest.c b/test/hmactest.c
index 47d812d..893e616 100644
--- a/test/hmactest.c
+++ b/test/hmactest.c
@@ -27,54 +27,50 @@
 
 # ifndef OPENSSL_NO_MD5
 static struct test_st {
-    unsigned char key[16];
+    const char key[16];
     int key_len;
-    unsigned char data[64];
+    const unsigned char data[64];
     int data_len;
-    unsigned char *digest;
+    const char *digest;
 } test[8] = {
     {
         "", 0, "More text test vectors to stuff up EBCDIC machines :-)", 54,
-        (unsigned char *)"e9139d1e6ee064ef8cf514fc7dc83e86",
+        "e9139d1e6ee064ef8cf514fc7dc83e86",
     },
     {
-        {
-            0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
-            0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
-        }, 16, "Hi There", 8,
-        (unsigned char *)"9294727a3638bb1c13f48ef8158bfc9d",
+        "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
+        16, "Hi There", 8,
+        "9294727a3638bb1c13f48ef8158bfc9d",
     },
     {
         "Jefe", 4, "what do ya want for nothing?", 28,
-        (unsigned char *)"750c783e6ab0b503eaa86e310a5db738",
+        "750c783e6ab0b503eaa86e310a5db738",
     },
     {
-        {
-            0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
-            0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
-        }, 16, {
+        "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
+        16, {
             0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
             0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
             0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
             0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
             0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd
-        }, 50, (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6",
+        }, 50, "56be34521d144c88dbb8c733f0e8b3f6",
     },
     {
         "", 0, "My test data", 12,
-        (unsigned char *)"61afdecb95429ef494d61fdee15990cabf0826fc"
+        "61afdecb95429ef494d61fdee15990cabf0826fc"
     },
     {
         "", 0, "My test data", 12,
-        (unsigned char *)"2274b195d90ce8e03406f4b526a47e0787a88a65479938f1a5baa3ce0f079776"
+        "2274b195d90ce8e03406f4b526a47e0787a88a65479938f1a5baa3ce0f079776"
     },
     {
         "123456", 6, "My test data", 12,
-        (unsigned char *)"bab53058ae861a7f191abe2d0145cbb123776a6369ee3f9d79ce455667e411dd"
+        "bab53058ae861a7f191abe2d0145cbb123776a6369ee3f9d79ce455667e411dd"
     },
     {
         "12345", 5, "My test data again", 18,
-        (unsigned char *)"a12396ceddd2a85f4c656bc1e0aa50c78cffde3e"
+        "a12396ceddd2a85f4c656bc1e0aa50c78cffde3e"
     }
 };
 # endif
@@ -98,7 +94,7 @@ static int test_hmac_md5(int idx)
                 test[idx].data, test[idx].data_len, NULL, NULL),
                 MD5_DIGEST_LENGTH);
 
-    if (!TEST_str_eq(p, (char *)test[idx].digest))
+    if (!TEST_str_eq(p, test[idx].digest))
       return 0;
 
     return 1;
@@ -149,7 +145,7 @@ static int test_hmac_run(void)
         goto err;
 
     p = pt(buf, len);
-    if (!TEST_str_eq(p, (char *)test[4].digest))
+    if (!TEST_str_eq(p, test[4].digest))
         goto err;
 
     if (!TEST_false(HMAC_Init_ex(ctx, NULL, 0, EVP_sha256(), NULL)))
@@ -162,7 +158,7 @@ static int test_hmac_run(void)
         goto err;
 
     p = pt(buf, len);
-    if (!TEST_str_eq(p, (char *)test[5].digest))
+    if (!TEST_str_eq(p, test[5].digest))
         goto err;
 
     if (!TEST_true(HMAC_Init_ex(ctx, test[6].key, test[6].key_len, NULL, NULL))
@@ -170,7 +166,7 @@ static int test_hmac_run(void)
         || !TEST_true(HMAC_Final(ctx, buf, &len)))
         goto err;
     p = pt(buf, len);
-    if (!TEST_str_eq(p, (char *)test[6].digest))
+    if (!TEST_str_eq(p, test[6].digest))
         goto err;
 
     ret = 1;
@@ -187,7 +183,7 @@ static int test_hmac_single_shot(void)
     /* Test single-shot with an empty key. */
     p = pt(HMAC(EVP_sha1(), NULL, 0, test[4].data, test[4].data_len,
                 NULL, NULL), SHA_DIGEST_LENGTH);
-    if (!TEST_str_eq(p, (char *)test[4].digest))
+    if (!TEST_str_eq(p, test[4].digest))
         return 0;
 
     return 1;
@@ -214,7 +210,7 @@ static int test_hmac_copy(void)
         goto err;
 
     p = pt(buf, len);
-    if (!TEST_str_eq(p, (char *)test[7].digest))
+    if (!TEST_str_eq(p, test[7].digest))
         goto err;
 
     ret = 1;
diff --git a/test/ideatest.c b/test/ideatest.c
index 58834a1..e572984 100644
--- a/test/ideatest.c
+++ b/test/ideatest.c
@@ -25,7 +25,7 @@ static const unsigned char c[8] = { 0x11, 0xFB, 0xED, 0x2B, 0x01, 0x98, 0x6D, 0x
 
 static unsigned char out[80];
 
-static const char text[] = "Hello to all people out there";
+static const unsigned char text[] = "Hello to all people out there";
 
 static const unsigned char cfb_key[16] = {
     0xe1, 0xf0, 0xc3, 0xd2, 0xa5, 0xb4, 0x87, 0x96,
@@ -74,7 +74,7 @@ static int test_idea_cbc(void)
     IDEA_set_encrypt_key(k, &key);
     IDEA_set_decrypt_key(&key, &dkey);
     memcpy(iv, k, sizeof(iv));
-    IDEA_cbc_encrypt((unsigned char *)text, out, text_len, &key, iv, 1);
+    IDEA_cbc_encrypt(text, out, text_len, &key, iv, 1);
     memcpy(iv, k, sizeof(iv));
     IDEA_cbc_encrypt(out, out, IDEA_BLOCK, &dkey, iv, 0);
     IDEA_cbc_encrypt(&out[8], &out[8], text_len - 8, &dkey, iv, 0);
diff --git a/test/testutil/driver.c b/test/testutil/driver.c
index 95b40be..3e80a7c 100644
--- a/test/testutil/driver.c
+++ b/test/testutil/driver.c
@@ -99,7 +99,7 @@ static int gcd(int a, int b)
     return a;
 }
 
-void setup_test_framework()
+void setup_test_framework(void)
 {
     char *TAP_levels = getenv("HARNESS_OSSL_LEVEL");
     char *test_seed = getenv("OPENSSL_TEST_RAND_ORDER");
diff --git a/test/testutil/format_output.c b/test/testutil/format_output.c
index b220750..7f51475 100644
--- a/test/testutil/format_output.c
+++ b/test/testutil/format_output.c
@@ -31,9 +31,9 @@ static void test_diff_header(const char *left, const char *right)
 static void test_string_null_empty(const char *m, char c)
 {
     if (m == NULL)
-        test_printf_stderr("% 4s %c NULL\n", "", c);
+        test_printf_stderr("%4s %c NULL\n", "", c);
     else
-        test_printf_stderr("% 4u:%c ''\n", 0u, c);
+        test_printf_stderr("%4u:%c ''\n", 0u, c);
 }
 
 static void test_fail_string_common(const char *prefix, const char *file,
@@ -94,18 +94,18 @@ static void test_fail_string_common(const char *prefix, const char *file,
             bdiff[i] = '\0';
         }
         if (n1 == n2 && !diff) {
-            test_printf_stderr("% 4u:  '%s'\n", cnt, n2 > n1 ? b2 : b1);
+            test_printf_stderr("%4u:  '%s'\n", cnt, n2 > n1 ? b2 : b1);
         } else {
             if (cnt == 0 && (m1 == NULL || *m1 == '\0'))
                 test_string_null_empty(m1, '-');
             else if (n1 > 0)
-                test_printf_stderr("% 4u:- '%s'\n", cnt, b1);
+                test_printf_stderr("%4u:- '%s'\n", cnt, b1);
             if (cnt == 0 && (m2 == NULL || *m2 == '\0'))
                test_string_null_empty(m2, '+');
             else if (n2 > 0)
-                test_printf_stderr("% 4u:+ '%s'\n", cnt, b2);
+                test_printf_stderr("%4u:+ '%s'\n", cnt, b2);
             if (diff && i > 0)
-                test_printf_stderr("% 4s    %s\n", "", bdiff);
+                test_printf_stderr("%4s    %s\n", "", bdiff);
         }
         m1 += n1;
         m2 += n2;
@@ -206,6 +206,7 @@ static int convert_bn_memory(const unsigned char *in, size_t bytes,
 {
     int n = bytes * 2, i;
     char *p = out, *q = NULL;
+    const char *r;
 
     if (bn != NULL && !BN_is_zero(bn)) {
         hex_convert_memory(in, bytes, out, BN_OUTPUT_SIZE);
@@ -248,10 +249,10 @@ static int convert_bn_memory(const unsigned char *in, size_t bytes,
     }
     *p = '\0';
     if (bn == NULL)
-        q = "NULL";
+        r = "NULL";
     else
-        q = BN_is_negative(bn) ? "-0" : "0";
-    strcpy(p - strlen(q), q);
+        r = BN_is_negative(bn) ? "-0" : "0";
+    strcpy(p - strlen(r), r);
     return 0;
 }
 
@@ -409,7 +410,7 @@ void test_output_bignum(const char *name, const BIGNUM *bn)
 static void test_memory_null_empty(const unsigned char *m, char c)
 {
     if (m == NULL)
-        test_printf_stderr("% 4s %c%s\n", "", c, "NULL");
+        test_printf_stderr("%4s %c%s\n", "", c, "NULL");
     else
         test_printf_stderr("%04x %c%s\n", 0u, c, "empty");
 }
@@ -493,7 +494,7 @@ static void test_fail_memory_common(const char *prefix, const char *file,
             else if (n2 > 0)
                 test_printf_stderr("%04x:+%s\n", cnt, b2);
             if (diff && i > 0)
-                test_printf_stderr("% 4s  %s\n", "", bdiff);
+                test_printf_stderr("%4s  %s\n", "", bdiff);
         }
         m1 += n1;
         m2 += n2;
diff --git a/test/testutil/main.c b/test/testutil/main.c
index 458d480..9dc651b 100644
--- a/test/testutil/main.c
+++ b/test/testutil/main.c
@@ -25,7 +25,7 @@ static void check_arg_usage(void)
 
     for (i = 0; i < n; i++)
         if (!arg_used[i+1])
-            test_printf_stderr("Warning ignored command-line argument %d: %s\n",
+            test_printf_stderr("Warning ignored command-line argument %zu: %s\n",
                                i, args[i+1]);
     if (i < arg_count)
         test_printf_stderr("Warning arguments %zu and later unchecked\n", i);
diff --git a/test/testutil/output.h b/test/testutil/output.h
index 655176f..e637c7b 100644
--- a/test/testutil/output.h
+++ b/test/testutil/output.h
@@ -10,8 +10,25 @@
 #ifndef HEADER_TU_OUTPUT_H
 # define HEADER_TU_OUTPUT_H
 
-#include <stdarg.h>
+# include <stdarg.h>
 
+# define ossl_test__attr__(x)
+# if defined(__GNUC__) && defined(__STDC_VERSION__) \
+    && !defined(__APPLE__)
+    /*
+     * Because we support the 'z' modifier, which made its appearance in C99,
+     * we can't use __attribute__ with pre C99 dialects.
+     */
+#  if __STDC_VERSION__ >= 199901L
+#   undef ossl_test__attr__
+#   define ossl_test__attr__ __attribute__
+#   if __GNUC__*10 + __GNUC_MINOR__ >= 44
+#    define ossl_test__printf__ __gnu_printf__
+#   else
+#    define ossl_test__printf__ __printf__
+#   endif
+#  endif
+# endif
 /*
  * The basic I/O functions used internally by the test framework.  These
  * can be overridden when needed. Note that if one is, then all must be.
@@ -19,14 +36,21 @@
 void test_open_streams(void);
 void test_close_streams(void);
 /* The following ALL return the number of characters written */
-int test_vprintf_stdout(const char *fmt, va_list ap);
-int test_vprintf_stderr(const char *fmt, va_list ap);
+int test_vprintf_stdout(const char *fmt, va_list ap)
+    ossl_test__attr__((__format__(ossl_test__printf__, 1, 0)));
+int test_vprintf_stderr(const char *fmt, va_list ap)
+    ossl_test__attr__((__format__(ossl_test__printf__, 1, 0)));
 /* These return failure or success */
 int test_flush_stdout(void);
 int test_flush_stderr(void);
 
 /* Commodity functions.  There's no need to override these */
-int test_printf_stdout(const char *fmt, ...);
-int test_printf_stderr(const char *fmt, ...);
+int test_printf_stdout(const char *fmt, ...)
+    ossl_test__attr__((__format__(ossl_test__printf__, 1, 2)));
+int test_printf_stderr(const char *fmt, ...)
+    ossl_test__attr__((__format__(ossl_test__printf__, 1, 2)));
+
+# undef ossl_test__printf__
+# undef ossl_test__attr__
 
 #endif                          /* HEADER_TU_OUTPUT_H */
diff --git a/test/testutil/stanza.c b/test/testutil/stanza.c
index eb16322..e283620 100644
--- a/test/testutil/stanza.c
+++ b/test/testutil/stanza.c
@@ -86,7 +86,8 @@ static char *strip_spaces(char *p)
 int test_readstanza(STANZA *s)
 {
     PAIR *pp = s->pairs;
-    char *p, *equals, *key, *value;
+    char *p, *equals, *key;
+    const char *value;
 
     for (s->numpairs = 0; BIO_gets(s->fp, s->buff, sizeof(s->buff)); ) {
         s->curr++;
diff --git a/test/testutil/tap_bio.c b/test/testutil/tap_bio.c
index 1b3881c..f3ee278 100644
--- a/test/testutil/tap_bio.c
+++ b/test/testutil/tap_bio.c
@@ -93,13 +93,14 @@ static int write_string(BIO *b, const char *buf, size_t n)
  */
 static int tap_write_ex(BIO *b, const char *buf, size_t size, size_t *in_size)
 {
+    static char empty[] = "";
     BIO *next = BIO_next(b);
     size_t i;
     int j;
 
     for (i = 0; i < size; i++) {
         if (BIO_get_data(b) == NULL) {
-            BIO_set_data(b, "");
+            BIO_set_data(b, empty);
             for (j = 0; j < subtest_level(); j++)
                 if (!write_string(next, " ", 1))
                     goto err;
diff --git a/test/testutil/tests.c b/test/testutil/tests.c
index ba37f01..2ba5b9a 100644
--- a/test/testutil/tests.c
+++ b/test/testutil/tests.c
@@ -420,7 +420,7 @@ int test_BN_abs_eq_word(const char *file, int line, const char *bns,
 
 static const char *print_time(const ASN1_TIME *t)
 {
-    return t == NULL ? "<null>" : (char *)ASN1_STRING_get0_data(t);
+    return t == NULL ? "<null>" : (const char *)ASN1_STRING_get0_data(t);
 }
 
 #define DEFINE_TIME_T_COMPARISON(opname, op)                            \


More information about the openssl-commits mailing list