aboutsummaryrefslogtreecommitdiff
path: root/crypto/rsa-pkcs1pad.c
diff options
context:
space:
mode:
authorHerbert Xu2022-11-22 13:53:38 +0800
committerGreg Kroah-Hartman2023-09-13 09:42:26 +0200
commit9c8dab18f83001b38c9d3413b108d2dd5671d07f (patch)
tree6793335a394a2677552ae5fa0776c62f4faa986d /crypto/rsa-pkcs1pad.c
parent63f1117db59001a4e1734fba8fc6db6f3540ecdd (diff)
crypto: rsa-pkcs1pad - Use helper to set reqsize
commit 5b11d1a360ea23c80c6d4ec3f5986a788d0a0995 upstream. The value of reqsize must only be changed through the helper. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto/rsa-pkcs1pad.c')
-rw-r--r--crypto/rsa-pkcs1pad.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c
index 3237b50baf3c..1cf267bc6f9e 100644
--- a/crypto/rsa-pkcs1pad.c
+++ b/crypto/rsa-pkcs1pad.c
@@ -575,6 +575,10 @@ static int pkcs1pad_init_tfm(struct crypto_akcipher *tfm)
return PTR_ERR(child_tfm);
ctx->child = child_tfm;
+
+ akcipher_set_reqsize(tfm, sizeof(struct pkcs1pad_request) +
+ crypto_akcipher_reqsize(child_tfm));
+
return 0;
}
@@ -670,7 +674,6 @@ static int pkcs1pad_create(struct crypto_template *tmpl, struct rtattr **tb)
inst->alg.set_pub_key = pkcs1pad_set_pub_key;
inst->alg.set_priv_key = pkcs1pad_set_priv_key;
inst->alg.max_size = pkcs1pad_get_max_size;
- inst->alg.reqsize = sizeof(struct pkcs1pad_request) + rsa_alg->reqsize;
inst->free = pkcs1pad_free;