summaryrefslogtreecommitdiff
path: root/lib/libssl/tls13_handshake.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2019-01-21 13:45:58 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2019-01-21 13:45:58 +0000
commit60bbdcb85a3f5d62f272f34886d323f2197d9e72 (patch)
treef125bda090b1d3c84fc8367369062e13f8450992 /lib/libssl/tls13_handshake.c
parent44d2bf3b4bd98b62d4c9f6363bf0e0034a9ad3c8 (diff)
Provide the initial TLSv1.3 client implementation.
Move tls13_connect() to a new tls13_client.c file and provide a legacy wrapper to it, which allocates a struct tls_ctx if necessary. Also move tls13_client_hello_send() to tls13_client.c and actual implement the building of a client hello. ok tb@
Diffstat (limited to 'lib/libssl/tls13_handshake.c')
-rw-r--r--lib/libssl/tls13_handshake.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/lib/libssl/tls13_handshake.c b/lib/libssl/tls13_handshake.c
index 78f5611b70b..160202421c0 100644
--- a/lib/libssl/tls13_handshake.c
+++ b/lib/libssl/tls13_handshake.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_handshake.c,v 1.17 2019/01/21 13:13:46 jsing Exp $ */
+/* $OpenBSD: tls13_handshake.c,v 1.18 2019/01/21 13:45:57 jsing Exp $ */
/*
* Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Joel Sing <jsing@openbsd.org>
@@ -31,11 +31,7 @@
struct tls13_handshake_action {
uint8_t record_type;
uint8_t handshake_type;
-
uint8_t sender;
-#define TLS13_HS_CLIENT 1
-#define TLS13_HS_SERVER 2
-
uint8_t handshake_complete;
int (*send)(struct tls13_ctx *ctx);
@@ -44,7 +40,6 @@ struct tls13_handshake_action {
enum tls13_message_type tls13_handshake_active_state(struct tls13_ctx *ctx);
-int tls13_connect(struct tls13_ctx *ctx);
int tls13_accept(struct tls13_ctx *ctx);
struct tls13_handshake_action *
@@ -313,14 +308,6 @@ tls13_handshake_perform(struct tls13_ctx *ctx)
}
int
-tls13_connect(struct tls13_ctx *ctx)
-{
- ctx->mode = TLS13_HS_CLIENT;
-
- return tls13_handshake_perform(ctx);
-}
-
-int
tls13_accept(struct tls13_ctx *ctx)
{
ctx->mode = TLS13_HS_SERVER;
@@ -391,13 +378,13 @@ tls13_handshake_recv_action(struct tls13_ctx *ctx,
return TLS13_IO_FAILURE;
}
- return action->recv(ctx);
-}
+ /* XXX provide CBS and check all consumed. */
+ ret = action->recv(ctx);
-int
-tls13_client_hello_send(struct tls13_ctx *ctx)
-{
- return 0;
+ tls13_handshake_msg_free(ctx->hs_msg);
+ ctx->hs_msg = NULL;
+
+ return ret;
}
int