diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2018-07-03 18:42:01 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-07-11 15:20:28 +0000 |
commit | 6d6d9c1ba8d1f73e82ddb2b1698b0c67d45174d3 (patch) | |
tree | a40ef056e3c1330bdaf7dc2c446825a4dd1cdcf9 | |
parent | c8224ea701cd470bb4643e8d8d86115f2befaa66 (diff) | |
download | gnutls-6d6d9c1ba8d1f73e82ddb2b1698b0c67d45174d3.tar.gz |
pre_shared_key: do not send extension when no identities are present
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/ext/pre_shared_key.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ext/pre_shared_key.c b/lib/ext/pre_shared_key.c index 60ed86f742..dc56d1dc49 100644 --- a/lib/ext/pre_shared_key.c +++ b/lib/ext/pre_shared_key.c @@ -339,6 +339,13 @@ client_send_params(gnutls_session_t session, binders_len += 1 + _gnutls_mac_get_algo_len(prf_psk); } + /* if no tickets or identities to be sent */ + if (psk_id_len == 0) { + /* reset extensions buffer */ + extdata->length = spos; + return 0; + } + _gnutls_write_uint16(psk_id_len, &extdata->data[spos]); binders_pos = extdata->length-spos; |