diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2018-10-08 11:25:23 +0200 |
---|---|---|
committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2018-10-08 15:15:47 +0200 |
commit | 7095d5577ff25bb41ca3171903ac03809cea9f35 (patch) | |
tree | 999028229f570e68e6266c3c3a96423ecb7eb5c5 /tests/tls13/prf.c | |
parent | 42cc349feba90ab37143937a9165d3d87a2a5927 (diff) | |
download | gnutls-7095d5577ff25bb41ca3171903ac03809cea9f35.tar.gz |
Skip tests/tls13/prf.c if visibility 'protected' doesn't worktmp-fix-584
Overriding gnutls_rnd() with visibility 'protected' doesn't always work.
E.g. LDFLAGS="-Wl,-Bsymbolic-functions" seems to have priority on
Debian derived systems.
Fixes #584
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'tests/tls13/prf.c')
-rw-r--r-- | tests/tls13/prf.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/tls13/prf.c b/tests/tls13/prf.c index eb2d0e6096..75daff59d4 100644 --- a/tests/tls13/prf.c +++ b/tests/tls13/prf.c @@ -70,9 +70,13 @@ gnutls_datum_t hrnd = {(void*)"\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ static const gnutls_datum_t hsrnd = {(void*)"\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 32}; +static int gnutls_rnd_works; + int __attribute__ ((visibility ("protected"))) gnutls_rnd(gnutls_rnd_level_t level, void *data, size_t len) { + gnutls_rnd_works = 1; + memset(data, 0xff, len); /* Flip the first byte to avoid infinite loop in the RSA @@ -135,6 +139,11 @@ static void check_prfs(gnutls_session_t session) unsigned char key_material[512]; int ret; + if (!gnutls_rnd_works) { + fprintf(stderr, "gnutls_rnd() could not be overridden, see #584\n"); + exit(77); + } + TRY_OLD(13, "key expansion", 34, (uint8_t*)KEY_EXP_VALUE); TRY_OLD(6, "hello", 31, (uint8_t*)HELLO_VALUE); |