[gnutls-devel] GnuTLS | update tlsfuzzer scripts to latest version (!774)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Wed Oct 17 12:51:34 CEST 2018


Tom commented on a discussion on lib/handshake.c:

> +		/* TLS1.2 or earlier, kx is associated with ciphersuite */
> +		kx = session->security_parameters.cs->kx_algorithm;
>  	}
>  
>  	if (kx) {
>  		session->security_parameters.server_auth_type = _gnutls_map_kx_get_cred(kx, 1);
>  		session->security_parameters.client_auth_type = _gnutls_map_kx_get_cred(kx, 0);
> -	} else if (session->internals.resumed == RESUME_FALSE) {
> -		return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
> +	} else if (unlikely(session->internals.resumed == RESUME_FALSE)) {
> +		/* Here we can only arrive if something we received
> +		 * prevented the session from completing. */
> +		return gnutls_assert_val(GNUTLS_E_ILLEGAL_PARAMETER);
>  	}
>  
>  	return 0;

That might be the case but I think it is not bad to change this convention then. It makes reading much clearer and we don't have this enum entry for nothing right? Once in a while it is good to upgrade to a better / nicer solution just as was the case with `gnutls_assert_val()` function.

Anyway, in my contributions I return `GNUTLS_E_SUCCESS` in cases where I need to return an OK status code and use literals only where I need to return e.g. the number of bytes sent.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/774#note_109472790
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/20181017/aa835f55/attachment-0001.html>


More information about the Gnutls-devel mailing list