Git Product home page Git Product logo

Comments (14)

bl4ck5un avatar bl4ck5un commented on July 17, 2024

You'll also need to link libmbedtls_sgx_t.a to your enclave.

from mbedtls-sgx.

aslibman avatar aslibman commented on July 17, 2024

Sorry, looks like I made a typo in the original comment. I have already linked libmbedtls_sgx_t.a to my enclave.

from mbedtls-sgx.

bl4ck5un avatar bl4ck5un commented on July 17, 2024

First of all, make sure to use the up-to-date master. Can you do the following and see if the problem persists?

mkdir build
cd build && cmake .. && make -j && make install

You'll get

mbedtls_SGX-2.6.0
├── include
│   └── mbedtls
└── lib
    ├── libmbedtls_SGX_t.a
    ├── libmbedtls_SGX_u.a
    └── mbedtls_SGX.edl

Then link libmbedtls_SGX_t.a to your enclave.

from mbedtls-sgx.

bl4ck5un avatar bl4ck5un commented on July 17, 2024

Could you also report the output of nm libmbedtls_SGX_t.a | grep dummy? Mine is

$ nm libmbedtls_SGX_t.a | grep dummy 
00000000000006df t entropy_dummy_source
000000000000c75b t ssl_cookie_check_dummy
000000000000c73c t ssl_cookie_write_dummy
                 U dummy
0000000000000000 t sgx_dummy
dummy.c.o:
0000000000000000 T dummy

from mbedtls-sgx.

aslibman avatar aslibman commented on July 17, 2024

The issue still persists.

nm libmbedtls_SGX_t.a | grep dummy
                 U dummy
0000000000000000 t sgx_dummy
00000000000006df t entropy_dummy_source
000000000000c701 t ssl_cookie_check_dummy
000000000000c6e2 t ssl_cookie_write_dummy

from mbedtls-sgx.

bl4ck5un avatar bl4ck5un commented on July 17, 2024

Seems like dummy.c somehow is not compiled? Can you do a clean build (i.e. deleting everything in the build dir) and see what's the output of make -Bn | grep dummy?

from mbedtls-sgx.

aslibman avatar aslibman commented on July 17, 2024
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=/home/vagrant/shared/xchange/mbedtls-SGX/build/CMakeFiles --progress-num=75 "Building C object trusted/CMakeFiles/mbedtls_SGX_t.dir/dummy.c.o"
cd /home/vagrant/shared/xchange/mbedtls-SGX/build/trusted && /usr/bin/cc   -I/home/vagrant/shared/xchange/mbedtls-SGX/trusted/ -I/home/vagrant/shared/xchange/mbedtls-SGX/trusted/mbedtls-2.6.0/include -I/opt/intel/sgxsdk/include -I/opt/intel/sgxsdk/include/tlibc -I/opt/intel/sgxsdk/include/stlport  -DDEBUG -UNDEBUG -UEDEBUG -m64 -O0 -g -nostdinc -fvisibility=hidden -fpie -fstack-protector   -o CMakeFiles/mbedtls_SGX_t.dir/dummy.c.o   -c /home/vagrant/shared/xchange/mbedtls-SGX/trusted/dummy.c

from mbedtls-sgx.

bl4ck5un avatar bl4ck5un commented on July 17, 2024

That seems fine. Can you compile the examples?

from mbedtls-sgx.

aslibman avatar aslibman commented on July 17, 2024

Yes, the examples compile.

from mbedtls-sgx.

bl4ck5un avatar bl4ck5un commented on July 17, 2024

Did you import the EDL file?

from mbedtls-sgx.

aslibman avatar aslibman commented on July 17, 2024

Yes, in my own EDL file I have from "../mbedtls-SGX/trusted/mbedtls_SGX.edl" import *;

from mbedtls-sgx.

bl4ck5un avatar bl4ck5un commented on July 17, 2024

Okay. If the examples compile, then the library is fine. I’ll need more source code to debug.

from mbedtls-sgx.

aslibman avatar aslibman commented on July 17, 2024

It is probably an issue with my linking then.

from mbedtls-sgx.

bl4ck5un avatar bl4ck5un commented on July 17, 2024

So I took a look at your Makefile. The crux of the problem is you have to link mbedtls in a group with SGX libs.

-Wl,--start-group  $(Mbedtls_SGX_t_Library_Name) -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group

from mbedtls-sgx.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.