summaryrefslogtreecommitdiffstats
path: root/test/ssltestlib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-03-14 19:22:48 +0000
committerMatt Caswell <matt@openssl.org>2018-05-17 16:48:25 +0100
commit36ff232cf2bf5dfcaf9e60a8c492439428a243bb (patch)
tree8e2dfdd9d77088c4ce0245708b9c906daced0e2f /test/ssltestlib.c
parent394159da608f625b60f07c59e36dc7d01df3a709 (diff)
Change the default number of NewSessionTickets we send to 2
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5227)
Diffstat (limited to 'test/ssltestlib.c')
-rw-r--r--test/ssltestlib.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/ssltestlib.c b/test/ssltestlib.c
index c7689631f1..2ef4b5d432 100644
--- a/test/ssltestlib.c
+++ b/test/ssltestlib.c
@@ -682,7 +682,7 @@ int create_ssl_objects(SSL_CTX *serverctx, SSL_CTX *clientctx, SSL **sssl,
int create_ssl_connection(SSL *serverssl, SSL *clientssl, int want)
{
- int retc = -1, rets = -1, err, abortctr = 0;
+ int retc = -1, rets = -1, err, abortctr = 0, i;
int clienterr = 0, servererr = 0;
unsigned char buf;
size_t readbytes;
@@ -741,13 +741,16 @@ int create_ssl_connection(SSL *serverssl, SSL *clientssl, int want)
/*
* We attempt to read some data on the client side which we expect to fail.
* This will ensure we have received the NewSessionTicket in TLSv1.3 where
- * appropriate.
+ * appropriate. We do this twice because there are 2 NewSesionTickets.
*/
- if (SSL_read_ex(clientssl, &buf, sizeof(buf), &readbytes) > 0) {
- if (!TEST_ulong_eq(readbytes, 0))
+ for (i = 0; i < 2; i++) {
+ if (SSL_read_ex(clientssl, &buf, sizeof(buf), &readbytes) > 0) {
+ if (!TEST_ulong_eq(readbytes, 0))
+ return 0;
+ } else if (!TEST_int_eq(SSL_get_error(clientssl, 0),
+ SSL_ERROR_WANT_READ)) {
return 0;
- } else if (!TEST_int_eq(SSL_get_error(clientssl, 0), SSL_ERROR_WANT_READ)) {
- return 0;
+ }
}
return 1;