crypto/openssl: fix RSA verify operation
authorAkash Saxena <akash.saxena@caviumnetworks.com>
Thu, 25 Oct 2018 10:00:56 +0000 (10:00 +0000)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 2 Nov 2018 11:25:39 +0000 (12:25 +0100)
commitfe1606e0138cdfd460a21cd3d5ac2a81884ee288
tree34e5103de7f7c5aeb61ccc303c324dd2d10c5f4c
parentc4160d303026ed11707e4a3a7a2e12b9be863d5a
crypto/openssl: fix RSA verify operation

In lib cryptodev, RSA verify operation inputs plain message text and
corresponding signature and expected to return
RTE_CRYPTO_OP_STATUS_SUCCESS/FAILURE on a signature match/mismatch.
Current OpenSSL PMD RSA verify implementation overrides application passed
sign input by decrypted output which isn't expected.

This patch addresses this issue in OpenSSL PMD. Now, OpenSSL PMD use
tmp buffer to pass to OpenSSL sign API and memcmp output with
original plain text to verify signature match.
Set op->status = RTE_CRYPTO_OP_STATUS_ERROR on signature mismatch.

Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym operations")
Cc: stable@dpdk.org
Signed-off-by: Ayuj Verma <ayuj.verma@caviumnetworks.com>
Signed-off-by: Akash Saxena <akash.saxena@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/crypto/openssl/rte_openssl_pmd.c