summaryrefslogtreecommitdiff
path: root/tests/tls13/key_update.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-05-10 05:49:07 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-05-10 05:54:00 +0200
commit63758e38bead5679a582c4ec03badde19dabd67f (patch)
treedcdf6cb359788013104f5ba53a0caca3af583580 /tests/tls13/key_update.c
parent5e2acc63004768471f57b14fe41bfdea21f50e28 (diff)
downloadgnutls-63758e38bead5679a582c4ec03badde19dabd67f.tar.gz
tests: key_update: improved error checking and increased timeouttmp-move-ci-to-f28
That is to avoid reaching the maximum number of key updates per second. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'tests/tls13/key_update.c')
-rw-r--r--tests/tls13/key_update.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/tls13/key_update.c b/tests/tls13/key_update.c
index dd1a559d86..ac5f5cc1a5 100644
--- a/tests/tls13/key_update.c
+++ b/tests/tls13/key_update.c
@@ -123,7 +123,7 @@ static void run(const char *name, unsigned test)
EMPTY_BUF(server, client, buffer, MAX_BUF);
if (test != 0)
break;
- sec_sleep(1);
+ sec_sleep(2);
/* fall-through */
case 2:
success("%s: updating server's key\n", name);
@@ -131,6 +131,8 @@ static void run(const char *name, unsigned test)
do {
ret = gnutls_session_key_update(server, 0);
} while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
+ if (ret < 0)
+ fail("error in key update: %s\n", gnutls_strerror(ret));
/* client receives the key update and sends data */
TRANSFER(client, server, MSG, strlen(MSG), buffer, MAX_BUF);
@@ -138,13 +140,15 @@ static void run(const char *name, unsigned test)
EMPTY_BUF(server, client, buffer, MAX_BUF);
if (test != 0)
break;
- sec_sleep(1);
+ sec_sleep(2);
/* fall-through */
case 3:
success("%s: updating client's key and asking server\n", name);
do {
ret = gnutls_session_key_update(client, GNUTLS_KU_PEER);
} while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
+ if (ret < 0)
+ fail("error in key update: %s\n", gnutls_strerror(ret));
/* server receives the client key update and sends data */
TRANSFER(client, server, MSG, strlen(MSG), buffer, MAX_BUF);
@@ -152,13 +156,15 @@ static void run(const char *name, unsigned test)
EMPTY_BUF(server, client, buffer, MAX_BUF);
if (test != 0)
break;
- sec_sleep(1);
+ sec_sleep(2);
/* fall-through */
case 4:
success("%s: updating server's key and asking client\n", name);
do {
ret = gnutls_session_key_update(server, GNUTLS_KU_PEER);
} while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
+ if (ret < 0)
+ fail("error in key update: %s\n", gnutls_strerror(ret));
TRANSFER(client, server, MSG, strlen(MSG), buffer, MAX_BUF);
TRANSFER(server, client, MSG, strlen(MSG), buffer, MAX_BUF);
@@ -173,7 +179,7 @@ static void run(const char *name, unsigned test)
ret = gnutls_session_key_update(server, GNUTLS_KU_PEER);
} while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
if (ret < 0)
- fail("cannot recv: %s\n", gnutls_strerror(ret));
+ fail("error in key update: %s\n", gnutls_strerror(ret));
/* client has data in the corked buffer */
do {