summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-03-02 15:49:33 +0000
committerMatt Caswell <matt@openssl.org>2017-03-02 17:44:16 +0000
commit09f288748266577cc38b77ca31c47b9e9f15890e (patch)
tree959cda9439e4e254476e88bdd8aa297bccdaa467 /test
parent0665b4edae3fec740ebe12fe2946d4cc9585ca86 (diff)
Update early data API for writing to unauthenticated clients
Change the early data API so that the server must use SSL_write_early_data() to write to an unauthenticated client. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2737)
Diffstat (limited to 'test')
-rw-r--r--test/sslapitest.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 253e2021fc..1b96527320 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -1624,10 +1624,10 @@ static int test_early_data_read_write(void)
}
/*
- * Server should be able to write normal data, and client should be able to
+ * Server should be able to write data, and client should be able to
* read it.
*/
- if (!SSL_write_ex(serverssl, MSG2, strlen(MSG2), &written)
+ if (!SSL_write_early_data(serverssl, MSG2, strlen(MSG2), &written)
|| written != strlen(MSG2)) {
printf("Failed writing message 2\n");
goto end;
@@ -1647,7 +1647,7 @@ static int test_early_data_read_write(void)
goto end;
}
- /* Server should still be able read early data after writing normal data */
+ /* Server should still be able read early data after writing data */
if (SSL_read_early_data(serverssl, buf, sizeof(buf), &readbytes)
!= SSL_READ_EARLY_DATA_SUCCESS
|| readbytes != strlen(MSG3)
@@ -1656,8 +1656,8 @@ static int test_early_data_read_write(void)
goto end;
}
- /* Write more normal data from server and read it from client */
- if (!SSL_write_ex(serverssl, MSG4, strlen(MSG4), &written)
+ /* Write more data from server and read it from client */
+ if (!SSL_write_early_data(serverssl, MSG4, strlen(MSG4), &written)
|| written != strlen(MSG4)) {
printf("Failed writing message 4\n");
goto end;
@@ -1700,7 +1700,7 @@ static int test_early_data_read_write(void)
goto end;
}
- /* Client and server should not be able to write early data now */
+ /* Client and server should not be able to write/read early data now */
if (SSL_write_early_data(clientssl, MSG6, strlen(MSG6), &written)) {
printf("Unexpected success writing early data\n");
goto end;
@@ -1778,7 +1778,7 @@ static int test_early_data_read_write(void)
goto end;
}
- /* Client and server should not be able to write early data now */
+ /* Client and server should not be able to write/read early data now */
if (SSL_write_early_data(clientssl, MSG6, strlen(MSG6), &written)) {
printf("Unexpected success writing early data (2)\n");
goto end;