SE05x Middleware 04.05.00: do_package error

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

SE05x Middleware 04.05.00: do_package error

Jump to solution
1,087 Views
Igor
Contributor III

Hi all,

We want to use the SE05x middleware libraries 04.05.00 version on an i.MX8MP board.
Middleware is built using Yocto recipe with these Cmake settings (basically they are the default ones):

-DWithSharedLIB=ON -DCMAKE_BUILD_TYPE=Debug -DPTMW_Host=iMXLinux -DPTMW_HostCrypto=OPENSSL -DPTMW_OpenSSL=3_0 \
-DPTMW_SMCOM=T1oI2C -DPTMW_SE05X_Auth=None -DPTMW_Applet=SE051_H -DPTMW_SE05X_Ver=07_02 \
-DOPENSSL_INSTALL_PREFIX=${WORKDIR}/recipe-sysroot/usr/ \
-DPAHO_BUILD_DEB_PACKAGE=OFF -DPAHO_BUILD_DOCUMENTATION=OFF -DPAHO_BUILD_SAMPLES=OFF \
-DPAHO_BUILD_SHARED=ON -DPAHO_BUILD_STATIC=OFF -DPAHO_ENABLE_CPACK=ON \
-DPAHO_ENABLE_TESTING=OFF \
-DPAHO_WITH_SSL=ON \
-DOPENSSL_ROOT_DIR=${WORKDIR}/recipe-sysroot/usr/

When bitabake runs "do_package" command, I get this error:

ERROR: se05x-4.5.0-r0 do_package: dwarfsrcfiles failed with exit code 1 (cmd was ['dwarfsrcfiles', '/opt/variscite/var-fsl-yocto/build_xwayland_qt5/tmp/work/armv8a-fslc-linux/se05x/4.5.0-r0/package/home/root/se05x_mw_v04.05.00/simw-top/ext/openssl/lib_mingw/libssl.a']):
dwarfsrcfiles: /opt/variscite/var-fsl-yocto/build_xwayland_qt5/tmp/work/armv8a-fslc-linux/se05x/4.5.0-r0/package/home/root/se05x_mw_v04.05.00/simw-top/ext/openssl/lib_mingw/libssl.a: not a valid ELF file

Since I'm new to Edgelock product, can anyone help me? What am I doing wrong?

Thanks in advance,

Igor

SE051 SE050 

Labels (1)
0 Kudos
Reply
1 Solution
1,021 Views
Igor
Contributor III

HI Kan_Li,

To solve that issue, it seems to be necessary to add "INHIBIT_PACKAGE_STRIP_FILES" to the Secure Elements recipe in order to allow libraries to remain unstripped:

INHIBIT_PACKAGE_STRIP_FILES += "${PKGD}/home/root/${NXP-PLUG-TRUST-MW}/simw-top/ext/openssl/lib_mingw/libcrypto.a"
INHIBIT_PACKAGE_STRIP_FILES += "${PKGD}/home/root/${NXP-PLUG-TRUST-MW}/simw-top/ext/openssl/lib_mingw/libssl.a"

Hope that helps others who face same issue,

Igor

View solution in original post

15 Replies
456 Views
acharya_7
Contributor I

Hi @Igor I am trying to build with se05x_4.5.1 and using the recipe file from scripts/yocto/v04.03.01/se05x_4.3.1.bb but its failing heavily on do_compile can you kindly help me on this. Please provide the coreect recipe file for this.

Please anyone help me on this

0 Kudos
Reply
439 Views
Igor
Contributor III

Hi @acharya_7,

Attached is the file you asked for.
I had a problem with the path where Yocto expects to find the package, so I changed the recipe.

I Hope this helps,

Igor

0 Kudos
Reply
429 Views
acharya_7
Contributor I

Thank you so much @Igor Now i got it why the previous recipe file was failing. If you dont mind i need some confirmation that this recipe also compile all the demos in the libraries and put it in our main image am i correct?

0 Kudos
Reply
423 Views
Igor
Contributor III

You're welcome. I'll show you the contents of the binary and library folders: keep in mind that I've just started working with the Secure Element so I am not very experienced.

