Update TLS 1.3

This commit is contained in:
Zhi Guan
2022-07-25 14:15:41 +08:00
parent 15fd0dbcd4
commit 08dd20b70f
7 changed files with 269 additions and 203 deletions

View File

@@ -177,7 +177,7 @@ bad:
continue;
}
}
if (tls_send(&conn, (uint8_t *)send_buf, strlen(send_buf), &sentlen) != 1) {
if (tls13_send(&conn, (uint8_t *)send_buf, strlen(send_buf), 0 /*&sentlen*/) != 1) {
fprintf(stderr, "%s: send error\n", prog);
goto end;
}
@@ -185,7 +185,7 @@ bad:
{
memset(buf, 0, sizeof(buf));
len = sizeof(buf);
if (tls_recv(&conn, (uint8_t *)buf, sizeof(len), &len) != 1) {
if (tls13_recv(&conn, (uint8_t *)buf, /*sizeof(len),*/ &len) != 1) {
goto end;
}
buf[len] = 0;

View File

@@ -199,7 +199,7 @@ restart:
do {
len = sizeof(buf);
if ((rv = tls_recv(&conn, (uint8_t *)buf, sizeof(buf), &len)) != 1) {
if ((rv = tls13_recv(&conn, (uint8_t *)buf, /*sizeof(buf),*/ &len)) != 1) {
if (rv < 0) fprintf(stderr, "%s: recv failure\n", prog);
else fprintf(stderr, "%s: Disconnected by remote\n", prog);
@@ -209,7 +209,7 @@ restart:
}
} while (!len);
if (tls_send(&conn, (uint8_t *)buf, len, &sentlen) != 1) {
if (tls13_send(&conn, (uint8_t *)buf, len, /* &sentlen*/ 0) != 1) {
fprintf(stderr, "%s: send failure, close connection\n", prog);
close(conn.sock);
goto end;