linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Devulapally Shiva Krishna <shiva@chelsio.com>
To: davem@davemloft.net, herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, netdev@vger.kernel.org,
	secdev@chelsio.com, Devulapally Shiva Krishna <shiva@chelsio.com>,
	Ayush Sawal <ayush.sawal@chelsio.com>
Subject: [PATCH net-next 3/5] Crypto/chcr: fix for ccm(aes) failed test
Date: Tue,  5 May 2020 08:42:55 +0530	[thread overview]
Message-ID: <20200505031257.9153-4-shiva@chelsio.com> (raw)
In-Reply-To: <20200505031257.9153-1-shiva@chelsio.com>

The ccm(aes) test fails when req->assoclen > ~240bytes.

The problem is the value assigned to auth_offset is wrong.
As auth_offset is unsigned char, it can take max value as 255.
So fix it by making it unsigned int.

Signed-off-by: Ayush Sawal <ayush.sawal@chelsio.com>
Signed-off-by: Devulapally Shiva Krishna <shiva@chelsio.com>
---
 drivers/crypto/chelsio/chcr_algo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index 51adba5685a4..6b1a656e0a89 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -2925,7 +2925,7 @@ static void fill_sec_cpl_for_aead(struct cpl_tx_sec_pdu *sec_cpl,
 	unsigned int mac_mode = CHCR_SCMD_AUTH_MODE_CBCMAC;
 	unsigned int rx_channel_id = reqctx->rxqidx / ctx->rxq_perchan;
 	unsigned int ccm_xtra;
-	unsigned char tag_offset = 0, auth_offset = 0;
+	unsigned int tag_offset = 0, auth_offset = 0;
 	unsigned int assoclen;
 
 	if (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4309)
-- 
2.18.1


  parent reply	other threads:[~2020-05-05  3:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  3:12 [PATCH net-next 0/5] Crypto/chcr: Fix issues regarding algorithm implementation in driver Devulapally Shiva Krishna
2020-05-05  3:12 ` [PATCH net-next 1/5] Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests Devulapally Shiva Krishna
2020-05-05  3:12 ` [PATCH net-next 2/5] Crypto/chcr: fix ctr, cbc, xts and rfc3686-ctr " Devulapally Shiva Krishna
2020-05-05  3:12 ` Devulapally Shiva Krishna [this message]
2020-05-05  3:12 ` [PATCH net-next 4/5] Crypto/chcr: support for 48 byte key_len in aes-xts Devulapally Shiva Krishna
2020-05-05  3:12 ` [PATCH net-next 5/5] Crypto/chcr: fix for hmac(sha) test fails Devulapally Shiva Krishna
2020-05-07  0:44 ` [PATCH net-next 0/5] Crypto/chcr: Fix issues regarding algorithm implementation in driver David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200505031257.9153-4-shiva@chelsio.com \
    --to=shiva@chelsio.com \
    --cc=ayush.sawal@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=secdev@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).