From 90c4f5c1c4a4ec7bce1db01447df2727407cba3f Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 28 Feb 2018 11:38:53 +0100 Subject: Renumbered the key share extension to 51 This is a draft-ietf-tls-tls13-23 change. Resolves #398 Signed-off-by: Nikos Mavrogiannopoulos --- lib/ext/key_share.c | 2 +- tests/tls13/key_share.c | 6 +++--- tests/tls13/prf.c | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/ext/key_share.c b/lib/ext/key_share.c index d4cf9b78c8..f110e10268 100644 --- a/lib/ext/key_share.c +++ b/lib/ext/key_share.c @@ -45,7 +45,7 @@ static int key_share_send_params(gnutls_session_t session, const hello_ext_entry_st ext_mod_key_share = { .name = "Key Share", - .tls_id = 40, + .tls_id = 51, .gid = GNUTLS_EXTENSION_KEY_SHARE, .parse_type = _GNUTLS_EXT_TLS_POST_CS, .validity = GNUTLS_EXT_FLAG_CLIENT_HELLO|GNUTLS_EXT_FLAG_TLS13_SERVER_HELLO|GNUTLS_EXT_FLAG_HRR, diff --git a/tests/tls13/key_share.c b/tests/tls13/key_share.c index a048ccfbdd..205f7d0056 100644 --- a/tests/tls13/key_share.c +++ b/tests/tls13/key_share.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Red Hat, Inc. + * Copyright (C) 2017-2018 Red Hat, Inc. * * Author: Nikos Mavrogiannopoulos * @@ -129,7 +129,7 @@ unsigned int tls_id_to_group[] = { }; -#define TLS_EXT_KEY_SHARE 40 +#define TLS_EXT_KEY_SHARE 51 typedef struct ctx_st { gnutls_group_t group; @@ -154,7 +154,7 @@ void check_ks_contents(void *priv, gnutls_datum_t *msg) pos = 2; - while(pos < msg->size) { + while((unsigned)pos < msg->size) { id = (msg->data[pos] << 8) | msg->data[pos+1]; pos += 2; len -= 2; diff --git a/tests/tls13/prf.c b/tests/tls13/prf.c index 92178980a7..52b88851b8 100644 --- a/tests/tls13/prf.c +++ b/tests/tls13/prf.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2017 Red Hat, Inc. + * Copyright (C) 2015-2018 Red Hat, Inc. * * This file is part of GnuTLS. * @@ -131,13 +131,13 @@ static void check_prfs(gnutls_session_t session) unsigned char key_material[512]; int ret; - TRY_OLD(13, "key expansion", 34, (uint8_t*)"\xb1\xc3\x5e\x95\x9f\xf7\x5f\x91\x40\x85\xd7\xe8\xe7\x87\x0f\xb3\x78\xec\xbf\x40\x22\xcb\x24\x6e\x85\x91\xa4\xda\xa0\x48\xa5\xb9\x17\x65"); - TRY_OLD(6, "hello", 31, (uint8_t*)"\x85\x18\x53\x95\xa8\x60\xa5\x75\xd9\xc3\x34\xa3\x45\xa4\x90\xf0\x9c\x3a\xe3\xcf\x9a\x56\x4c\xcc\xeb\xba\x62\x2f\x36\x68\x84"); + TRY_OLD(13, "key expansion", 34, (uint8_t*)"\xd9\x09\xfa\x31\x2e\x2b\x79\x58\x3f\xde\x89\xd4\x41\xec\x2e\x62\xfd\x31\xaf\x7f\x62\xc4\x1c\xcc\x17\x6d\x0b\x30\x80\x62\x20\xb1\x52\x07"); + TRY_OLD(6, "hello", 31, (uint8_t*)"\x37\xa3\xba\xd9\x7d\x2a\x2b\xd0\x7a\x7a\x01\xde\x0a\x95\xe8\x88\x1a\xbb\x21\xa2\x7d\xa8\x12\xeb\xfd\x22\xed\x32\xc5\xa0\x19"); - TRY(13, "key expansion", 0, NULL, 34, (uint8_t*)"\xb1\xc3\x5e\x95\x9f\xf7\x5f\x91\x40\x85\xd7\xe8\xe7\x87\x0f\xb3\x78\xec\xbf\x40\x22\xcb\x24\x6e\x85\x91\xa4\xda\xa0\x48\xa5\xb9\x17\x65"); - TRY(6, "hello", 0, NULL, 31, (uint8_t*)"\x85\x18\x53\x95\xa8\x60\xa5\x75\xd9\xc3\x34\xa3\x45\xa4\x90\xf0\x9c\x3a\xe3\xcf\x9a\x56\x4c\xcc\xeb\xba\x62\x2f\x36\x68\x84"); - TRY(7, "context", 5, "abcd\xfa", 31, (uint8_t*)"\xf4\x49\x53\xf2\x8a\xcc\x59\x52\xa2\x29\x7d\xf4\x2f\x41\x92\x27\x6f\xc5\x1f\x52\xdb\x9a\xa5\x28\x33\x90\x28\x25\x52\x9f\x03"); - TRY(12, "null-context", 0, "", 31, (uint8_t*)"\x91\xb6\xe5\xaf\x3c\x7d\x75\x0a\x66\xe2\xd9\x3d\x57\x2c\x70\x73\x6f\xe2\x8f\x44\x5a\x22\x86\x46\x6b\xe9\x30\xc4\xf4\x0b\x7c"); + TRY(13, "key expansion", 0, NULL, 34, (uint8_t*)"\xd9\x09\xfa\x31\x2e\x2b\x79\x58\x3f\xde\x89\xd4\x41\xec\x2e\x62\xfd\x31\xaf\x7f\x62\xc4\x1c\xcc\x17\x6d\x0b\x30\x80\x62\x20\xb1\x52\x07"); + TRY(6, "hello", 0, NULL, 31, (uint8_t*)"\x37\xa3\xba\xd9\x7d\x2a\x2b\xd0\x7a\x7a\x01\xde\x0a\x95\xe8\x88\x1a\xbb\x21\xa2\x7d\xa8\x12\xeb\xfd\x22\xed\x32\xc5\xa0\x19"); + TRY(7, "context", 5, "abcd\xfa", 31, (uint8_t*)"\xac\x1a\x0f\x82\xd2\x97\xac\xc1\xd0\x2e\x90\xda\xcd\x70\x27\x97\xc0\x00\xf8\x8f\x9b\xa3\x0f\x22\x62\xee\x83\x55\xd9\x19\xa2"); + TRY(12, "null-context", 0, "", 31, (uint8_t*)"\x0d\xe3\xec\xd7\x82\x69\xe8\x38\xc5\xb9\x6d\x6f\xa8\x8b\xb7\xe8\x35\xd8\xfd\xfd\x63\x9d\x86\xfc\xf0\x49\x73\x0d\x26\xc9\xd7"); /* Try whether calling gnutls_prf() with non-null context or server-first * param, will fail */ -- cgit v1.2.1