From 99fd57e0a8fadcaef6bfe20a03b9a0e2c6933102 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 24 Aug 2015 21:34:43 +0300 Subject: [PATCH] tls: add Server Key Exchange message It contains the data for ECDHE. --- src/core/sipe-tls.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/sipe-tls.c b/src/core/sipe-tls.c index f51d13e2..90888e77 100644 --- a/src/core/sipe-tls.c +++ b/src/core/sipe-tls.c @@ -129,6 +129,7 @@ struct tls_internal_state { #define TLS_HANDSHAKE_TYPE_CLIENT_HELLO 1 #define TLS_HANDSHAKE_TYPE_SERVER_HELLO 2 #define TLS_HANDSHAKE_TYPE_CERTIFICATE 11 +#define TLS_HANDSHAKE_TYPE_SERVER_KEY_EXCHANGE 12 #define TLS_HANDSHAKE_TYPE_CERTIFICATE_REQ 13 #define TLS_HANDSHAKE_TYPE_SERVER_HELLO_DONE 14 #define TLS_HANDSHAKE_TYPE_CERTIFICATE_VERIFY 15 @@ -729,13 +730,22 @@ static const struct msg_descriptor Certificate_m = { &ServerHello_m, "Certificate", Certificate_l, TLS_HANDSHAKE_TYPE_CERTIFICATE }; +/* we only support ECDHE */ +static const struct layout_descriptor ServerKeyExchange_l[] = { + { "EC Curve Type", parse_integer, NULL, 0, 1, 0 }, + TLS_LAYOUT_DESCRIPTOR_END +}; +static const struct msg_descriptor ServerKeyExchange_m = { + &Certificate_m, "Server Key Exchange", ServerKeyExchange_l, TLS_HANDSHAKE_TYPE_SERVER_KEY_EXCHANGE +}; + static const struct layout_descriptor CertificateRequest_l[] = { { "CertificateType", parse_vector, NULL, 1, TLS_VECTOR_MAX8, 0 }, { "DistinguishedName", parse_vector, NULL, 0, TLS_VECTOR_MAX16, 0 }, TLS_LAYOUT_DESCRIPTOR_END }; static const struct msg_descriptor CertificateRequest_m = { - &Certificate_m, "Certificate Request", CertificateRequest_l, TLS_HANDSHAKE_TYPE_CERTIFICATE_REQ + &ServerKeyExchange_m, "Certificate Request", CertificateRequest_l, TLS_HANDSHAKE_TYPE_CERTIFICATE_REQ }; static const struct layout_descriptor ServerHelloDone_l[] = { -- 2.11.4.GIT