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

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Mar 12 17:04:19 CET 2019




Ander Juaristi commented on a 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);

How about an assertion? `assert(sizeof(info->username) <= username->size)`

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_149746057
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/20190312/33f545cb/attachment.html>


More information about the Gnutls-devel mailing list