lede/package/qca/qca-nss-cfi/patches/0005-cryptoapi-v2.0-remove-dropped-flags.patch
2024-06-14 17:15:13 +08:00

98 lines
3.5 KiB
Diff

From 62bbb188e1a72d28916e1eca31f4cb9fbbf51cd1 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Sun, 22 Jan 2023 22:11:06 +0100
Subject: [PATCH 5/5] cryptoapi: v2.0: remove dropped flags
Upstream has dropped these flags as there was no use for them, so lets do
the same.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
cryptoapi/v2.0/nss_cryptoapi_aead.c | 6 ------
cryptoapi/v2.0/nss_cryptoapi_ahash.c | 4 ----
2 files changed, 10 deletions(-)
--- a/cryptoapi/v2.0/nss_cryptoapi_aead.c
+++ b/cryptoapi/v2.0/nss_cryptoapi_aead.c
@@ -207,7 +207,6 @@ int nss_cryptoapi_aead_setkey_noauth(str
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), keylen, 0);
if (!ctx->info) {
nss_cfi_err("%px: Unable to find algorithm with keylen\n", ctx);
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -ENOENT;
}
@@ -239,7 +238,6 @@ int nss_cryptoapi_aead_setkey_noauth(str
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
if (status < 0) {
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
return status;
}
@@ -271,14 +269,12 @@ int nss_cryptoapi_aead_setkey(struct cry
*/
if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) {
nss_cfi_err("%px: Unable to extract keys\n", ctx);
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EIO;
}
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), keys.enckeylen, crypto_aead_maxauthsize(aead));
if (!ctx->info) {
nss_cfi_err("%px: Unable to find algorithm with keylen\n", ctx);
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -ENOENT;
}
@@ -299,7 +295,6 @@ int nss_cryptoapi_aead_setkey(struct cry
*/
if (keys.authkeylen > ctx->info->auth_blocksize) {
nss_cfi_err("%px: Auth keylen(%d) exceeds supported\n", ctx, keys.authkeylen);
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL;
}
@@ -342,7 +337,6 @@ int nss_cryptoapi_aead_setkey(struct cry
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
if (status < 0) {
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
return status;
}
--- a/cryptoapi/v2.0/nss_cryptoapi_ahash.c
+++ b/cryptoapi/v2.0/nss_cryptoapi_ahash.c
@@ -192,7 +192,6 @@ int nss_cryptoapi_ahash_setkey(struct cr
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), 0, crypto_ahash_digestsize(ahash));
if (!ctx->info) {
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL;
}
@@ -215,7 +214,6 @@ int nss_cryptoapi_ahash_setkey(struct cr
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
if (status < 0) {
nss_cfi_warn("%px: Unable to allocate crypto session(%d)\n", ctx, status);
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
return status;
}
@@ -299,7 +297,6 @@ int nss_cryptoapi_ahash_init(struct ahas
*/
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), 0, 0);
if (!ctx->info) {
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL;
}
@@ -314,7 +311,6 @@ int nss_cryptoapi_ahash_init(struct ahas
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
if (status < 0) {
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
return status;
}