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

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Oct 24 15:57:23 CEST 2019




Nikos Mavrogiannopoulos started a new discussion on lib/auth/psk_passwd.c: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_235087461

> +	unsigned i;
> +	gnutls_datum_t hexline, hex_username = { NULL, 0 };
> +
> +	/* move to first ':' */
> +	i = 0;
> +	while ((i < line_size) && (line[i] != '\0')
> +	       && (line[i] != ':')) {
> +		i++;
> +	}
> +
> +	if (line[0] == '#') {
> +		hexline.data = (void *) &line[1];
> +		hexline.size = i - 1;
> +
> +		if ((retval = gnutls_hex_decode2(&hexline, &hex_username)) < 0)
> +			return gnutls_assert_val(retval);

Shouldn't zero be returned here?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_235087461
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/20191024/31c173b9/attachment.html>


More information about the Gnutls-devel mailing list