Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling the Demo

The kunpengsecl repository provides the demo as well as all remote attestation tools except the QCA lib and QTA.

  1. Download the Kunpeng security library.
    git clone -b v2.0.2 https://gitee.com/openeuler/kunpengsecl.git
  2. 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.
    1. Open Makefile.
      vim kunpengsecl/attestation/rac/Makefile
    2. Press i to enter the insert mode and change /opt to the actual path of itrustee_sdk.

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

    6. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  3. 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/
  4. 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
  5. 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

  6. 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
  7. Deploy libteeverifier.so.
    cp -rf attestation/tee/tverlib/verifier/libteeverifier.so /usr/lib64/