[gnutls-devel] GnuTLS | Make XTS key check failure not fatal (!1648)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Thu Sep 29 16:26:08 CEST 2022




Daiki Ueno started a new discussion on lib/nettle/cipher.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1648#note_1119312731

> -
>  	switch (ctx->cipher->algo) {
> +	case GNUTLS_CIPHER_AES_128_XTS:
> +		if (_gnutls_fips_mode_enabled() &&
> +		    gnutls_memcmp(key, (char *)key + AES128_KEY_SIZE, AES128_KEY_SIZE) == 0)
> +			return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
> +		break;
> +	case GNUTLS_CIPHER_AES_256_XTS:
> +		if (_gnutls_fips_mode_enabled() &&
> +		    gnutls_memcmp(key, (char *)key + AES256_KEY_SIZE, AES256_KEY_SIZE) == 0)
> +			return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
> +		break;
>  	case GNUTLS_CIPHER_AES_128_GCM:
>  	case GNUTLS_CIPHER_AES_192_GCM:
>  	case GNUTLS_CIPHER_AES_256_GCM:
>  		ctx->rekey_counter = 0;

Hmm, I would only reset this counter after key is successfully set.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1648#note_1119312731
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/20220929/aef9a6e2/attachment-0001.html>


More information about the Gnutls-devel mailing list