[gnutls-devel] GnuTLS | fix obtain credential type based on the key exchange type fail;fix log print key mac size error (!1670)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Sat Dec 17 08:08:18 CET 2022




Daiki Ueno started a new discussion on lib/auth/ecdhe.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1670#note_1213254707

> +		goto cleanup_all;
> +	}
>  
>  	/* generate pre-shared key */
>  	ret = calc_ecdh_key(session, psk_key, ecurve);
>  	if (ret < 0) {
>  		gnutls_assert();
> -		goto cleanup;
> +		goto cleanup_all;
>  	}
> -
> + cleanup_all:
> +	_gnutls_mpi_release(&session->key.proto.tls12.ecdh.x);
> +	_gnutls_mpi_release(&session->key.proto.tls12.ecdh.y);
> +	_gnutls_free_datum(&session->key.proto.tls12.ecdh.raw);
>   cleanup:

I wouldn't introduce the additional label (`cleanup_all`), as both `_gnutls_mpi_release` and `_gnutls_free_datum` safely handle NULL (like `free`), though we would be sure these fields (`ecdh.x`, `ecdh.y`, and `ecdh.raw`) are NULL initialized at the beginning of this function.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1670#note_1213254707
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/20221217/9d4fa19d/attachment-0001.html>


More information about the Gnutls-devel mailing list