summaryrefslogtreecommitdiffstats
path: root/test/sslapitest.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-03-30 17:38:15 +0100
committerMatt Caswell <matt@openssl.org>2017-04-03 19:07:29 +0100
commitf8a303fa7d6dbda31dc253f691d0e3224681ec2e (patch)
tree94e356194d89ff386b8858aa6d04092df9cf07f7 /test/sslapitest.c
parent59cebcf9f6cfd6c9703357c638aabb9c508c84bc (diff)
Update early data test for an even later arrival of CF
Commit 9b5c865df introduced a synthetic delay between arrival of EoED and CF. We actually want to delay the arrival of CF even further to demonstrate that we can write early data even when "in init". Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3091)
Diffstat (limited to 'test/sslapitest.c')
-rw-r--r--test/sslapitest.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c
index ab1d6ffedc..8859ef3222 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -1721,13 +1721,6 @@ static int test_early_data_read_write(int idx)
goto end;
}
- /* Push the ClientFinished and the normal data back into the server rbio */
- if (!BIO_write_ex(rbio, data + eoedlen, rawread - eoedlen, &rawwritten)
- || rawwritten != rawread - eoedlen) {
- printf("Failed to write the ClientFinished and data to server rbio\n");
- goto end;
- }
-
/*
* Server has not finished init yet, so should still be able to write early
* data.
@@ -1738,6 +1731,13 @@ static int test_early_data_read_write(int idx)
goto end;
}
+ /* Push the ClientFinished and the normal data back into the server rbio */
+ if (!BIO_write_ex(rbio, data + eoedlen, rawread - eoedlen, &rawwritten)
+ || rawwritten != rawread - eoedlen) {
+ printf("Failed to write the ClientFinished and data to server rbio\n");
+ goto end;
+ }
+
/* Server should be able to read normal data */
if (!SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)
|| readbytes != strlen(MSG5)) {
@@ -1759,16 +1759,6 @@ static int test_early_data_read_write(int idx)
}
ERR_clear_error();
- /*
- * Make sure we process the NewSessionTicket. This arrives post-handshake.
- * We attempt a read which we do not expect to return any data. Doesn't
- * apply when read_ahead is in use - the ticket will get processed along
- * with the application data in the second read below.
- */
- if (idx == 0 && SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) {
- printf("Unexpected success doing final client read\n");
- goto end;
- }
/* Client should be able to read the data sent by the server */
if (!SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)
|| readbytes != strlen(MSG6)
@@ -1776,7 +1766,14 @@ static int test_early_data_read_write(int idx)
printf("Failed reading message 6\n");
goto end;
}
-
+ /*
+ * Make sure we process the NewSessionTicket. This arrives post-handshake.
+ * We attempt a read which we do not expect to return any data.
+ */
+ if (SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) {
+ printf("Unexpected success doing final client read\n");
+ goto end;
+ }
SSL_SESSION_free(sess);
sess = SSL_get1_session(clientssl);