[gnutls-devel] GnuTLS | Amend error code when SNI name is not accepted (!891)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Jan 25 23:40:00 CET 2019


Tim Rühsen commented on a discussion on lib/ext/server_name.c:

>  			DECR_LEN(data_size, len);
>  
>  			if (type == 0) { /* NAME_DNS */
> -				if (!_gnutls_dnsname_is_valid((char*)p, len))
> -					return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER);
> +				if (!_gnutls_dnsname_is_valid((char*)p, len)) {
> +					_gnutls_handshake_log
> +					    ("HSK[%p]: Server name is not acceptable: '%.*s'\n",
> +					     session, (int) len, p);
> +					return gnutls_assert_val(GNUTLS_E_UNRECOGNIZED_NAME);

> It is normal to return a descriptive error code to application and map it to the specific alert the standard requires.

That normally is my understanding, but in this case I wasn't sure. Then we should add another error as you suggest.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/891#note_135158614
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/20190125/91010706/attachment-0001.html>


More information about the Gnutls-devel mailing list