- destination length is rounded to multiple of blockcipher length before encryption
Signed-off-by: Cristian Stoica <cristian.sto...@freescale.com> --- authenc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/authenc.c b/authenc.c index a183820..774239a 100644 --- a/authenc.c +++ b/authenc.c @@ -655,10 +655,16 @@ __crypto_auth_run_zc(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcao goto free_auth_buf; } - if (caop->op == COP_ENCRYPT) + if (caop->op == COP_ENCRYPT) { dst_len = caop->len + cryptodev_cipher_get_tag_size(&ses_ptr->cdata); - else + /* TLS with aead ciphers: round dst_len to cipher blocksize */ + if (caop->flags & COP_FLAG_AEAD_TLS_TYPE) { + int bs = ses_ptr->cdata.blocksize; + dst_len += bs - (dst_len % bs); + } + } else { dst_len = caop->len; + } ret = get_userbuf(ses_ptr, caop->src, caop->len, caop->dst, dst_len, kcaop->task, kcaop->mm, &src_sg, &dst_sg); -- 1.8.3.1 _______________________________________________ Cryptodev-linux-devel mailing list Cryptodev-linux-devel@gna.org https://mail.gna.org/listinfo/cryptodev-linux-devel