Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 528bd307 authored by Mallikarjuna Reddy Amireddy's avatar Mallikarjuna Reddy Amireddy
Browse files

qcedev: msm: Remove gating of zero length packets for authentication



Crypto drivers has zero length checks during the parameters validation,
which results in failures for zero length input. This patch update
the checks in crypto drivers to support SHA1/SHA256/HMAC/CMAC zero
length input data.

Change-Id: Ic58385d78b7bc5839674f118e1935361d8e5563d
Signed-off-by: default avatarMallikarjuna Reddy Amireddy <mamire@codeaurora.org>
parent bd217783
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -926,11 +926,6 @@ static int qcedev_sha_final(struct qcedev_async_req *qcedev_areq,
		return -EINVAL;
	}

	if (handle->sha_ctxt.trailing_buf_len == 0) {
		pr_err("%s Incorrect trailng buffer %d\n", __func__,
					handle->sha_ctxt.trailing_buf_len);
		return -EINVAL;
	}
	handle->sha_ctxt.last_blk = 1;

	total = handle->sha_ctxt.trailing_buf_len;
@@ -1700,10 +1695,9 @@ static int qcedev_check_sha_params(struct qcedev_sha_op_req *req,
		pr_err("%s: CMAC not supported\n", __func__);
		goto sha_error;
	}
	if ((req->entries == 0) || (req->data_len == 0) ||
			(req->entries > QCEDEV_MAX_BUFFERS)) {
		pr_err("%s: Invalid data length (%d)/ num entries (%d)\n",
				__func__, req->data_len, req->entries);
	if ((!req->entries) || (req->entries > QCEDEV_MAX_BUFFERS)) {
		pr_err("%s: Invalid num entries (%d)\n",
						__func__, req->entries);
		goto sha_error;
	}