Compiling the Demo
The kunpengsecl repository provides the demo as well as all remote attestation tools except the QCA lib and QTA.
- Download the Kunpeng security library.
git clone -b v2.0.2 https://gitee.com/openeuler/kunpengsecl.git
- This feature depends on the CA header file contained in the iTrustee SDK. You can use the header file provided by the iTrustee SDK downloaded in Obtaining the iTrustee Patch Package.
- Open Makefile.
vim kunpengsecl/attestation/rac/Makefile
- Press i to enter the insert mode and change /opt to the actual path of itrustee_sdk.

- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open katools_arm64.go.
vim kunpengsecl/attestation/rac/ka/katools/katools_arm64.go
- Press i to enter the insert mode and change /opt to the actual path of itrustee_sdk.

- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open Makefile.
- This feature depends on the libteec_adaptor.so library. You can use the iTrustee SDK source code downloaded in Obtaining the iTrustee Patch Package to compile a dynamic library and copy it to the system path.
cd itrustee_sdk/src/CA gcc -fPIC -shared -o libteec_adaptor.so libteec_adaptor.c -I ../../include/CA/ cp libteec_adaptor.so /usr/lib64/
- This feature depends on the cJSON dynamic library. You can use the cJSON source code downloaded in 5 to install the library.
cd itrustee_sdk/test/TA/qta/src/cJSON make && make PREFIX=/usr install ldconfig
- This feature depends on Golang 1.17. Configure the dependency as follows:
wget https://go.dev/dl/go1.17.13.linux-arm64.tar.gz tar xvf go1.17.13.linux-arm64.tar.gz export PATH=$PWD/go/bin/:$PATH go version

- Compile the remote attestation demo to compile all components with one click.
cd kunpengsecl make clean && make build

After the compilation is complete, applications involved in the demo are generated, such as the QCA server and libteeverifier.so. In addition, some SO files of the simulator are generated and need to be deleted. Otherwise, the QCA lib preferentially uses the SO files of the simulator.
rm -rf attestation/tee/tverlib/simulator/*.so
- Deploy libteeverifier.so.
cp -rf attestation/tee/tverlib/verifier/libteeverifier.so /usr/lib64/
Parent topic: Examples