Comments (3)
zhq0918,
I think you are confused on what close
is undefined here. That error is in reference to a function not a member of a struct or union.
NOTE this section of code:
if (bio->close) {
if (bio->ssl)
wolfSSL_free(bio->ssl);
if (bio->fd)
CloseSocket(bio->fd); // <---- Source of Error
}
You'll note that in wolfssl/wolfio.h CloseSocket is defined as "close":
342 #ifndef CloseSocket
343 #define CloseSocket(s) close(s)
344 #endif
So the code expansion there is:
if (bio->close) {
if (bio->ssl)
wolfSSL_free(bio->ssl);
if (bio->fd)
close(bio->fd); // <---- Source of Error
}
I provided a solution for this already on our forums, please see https://www.wolfssl.com/forums/topic1368-in-sgx-enclavecant-use-function-wolfsslx509verifycert.html, my post on 17th May 2019 11:17:22
Regards,
K
from wolfssl-examples.
@kaleb-himes thank you for your answer, I commented out the line and the problem was solved temporarily.
Regards
zhq0918
from wolfssl-examples.
zhq0918,
Allow me to re-iterate the solution here. You need to create this function for the library. close is a system level function. Enclaves are protected execution spaces with no access to the system. Enclaves can only execute whatever functions are inside the enclave. To call out to the system you need to create an untrusted out call to access the system.
Step 1: Checkout https://github.com/wolfSSL/wolfssl-examples/blob/master/SGX_Linux/trusted/Wolfssl_Enclave.c and see how we made functions for printf, recv, send, current_time, .... etc
. The enclave can't even call "printf" because it doesn't have access to the system. It doesn't know what the stdout stream is so we have to give the enclave access to those system level functions via untrusted out calls. Write a close function in https://github.com/wolfSSL/wolfssl-examples/blob/master/SGX_Linux/trusted/Wolfssl_Enclave.c and have it call ocall_close passing along the item to be closed.
Step 2: Prototype ocall_close so the enclave can call out to the untrusted execution space. Prototype this ocall in https://github.com/wolfSSL/wolfssl-examples/blob/master/SGX_Linux/trusted/Wolfssl_Enclave.edl in the untrusted { }
section.
Step 3: Write the ocall_close in the untrusted application https://github.com/wolfSSL/wolfssl-examples/blob/master/SGX_Linux/untrusted/App.c. Have it call the system function "close" on the socket descriptor.
- K
from wolfssl-examples.
Related Issues (20)
- Failed to connect to server when query data from etherscan with client example in SGX_Linux. HOT 1
- Windows SGX example build fails with LNK2019 HOT 4
- Thread leack detected in one of the examples HOT 1
- BTLE example error HOT 28
- ERROR: Failed to connect to wolfSSL HOT 1
- Camellia example HOT 2
- wc_ChaCha_Setkey return -173 despite following example HOT 1
- README.md typo HOT 3
- does wolfssl support tls connection establishment with client-secret-based and server-cert-based authentication? Thx HOT 5
- failed to build tls-sock-client HOT 3
- -lsgx_tstdcxx is deprecated
- wc_AesSetKey len parameter in aes-file-encrypt example HOT 4
- Build error after make command HOT 4
- Error: failed to load certificates HOT 5
- Generation of sphincs certificates HOT 2
- Espressif idf refuses to clean shared VisualGDB build directory
- Some TLS certificates expired HOT 2
- Update Espressif examples to use new "no setup" CMakeFiles.txt
- Unable to verify a certificate chain using certverify.c in certmangaer directory HOT 4
- Problem receiving messages on the dtls threaded server HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wolfssl-examples.