[gnutls-devel] GnuTLS | psktool: encode username if it contains special character (!1345)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Fri Oct 30 17:06:42 CET 2020
Daiki Ueno commented on a discussion on src/psk.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1345#note_439120769
> + tmp.size = strlen(username);
> +
> + ret = gnutls_hex_encode2(&tmp, &_username);
> + if (ret < 0) {
> + fprintf(stderr, "HEX encoding error\n");
> + ret = -1;
> + goto out;
> + }
> +
> + /* prepend '#' */
> + new_data = gnutls_realloc(_username.data, _username.size + 2);
> + if (!new_data) {
> + ret = -1;
> + goto out;
> + }
> + memmove(_username.data + 1, _username.data, _username.size);
Indeed, that's embarrassing :-) I've opened !1349 with a (hopefully) tighter logic.
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1345#note_439120769
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/20201030/0190fe99/attachment.html>
More information about the Gnutls-devel
mailing list