Forums - Crypto Persistent Object

3 posts / 0 new
Last post
Crypto Persistent Object
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Thu, 2020-09-10 06:57

Hi,
I am having a problem using a persistent crypto object. I created a transient object from a PEM file/string and can use that object without any issues. I am using it to create a MD5-HMAC.
Once I transform it into a persistent object, which itself is done without any error reports, the function:

qapi_Crypto_Op_Key_Set() returns and error indicating "invalid parameter" (-2)

I already verified the handling of persistent objects from the QCLI_demo project and I do not see any difference. And as stated above the key itself and the transient object works as expected.

Is there anything else that can go wrong?

Thanks and regards

Andreas
 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2020-09-10 09:40

qapi_Crypto_Op_Key_Set() returns -2 in case the crypto object and operation mode are not compatibility.

Kindly refer to @target\quartz\demo\qcli_demo\src\crypto):   crypto_helper_compute_hmac()

  • Up0
  • Down0
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Thu, 2020-09-10 23:27

Hi Raja,
if crypto operation and object are not compatible, then why does the transient object work? It is made from the same key/pem file. Also, when I check the object info (qapi_Crypto_Obj_Info_t) that I get for both the transient and the persistent object, the only difference is the persistent flag.
Thank you for clarifying on the above.

Andreas

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.