Issue with the decapsulation of data using CAAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with the decapsulation of data using CAAM

1,456 Views
joyal
Contributor I

Hi,
I am working on i.MX 8QM custom development board. I was trying to encrypt and decrypt the data using CAAM.
Referred the AN12554.pdf document and the following URL:
https://source.codeaurora.org/external/imxsupport/imx_sec_apps/tree/demo-caam-blobs/README.txt

Encapsulation of data is working. But decapsulation of the data failed with below error:
caam_jr 31430000.jr: Decapsulation job failed

Encryption of data also failed with the same error. Can anybody help me out?

Thanks in advance.

0 Kudos
4 Replies

1,121 Views
flobro
Contributor III

 

 

(note that I am using the demo referred to in the link _ same kernel listed above and applied the patches from the same link)
https://source.codeaurora.org/external/imxsupport/imx_sec_apps/tree/demo-caam-blobs/README.txt)

In further testing I have realized that even though I am seeing a bunch of:
"caam_jr 30902000.jr: Decapsulation job failed" messages, the encap, encrypt and decrypt functions appear to be working.

 

However the "decap"  produces a file with all zeros which is not correct.

 

echo desiredsecretkey > keyfile
dd if=/dev/urandom of=src bs=1 count=1000
./kb_test encap black keyfile blobfile
./kb_test encr black blobfile src srcenc
./kb_test decr black blobfile srcenc srcdec
diff src srcdec
./kb_test decap black blobfile blackkey

hexdump blobfile
0000000 0000 0000 0000 0000 dc80 03b1 fe00 ffff
0000010 8ac0 03c6 fe00 ffff 0000 0000 0000 0000
0000020 0000 0000 0000 0000 0000 0000 0000 0000
*
0000050

 

hexdump blackkey
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000020

0 Kudos

1,128 Views
flobro
Contributor III

I see the same problem with the same kernel/patches I just did today. Is anybody at NXP going to respond (it has been almost a year after all...)

0 Kudos

1,424 Views
jamesbone
NXP TechSupport
NXP TechSupport

Can you please provide which BSP are you using, and some test logs, to see the error?

 

0 Kudos

1,413 Views
joyal
Contributor I

Hi,
Sorry for the late reply.
I am using L5.4.24 BSP, the caam driver for 5.4.47 kernel with the patch applied to generate red/black blobs using CAAM and to encrypt/decrypt data.

Referring the following URL:
https://source.codeaurora.org/external/imxsupport/imx_sec_apps/tree/demo-caam-blobs/README.txt

Below are the system log:

Jul 13 05:09:20 iWave-G27M login[1037]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Jul 13 05:09:21 iWave-G27M login[1095]: ROOT LOGIN on '/dev/ttyLP4'
Jul 13 05:12:18 iWave-G27M kernel: [ 190.050817] caam_jr 31430000.jr: Decapsulation job failed

The test log is attached for reference.

Thank you

0 Kudos