[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 11:06:32 CEST 2022




Alexander Sosedkin commented on a discussion on lib/crypto-api.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1611#note_1035103700

> +	} 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);
> +	}
> +
> +	if (_gnutls_cipher_type(h->ctx_enc.e) == CIPHER_BLOCK &&
> +	    (flags & GNUTLS_CIPHER_PADDING_PKCS7)) {
> +		uint8_t *p = ptext;
> +		uint8_t padding = p[*ptext_len - 1];

my bad

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1611#note_1035103700
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/7287205d/attachment-0001.html>


More information about the Gnutls-devel mailing list