[v1,2/2] test/crypto: remove data verification at rsa verify operation

Message ID 1539265391-9606-3-git-send-email-akash.saxena@caviumnetworks.com
State Superseded, archived
Delegated to: akhil goyal
Headers show
Series
  • Changes for RSA verify operation in OpenSSL PMD and unit tests
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch warning coding style issues

Commit Message

Akash Saxena Oct. 11, 2018, 1:43 p.m.
Change unit test app to check only for op->status =
RTE_CRYPTO_OP_STATUS_SUCCESS/ERROR instead of calling rsa_verify().

Signed-off-by: Ayuj Verma <ayuj.verma@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
---
 test/test/test_cryptodev_asym.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Akhil Goyal Oct. 16, 2018, 1:21 p.m. | #1
On 10/11/2018 7:13 PM, Akash Saxena wrote:
> Change unit test app to check only for op->status =
> RTE_CRYPTO_OP_STATUS_SUCCESS/ERROR instead of calling rsa_verify().
>
> Signed-off-by: Ayuj Verma <ayuj.verma@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> ---
>   test/test/test_cryptodev_asym.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/test/test/test_cryptodev_asym.c b/test/test/test_cryptodev_asym.c
> index 2fdfc1d..a899f99 100644
> --- a/test/test/test_cryptodev_asym.c
> +++ b/test/test/test_cryptodev_asym.c
> @@ -153,10 +153,13 @@ test_rsa_sign_verify(void)
>   		goto error_exit;
>   	}
>   	status = TEST_SUCCESS;
> -	int ret = 0;
> -	ret = rsa_verify(&rsaplaintext, result_op);
> -	if (ret)
> +	if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
> +		RTE_LOG(ERR, USER1,
> +				"line %u FAILED: %s",
> +				__LINE__, "Failed to process asym crypto op");
>   		status = TEST_FAILED;
> +		goto error_exit;
> +	}
>   
>   error_exit:
>   
What about test_rsa_enc_dec? Do you need to remove verify from that as well?
Verma, Shally Oct. 22, 2018, 12:29 p.m. | #2
>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Akhil Goyal
>Sent: 16 October 2018 18:51
>To: Saxena, Akash <Akash.Saxena@cavium.com>; pablo.de.lara.guarch@intel.com
>Cc: dev@dpdk.org; Verma, Shally <Shally.Verma@cavium.com>; Verma, Ayuj <Ayuj.Verma@cavium.com>
>Subject: Re: [dpdk-dev] [PATCH v1 2/2] test/crypto: remove data verification at rsa verify operation
>
>External Email
>
>On 10/11/2018 7:13 PM, Akash Saxena wrote:
>> Change unit test app to check only for op->status =
>> RTE_CRYPTO_OP_STATUS_SUCCESS/ERROR instead of calling rsa_verify().
>>
>> Signed-off-by: Ayuj Verma <ayuj.verma@caviumnetworks.com>
>> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
>> ---
>>   test/test/test_cryptodev_asym.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/test/test/test_cryptodev_asym.c b/test/test/test_cryptodev_asym.c
>> index 2fdfc1d..a899f99 100644
>> --- a/test/test/test_cryptodev_asym.c
>> +++ b/test/test/test_cryptodev_asym.c
>> @@ -153,10 +153,13 @@ test_rsa_sign_verify(void)
>>               goto error_exit;
>>       }
>>       status = TEST_SUCCESS;
>> -     int ret = 0;
>> -     ret = rsa_verify(&rsaplaintext, result_op);
>> -     if (ret)
>> +     if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
>> +             RTE_LOG(ERR, USER1,
>> +                             "line %u FAILED: %s",
>> +                             __LINE__, "Failed to process asym crypto op");
>>               status = TEST_FAILED;
>> +             goto error_exit;
>> +     }
>>
>>   error_exit:
>>
>What about test_rsa_enc_dec? Do you need to remove verify from that as well?
No. in case of enc_dec, PMD just return decrypted o/p so, app need to do cross-verify data.
In case of RSA_VERIFY OP PMD internally does memcmp of plaintext to decrypted o/p and ensure
Pass / fail. So, doing it again at app level is redundant.

Thanks
Shally
Akhil Goyal Oct. 24, 2018, 1:09 p.m. | #3
>>> @@ -153,10 +153,13 @@ test_rsa_sign_verify(void)
>>>                goto error_exit;
>>>        }
>>>        status = TEST_SUCCESS;
>>> -     int ret = 0;
>>> -     ret = rsa_verify(&rsaplaintext, result_op);
>>> -     if (ret)
>>> +     if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
>>> +             RTE_LOG(ERR, USER1,
>>> +                             "line %u FAILED: %s",
>>> +                             __LINE__, "Failed to process asym crypto op");
>>>                status = TEST_FAILED;
>>> +             goto error_exit;
>>> +     }
>>>
>>>    error_exit:
>>>
>> What about test_rsa_enc_dec? Do you need to remove verify from that as well?
> No. in case of enc_dec, PMD just return decrypted o/p so, app need to do cross-verify data.
> In case of RSA_VERIFY OP PMD internally does memcmp of plaintext to decrypted o/p and ensure
> Pass / fail. So, doing it again at app level is redundant.
Ok
> Thanks
> Shally

Patch

diff --git a/test/test/test_cryptodev_asym.c b/test/test/test_cryptodev_asym.c
index 2fdfc1d..a899f99 100644
--- a/test/test/test_cryptodev_asym.c
+++ b/test/test/test_cryptodev_asym.c
@@ -153,10 +153,13 @@  test_rsa_sign_verify(void)
 		goto error_exit;
 	}
 	status = TEST_SUCCESS;
-	int ret = 0;
-	ret = rsa_verify(&rsaplaintext, result_op);
-	if (ret)
+	if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
+		RTE_LOG(ERR, USER1,
+				"line %u FAILED: %s",
+				__LINE__, "Failed to process asym crypto op");
 		status = TEST_FAILED;
+		goto error_exit;
+	}
 
 error_exit: