goto end;
/* Write and read some early data */
- if (!SSL_write_early(clientssl, MSG1, strlen(MSG1), &written)
+ if (!SSL_write_early_data(clientssl, MSG1, strlen(MSG1), &written)
|| written != strlen(MSG1)) {
printf("Failed writing early data message 1\n");
goto end;
}
/*
- * 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;
}
/* Even after reading normal data, client should be able write early data */
- if (!SSL_write_early(clientssl, MSG3, strlen(MSG3), &written)
+ if (!SSL_write_early_data(clientssl, MSG3, strlen(MSG3), &written)
|| written != strlen(MSG3)) {
printf("Failed writing early data message 3\n");
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)
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;
goto end;
}
- /* Client and server should not be able to write early data now */
- if (SSL_write_early(clientssl, MSG6, strlen(MSG6), &written)) {
+ /* 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;
}
}
/* Write and read some early data */
- if (!SSL_write_early(clientssl, MSG1, strlen(MSG1), &written)
+ if (!SSL_write_early_data(clientssl, MSG1, strlen(MSG1), &written)
|| written != strlen(MSG1)) {
printf("Failed writing early data message 1\n");
goto end;
goto end;
}
- /*
- * We expect SSL_accept() to initially block as it handles the end of early
- * data alert
- */
- if (SSL_accept(serverssl) > 0) {
- printf("Unexpected success completing server handshake\n");
- goto end;
- }
-
if (SSL_accept(serverssl) <= 0) {
printf("Unable to complete server handshake\n");
goto end;
}
- /* Client and server should not be able to write early data now */
- if (SSL_write_early(clientssl, MSG6, strlen(MSG6), &written)) {
+ /* 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;
}
}
/* Write some early data */
- if (!SSL_write_early(clientssl, MSG1, strlen(MSG1), &written)
+ if (!SSL_write_early_data(clientssl, MSG1, strlen(MSG1), &written)
|| written != strlen(MSG1)) {
printf("Failed writing early data message 1\n");
goto end;
goto end;
/* Write some early data */
- if (!SSL_write_early(clientssl, MSG1, strlen(MSG1), &written)) {
+ if (!SSL_write_early_data(clientssl, MSG1, strlen(MSG1), &written)) {
printf("Unexpected failure writing message 1\n");
goto end;
}