diff options
author | Vitaly Chikunov <vt@altlinux.org> | 2019-04-11 11:51:14 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-04-18 10:15:02 -0400 |
commit | 3ecc97259934489e7e03cbeb1d70f6a23cccb3ae (patch) | |
tree | 8456773371fd5ec9fb048f91a42bc02fd7887ed5 /crypto/rsa-pkcs1pad.c | |
parent | 78a0324f4a5328088fea9426cfe1d1851276c475 (diff) |
crypto: rsa - unimplement sign/verify for raw RSA backends
In preparation for new akcipher verify call remove sign/verify callbacks
from RSA backends and make PKCS1 driver call encrypt/decrypt instead.
This also complies with the well-known idea that raw RSA should never be
used for sign/verify. It only should be used with proper padding scheme
such as PKCS1 driver provides.
Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Cc: qat-linux@intel.com
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Gary Hook <gary.hook@amd.com>
Cc: Horia Geantă <horia.geanta@nxp.com>
Cc: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/rsa-pkcs1pad.c')
-rw-r--r-- | crypto/rsa-pkcs1pad.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c index 0a6680ca8cb6..94382fa2c6ac 100644 --- a/crypto/rsa-pkcs1pad.c +++ b/crypto/rsa-pkcs1pad.c | |||
@@ -429,7 +429,7 @@ static int pkcs1pad_sign(struct akcipher_request *req) | |||
429 | akcipher_request_set_crypt(&req_ctx->child_req, req_ctx->in_sg, | 429 | akcipher_request_set_crypt(&req_ctx->child_req, req_ctx->in_sg, |
430 | req->dst, ctx->key_size - 1, req->dst_len); | 430 | req->dst, ctx->key_size - 1, req->dst_len); |
431 | 431 | ||
432 | err = crypto_akcipher_sign(&req_ctx->child_req); | 432 | err = crypto_akcipher_decrypt(&req_ctx->child_req); |
433 | if (err != -EINPROGRESS && err != -EBUSY) | 433 | if (err != -EINPROGRESS && err != -EBUSY) |
434 | return pkcs1pad_encrypt_sign_complete(req, err); | 434 | return pkcs1pad_encrypt_sign_complete(req, err); |
435 | 435 | ||
@@ -551,7 +551,7 @@ static int pkcs1pad_verify(struct akcipher_request *req) | |||
551 | req_ctx->out_sg, req->src_len, | 551 | req_ctx->out_sg, req->src_len, |
552 | ctx->key_size); | 552 | ctx->key_size); |
553 | 553 | ||
554 | err = crypto_akcipher_verify(&req_ctx->child_req); | 554 | err = crypto_akcipher_encrypt(&req_ctx->child_req); |
555 | if (err != -EINPROGRESS && err != -EBUSY) | 555 | if (err != -EINPROGRESS && err != -EBUSY) |
556 | return pkcs1pad_verify_complete(req, err); | 556 | return pkcs1pad_verify_complete(req, err); |
557 | 557 | ||