diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2022-11-22 06:53:38 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2022-12-02 11:12:39 +0100 |
commit | 5b11d1a360ea23c80c6d4ec3f5986a788d0a0995 (patch) | |
tree | d3002b43aaafde5bcebdc04d77d2d217b13680ba /crypto | |
parent | crypto: caam - warn if blob_gen key is insecure (diff) | |
download | linux-5b11d1a360ea23c80c6d4ec3f5986a788d0a0995.tar.xz linux-5b11d1a360ea23c80c6d4ec3f5986a788d0a0995.zip |
crypto: rsa-pkcs1pad - Use helper to set reqsize
The value of reqsize must only be changed through the helper.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/rsa-pkcs1pad.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c index 3285e3af43e1..3bc76edb3f8a 100644 --- a/crypto/rsa-pkcs1pad.c +++ b/crypto/rsa-pkcs1pad.c @@ -579,6 +579,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; } @@ -674,7 +678,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; |