mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-18 18:01:23 +00:00
50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
From 30c7c88427f0fcb132d3a0f81645c286e73d7331 Mon Sep 17 00:00:00 2001
|
|
From: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
|
|
Date: Wed, 23 Sep 2020 16:47:21 +0530
|
|
Subject: [PATCH] md: dm-crypt: use qce based on the algorithm string
|
|
|
|
This patch will select qualcomm crypto engine if algorithm
|
|
string has qce in it. For example "cbc-aes-qce"
|
|
|
|
Signed-off-by: POOVENDHAN SELVARAJ <quic_poovendh@quicinc.com>
|
|
Change-Id: Id1edd7580ed1460f64e96b037fb1dc53cb1498e0
|
|
(cherry picked from commit 427405deba3726058e0eb2bc0feb3b33250d3c96)
|
|
---
|
|
drivers/md/dm-crypt.c | 13 ++++++-------
|
|
1 file changed, 6 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
|
|
index 2ce75aaf97dc..4a00103ebfec 100644
|
|
--- a/drivers/md/dm-crypt.c
|
|
+++ b/drivers/md/dm-crypt.c
|
|
@@ -2982,7 +2982,10 @@ static int crypt_ctr_cipher_old(struct dm_target *ti, char *cipher_in, char *key
|
|
if (!cipher_api)
|
|
goto bad_mem;
|
|
|
|
- if (*ivmode && !strcmp(*ivmode, "essiv")) {
|
|
+ if (qcengine) {
|
|
+ ret = snprintf(cipher_api, CRYPTO_MAX_ALG_NAME,
|
|
+ "%s-%s-%s", chainmode, cipher, qcengine);
|
|
+ } else if (*ivmode && !strcmp(*ivmode, "essiv")) {
|
|
if (!*ivopts) {
|
|
ti->error = "Digest algorithm missing for ESSIV mode";
|
|
kfree(cipher_api);
|
|
@@ -2991,12 +2994,8 @@ static int crypt_ctr_cipher_old(struct dm_target *ti, char *cipher_in, char *key
|
|
ret = snprintf(cipher_api, CRYPTO_MAX_ALG_NAME,
|
|
"essiv(%s(%s),%s)", chainmode, cipher, *ivopts);
|
|
} else {
|
|
- if (qcengine)
|
|
- ret = snprintf(cipher_api, CRYPTO_MAX_ALG_NAME,
|
|
- "%s-%s-%s", chainmode, cipher, qcengine);
|
|
- else
|
|
- ret = snprintf(cipher_api, CRYPTO_MAX_ALG_NAME,
|
|
- "%s(%s)", chainmode, cipher);
|
|
+ ret = snprintf(cipher_api, CRYPTO_MAX_ALG_NAME,
|
|
+ "%s(%s)", chainmode, cipher);
|
|
}
|
|
if (ret < 0 || ret >= CRYPTO_MAX_ALG_NAME) {
|
|
kfree(cipher_api);
|
|
--
|
|
2.34.1
|
|
|