Skip to contentSkip to conversation

crypto/qat: fix legacy sm4 ecb capability

PATCH Applied Ciara Power 4 participants 4 messages Jul 5, 2023 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/qat: fix legacy sm4 ecb capability

Following the deprecation of insecure algorithms in QAT, SM4-ECB should be included as legacy, to be disabled by default.

Fixes cffb726b7797 ("crypto/qat: enable insecure algorithms")
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c +3 -3
index bc71665a50..d25e1b2f3a 100644
@@ -46,6 +46,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_legacy_caps_gen3[] = {
 	QAT_SYM_PLAIN_AUTH_CAP(SHA3_224,
 		CAP_SET(block_size, 144),
 		CAP_RNG(digest_size, 28, 28, 0)),
+	QAT_SYM_CIPHER_CAP(SM4_ECB,
+		CAP_SET(block_size, 16),
+		CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 0, 0, 0))
 };
 
 static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
@@ -147,9 +150,6 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
 		CAP_RNG(key_size, 32, 32, 0),
 		CAP_RNG(digest_size, 16, 16, 0),
 		CAP_RNG(aad_size, 0, 240, 1), CAP_RNG(iv_size, 12, 12, 0)),
-	QAT_SYM_CIPHER_CAP(SM4_ECB,
-		CAP_SET(block_size, 16),
-		CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 0, 0, 0)),
 	QAT_SYM_CIPHER_CAP(SM4_CBC,
 		CAP_SET(block_size, 16),
 		CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 16, 16, 0)),
Signature · 1 line
2.25.1
Acked-by Kai Ji on v1 1/1
#1 lore raw

________________________________
From: Power, Ciara <[email protected]>
Sent: 05 July 2023 14:23
To: [email protected] <[email protected]>
Cc: Ji, Kai <[email protected]>; O'Donovan, Saoirse <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH] crypto/qat: fix legacy sm4 ecb capability

Following the deprecation of insecure algorithms in QAT, SM4-ECB should be included as legacy, to be disabled by default.

Fixes cffb726b7797 ("crypto/qat: enable insecure algorithms")
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c +3 -3
index bc71665a50..d25e1b2f3a 100644
@@ -46,6 +46,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_legacy_caps_gen3[] = {
         QAT_SYM_PLAIN_AUTH_CAP(SHA3_224,
                 CAP_SET(block_size, 144),
                 CAP_RNG(digest_size, 28, 28, 0)),
+       QAT_SYM_CIPHER_CAP(SM4_ECB,
+               CAP_SET(block_size, 16),
+               CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 0, 0, 0))
 };
 
 static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
@@ -147,9 +150,6 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
                 CAP_RNG(key_size, 32, 32, 0),
                 CAP_RNG(digest_size, 16, 16, 0),
                 CAP_RNG(aad_size, 0, 240, 1), CAP_RNG(iv_size, 12, 12, 0)),
-       QAT_SYM_CIPHER_CAP(SM4_ECB,
-               CAP_SET(block_size, 16),
-               CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 0, 0, 0)),
         QAT_SYM_CIPHER_CAP(SM4_CBC,
                 CAP_SET(block_size, 16),
                 CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 16, 16, 0)),

--
2.25.1

Tested-by on v1 1/1
#2 lore raw
In reply to Ciara Power

Hi Ciara,

Quoted 11 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Wednesday 5 July 2023 14:23
To: [email protected]
Cc: Ji, Kai <[email protected]>; O'Donovan, Saoirse <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH] crypto/qat: fix legacy sm4 ecb capability

Following the deprecation of insecure algorithms in QAT, SM4-ECB should be included as legacy, to be disabled by default.

Quoted 6 lines
Fixes cffb726b7797 ("crypto/qat: enable insecure algorithms")
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Applied
#3 lore raw
Quoted 5 lines
Quoted 5 lines

Subject: [PATCH] crypto/qat: fix legacy sm4 ecb capability

Following the deprecation of insecure algorithms in QAT, SM4-ECB should be included as legacy, to be disabled by default.

Quoted 8 lines
Quoted 6 lines
Fixes cffb726b7797 ("crypto/qat: enable insecure algorithms")
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to dpdk-next-crypto

Thanks.