[gnutls-devel] GnuTLS | TLS 1.3: ignore "early_data" extension (!706)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Aug 3 20:17:56 CEST 2018


Nikos Mavrogiannopoulos started a new discussion on lib/record.c:

> +			goto discard;
> +		}
> +
>  		gnutls_assert();
>  		_gnutls_audit_log(session,
>  				  "Discarded message[%u] due to invalid decryption\n",
>  				  (unsigned int)
>  				  _gnutls_uint64touint32(packet_sequence));
> +
>  		goto sanity_check_error;
>  	}
>  
> +	/* FIXME: as 0-RTT is not implemented yet, when the early data
> +	 * is indicated and the record is properly decrypted, treat it
> +	 * as the start of client's second flight. */
> +	session->internals.hsk_flags &= ~HSK_EARLY_DATA_IN_FLIGHT;

nit: I guess that's a cheap operation, but we are doing it unconditionally for every record packet received. What if we combine it with the if check in 1337. i.e. only run it if we know we are handling early data?
```
if (unlikely(session->internals.hsk_flags & HSK_EARLY_DATA_IN_FLIGHT)) {
  if (record.type == GNUTLS_APPLICATION_DATA) {
    if (record.length > session->security_parameters.max_early_data_size - session->internals.early_data_received)
      .
      .
      .
  } else {
    session->internals.hsk_flags &= ~HSK_EARLY_DATA_IN_FLIGHT;
  }
}
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/706#note_92414012
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20180803/2c371588/attachment.html>


More information about the Gnutls-devel mailing list