tmp/work/armv8a-poky-linux/se05x/4.5.1-r0/image/usr/local/bin/
├── apdu_player_demo
├── ex_ecc
├── ex_ecdh
├── ex_eddsa
├── ex_hkdf
├── ex_symmetric
├── jrcpv1_server
├── se052_deep_pwr_down
├── se052_reset_example
├── se05x_ConcurrentEcc
├── se05x_ConcurrentSymm
├── se05x_GetInfo
├── se05x_InvokeGarbageCollection
├── se05x_Minimal
└── se05x_MultipleDigestCryptoObj

tmp/work/armv8a-poky-linux/se05x/4.5.1-r0/image/usr/local/lib/
├── liba7x_utils.so
├── libex_common.so
├── libmwlog.so
├── libnxp_iot_agent_common.so
├── libse05x.so
├── libSEMS_LITE_AGENT_APIs.so
├── libsmCom.so
├── libSSS_APIs.so
├── libsssapisw.so
├── libsss_pkcs11.so
└── libsssProvider.so

 

 

0 Kudos
Reply
414 Views
acharya_7
Contributor I

Thank you @Igor , same for me too i have also just started to work on this, and i have also the same files in my rootfs but the problem that i facing that
1) ssscli tool and pkcs-tool i am not able to get (please help if you know anything)

2)how can i install all the demos binaries (if you know anything kindly help)

0 Kudos
Reply
388 Views
Igor
Contributor III
Hi @acharya_7, I suggest you take a look at the PlugAndTrustMV.pdf document included in the package: in paragraph 9.3 it's explained how to obtain the "ssscli tool" (especially check the necessary packages to insert in your image).
Also, in paragraphs 4.6 and 4.7 you will find the CMake options that allow you to compile the various demos (if I'm not mistaken).
0 Kudos
Reply
381 Views
acharya_7
Contributor I

Hi @Igor Actually i have followed everything from there, the required libraries are there but the sssclitool is not present. Okay thanks for this. Btw are you able to use ssscli tool?

0 Kudos
Reply
363 Views
Igor
Contributor III

Yes, I installed the SSSCli tool.
After uploading the image to the target, I ran the following commands (the same you find in the Se05x recipe):
# cd /home/root/se05x_mw_v04.05.01/simw-top/pycli/src
# python3 setup.py develop
The last command returned the following error: AttributeError: module ‘cryptography.utils’ has no attribute ‘register_interface’

Then I downgraded the cryptography library:
# python3 -m pip install PGPy
# python3 -m pip uninstall -y cryptography
# python3 -m pip install cryptography==37.0.4

I ran the python3 setup.py develop command again and the installation was successful.
For now I stopped here.

I hope this helps

0 Kudos
Reply
360 Views
acharya_7
Contributor I

Thank you so much @Igor yeah it is very helpful. just a last question you ran all these commands on your board right?

0 Kudos
Reply
355 Views
acharya_7
Contributor I

and @Igor if you have installed pkcs-tool kindly please help me with that too i am unable to get it. 

Thank you so much for these help!

 

0 Kudos
Reply
263 Views
Igor
Contributor III
Hi @acharya_7, as I told you I stopped on Se05x.
I think the pkcs-tool is part of the OpenSC package: try to take a look in the Yocto recipes.
0 Kudos
Reply
385 Views
brati_7
Contributor I
Actually i have followed everything from there, the reqired libraries are there but the sssclitool is not present. Okay thanks for this. Btw are you able to use ssscli tool?
0 Kudos
Reply
1,060 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @Igor ,

 

It looks like a yocto issue, please kindly refer to https://lists.yoctoproject.org/g/yocto/topic/75700982?p=Created,,,20,2,0,0 for details.

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
1,022 Views
Igor
Contributor III

HI Kan_Li,

To solve that issue, it seems to be necessary to add "INHIBIT_PACKAGE_STRIP_FILES" to the Secure Elements recipe in order to allow libraries to remain unstripped:

INHIBIT_PACKAGE_STRIP_FILES += "${PKGD}/home/root/${NXP-PLUG-TRUST-MW}/simw-top/ext/openssl/lib_mingw/libcrypto.a"
INHIBIT_PACKAGE_STRIP_FILES += "${PKGD}/home/root/${NXP-PLUG-TRUST-MW}/simw-top/ext/openssl/lib_mingw/libssl.a"

Hope that helps others who face same issue,

Igor

1,010 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @Igor ,

 

Thanks for the sharing!

 

Best Regards,

Kan

0 Kudos
Reply