mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
79 lines
2.8 KiB
Diff
79 lines
2.8 KiB
Diff
From 202f57bae49947a04301ac8ac9bdc00f28f09355 Mon Sep 17 00:00:00 2001
|
|
From: Ansuel Smith <ansuelsmth@gmail.com>
|
|
Date: Sat, 13 Jun 2020 12:58:26 +0200
|
|
Subject: [PATCH 2/3] wip: support 5.4
|
|
|
|
---
|
|
cryptoapi/v1.1/nss_cryptoapi.c | 1 -
|
|
cryptoapi/v1.1/nss_cryptoapi_ablk.c | 12 ++++++------
|
|
cryptoapi/v1.1/nss_cryptoapi_aead.c | 2 +-
|
|
3 files changed, 7 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/cryptoapi/v1.1/nss_cryptoapi.c b/cryptoapi/v1.1/nss_cryptoapi.c
|
|
index d1a7313..a10590e 100644
|
|
--- a/cryptoapi/v1.1/nss_cryptoapi.c
|
|
+++ b/cryptoapi/v1.1/nss_cryptoapi.c
|
|
@@ -231,7 +231,6 @@ static struct crypto_alg cryptoapi_ablkcipher_algs[] = {
|
|
.cra_u = {
|
|
.ablkcipher = {
|
|
.ivsize = CTR_RFC3686_IV_SIZE,
|
|
- .geniv = "seqiv",
|
|
.min_keysize = AES_MIN_KEY_SIZE + CTR_RFC3686_NONCE_SIZE,
|
|
.max_keysize = AES_MAX_KEY_SIZE + CTR_RFC3686_NONCE_SIZE,
|
|
.setkey = nss_cryptoapi_ablk_aes_setkey,
|
|
diff --git a/cryptoapi/v1.1/nss_cryptoapi_ablk.c b/cryptoapi/v1.1/nss_cryptoapi_ablk.c
|
|
index 223591c..9b6c65e 100644
|
|
--- a/cryptoapi/v1.1/nss_cryptoapi_ablk.c
|
|
+++ b/cryptoapi/v1.1/nss_cryptoapi_ablk.c
|
|
@@ -108,7 +108,7 @@ EXPORT_SYMBOL(nss_cryptoapi_skcipher_ctx2session);
|
|
int nss_cryptoapi_ablkcipher_init(struct crypto_tfm *tfm)
|
|
{
|
|
struct nss_cryptoapi_ctx *ctx = crypto_tfm_ctx(tfm);
|
|
- struct crypto_ablkcipher *sw_tfm;
|
|
+ struct crypto_cipher *sw_tfm;
|
|
|
|
nss_cfi_assert(ctx);
|
|
|
|
@@ -122,20 +122,20 @@ int nss_cryptoapi_ablkcipher_init(struct crypto_tfm *tfm)
|
|
|
|
nss_cryptoapi_set_magic(ctx);
|
|
|
|
- if (!(crypto_tfm_alg_flags(tfm) & CRYPTO_ALG_NEED_FALLBACK))
|
|
+ if (!(crypto_tfm_alg_type(tfm) & CRYPTO_ALG_NEED_FALLBACK))
|
|
return 0;
|
|
|
|
/* Alloc fallback transform for future use */
|
|
- sw_tfm = crypto_alloc_ablkcipher(crypto_tfm_alg_name(tfm), 0, CRYPTO_ALG_ASYNC |
|
|
- CRYPTO_ALG_NEED_FALLBACK);
|
|
+ sw_tfm = crypto_alloc_cipher(crypto_tfm_alg_name(tfm), 0, CRYPTO_ALG_ASYNC |
|
|
+ CRYPTO_ALG_NEED_FALLBACK);
|
|
if (IS_ERR(sw_tfm)) {
|
|
nss_cfi_err("unable to alloc software crypto for %s\n", crypto_tfm_alg_name(tfm));
|
|
return -EINVAL;
|
|
}
|
|
|
|
/* set this tfm reqsize same to fallback tfm */
|
|
- tfm->crt_ablkcipher.reqsize = crypto_ablkcipher_reqsize(sw_tfm);
|
|
- ctx->sw_tfm = crypto_ablkcipher_tfm(sw_tfm);
|
|
+ tfm->crt_ablkcipher.reqsize = sizeof(struct nss_cryptoapi_ctx);
|
|
+ ctx->sw_tfm = crypto_cipher_tfm(sw_tfm);
|
|
|
|
return 0;
|
|
}
|
|
diff --git a/cryptoapi/v1.1/nss_cryptoapi_aead.c b/cryptoapi/v1.1/nss_cryptoapi_aead.c
|
|
index 527936b..53e4bed 100644
|
|
--- a/cryptoapi/v1.1/nss_cryptoapi_aead.c
|
|
+++ b/cryptoapi/v1.1/nss_cryptoapi_aead.c
|
|
@@ -103,7 +103,7 @@ int nss_cryptoapi_aead_init(struct crypto_aead *aead)
|
|
|
|
nss_cryptoapi_set_magic(ctx);
|
|
|
|
- if (!(crypto_tfm_alg_flags(tfm) & CRYPTO_ALG_NEED_FALLBACK))
|
|
+ if (!(crypto_tfm_alg_type(tfm) & CRYPTO_ALG_NEED_FALLBACK))
|
|
return 0;
|
|
|
|
/* Alloc fallback transform for future use */
|
|
--
|
|
2.27.0.rc0
|
|
|