[gnutls-devel] GnuTLS | WIP: support non-NULL-terminated PSKs (!917)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Mar 5 09:10:28 CET 2019


Nikos Mavrogiannopoulos started a new discussion on lib/auth/psk.h:

>  /* these structures should not use allocated data */
>  typedef struct psk_auth_info_st {
>  	char username[MAX_USERNAME_SIZE + 1];
> +	uint16_t len;
>  	dh_info_st dh;
>  	char hint[MAX_USERNAME_SIZE + 1];
>  } *psk_auth_info_t;
>  
>  typedef struct psk_auth_info_st psk_auth_info_st;
>  
> +inline static
> +void _gnutls_copy_psk_auth_info(psk_auth_info_t info, const gnutls_datum_t *psk)
> +{
> +	memcpy(info->username, psk->data, psk->size);

I see the functions that call this already did the bounds check. However a function which does an unchecked memcpy may be misused in the future by mistake. Any suggestions on how to improve this?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_147290164
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/20190305/ab878116/attachment-0001.html>


More information about the Gnutls-devel mailing list