[gnutls-devel] GnuTLS | crypto-api: add block cipher API with automatic padding (!1611)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Jul 22 08:00:35 CEST 2022




Daiki Ueno commented on a discussion on lib/crypto-api.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1611#note_1034888441

> +
> +	if (_gnutls_cipher_type(h->ctx_enc.e) != CIPHER_BLOCK) {
> +		ret = _gnutls_cipher_decrypt2(&h->ctx_enc,
> +					      ctext, ctext_len,
> +					      ptext, *ptext_len);
> +	} else {
> +		ret = _gnutls_cipher_decrypt2(&h->ctx_dec,
> +					      ctext, ctext_len,
> +					      ptext, *ptext_len);
> +	}
> +
> +	if (ret < 0) {
> +		_gnutls_switch_fips_state(GNUTLS_FIPS140_OP_ERROR);
> +	} else {
> +		_gnutls_switch_fips_state(GNUTLS_FIPS140_OP_APPROVED);
> +	}

Good point, fixed; also added a check on `ret` before removing padding.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1611#note_1034888441
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/20220722/1eff509a/attachment.html>


More information about the Gnutls-devel mailing list