[gnutls-devel] GnuTLS | WIP: updates in anti-replay subsystem (!805)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Wed Nov 14 14:46:58 CET 2018


Daiki Ueno started a new discussion on lib/tls13/anti_replay.c:

>  	p = entry_buffer;
>  	_gnutls_write_uint32(PACKED_SESSION_MAGIC, p);
>  	p += 4;
>  	_gnutls_write_uint32(now.tv_sec, p);
>  	p += 4;
> -	_gnutls_write_uint32(anti_replay->window / 1000, p);
> +	window = anti_replay->window / 1000;
> +	_gnutls_write_uint32(window, p);
>  	p += 4;
>  	entry.data = entry_buffer;
>  	entry.size = p - entry_buffer;
>  
> -	ret = session->internals.db_add_func(session->internals.db_ptr,
> -					     key, entry);
> +	ret = anti_replay->db_add_func(anti_replay->db_ptr,
> +				       now.tv_sec+window, &key, &entry);

Couldn't `now.tv_sec+window` be overflow (and if `time_t` is signed, it's an undefined behavior)?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/805#note_117223423
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/20181114/021736ed/attachment.html>


More information about the Gnutls-devel mailing list