[gnutls-devel] GnuTLS | buffer size checks in accelerated cipher implementations (!1521)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Wed Jan 26 08:15:06 CET 2022




Stephan Mueller commented on a discussion on lib/accelerated/afalg.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1521#note_821779558

>  		return gnutls_assert_val(GNUTLS_E_ENCRYPTION_FAILED);
>  	}
>  
> +	if (unlikely(dst_size < src_size))
> +		return gnutls_assert_val(GNUTLS_E_SHORT_MEMORY_BUFFER);
> +
>  	iov.iov_base = (void *)dst;
> -	iov.iov_len = (src_size > dst_size) ? dst_size : src_size;
> +	iov.iov_len = src_size;

That check was simply a safety-valve guarding against programming errors. So, the change would be equally fine.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1521#note_821779558
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/20220126/3adfb430/attachment-0001.html>


More information about the Gnutls-devel mailing list