2017-01-19 46 views
0

我對SGX很新,想從簡單的事情開始。幸運的是,我發現this very basic tutorial。不幸的是,儘管它很簡單,但我無法實現。代碼執行,但輸出中有錯誤。麻煩創建和執行英特爾新加坡地區

[sgx_create_enclavew ..\urts\win\urts.cpp:195] Couldn't open file with CreateFile() 

error 0x200f, failed to create enclave. 

Buffertests: 
Buffer before change: Hello World! 
Buffer after change: Hello World! 

Stringtests: 
Returned Secret: 
Saved Secret: My secret string 
Load Secret: 

Integertests: 
secretIntValue first load: 0 
saved a 1337 to the enclave. 
secretIntValue second load after 1337 was saved: 0 

error, failed to destroy enclave. 

image of output

的教程說:

如果你得到錯誤SGX找不到飛地文件。解決方案是將enclave_test_save.signed.dll移動到app_test_save.exe所在的同一文件夾中。

我試過,但沒有解決問題。

當我嘗試建立飛地使用:

sgx_create_enclave(ENCLAVE_FILE, SGX_DEBUG_FLAG, &token, &updated, &eid, NULL); 

返回:SGX_ERROR_ENCLAVE_FILE_ACCESS

可問題是使用不同版本的Visual Studio的結果? (本教程使用VS 2012,而我正在使用VS 2015)

回答

0

聲明:雖然在不同的設置(Ubuntu,eclipse)下,我有同樣的錯誤,所以我不確定這會有多大的幫助。

initialize_enclave()之前被調用(這反過來要求sgx_create_enclave()),一個chdir(absolutePath)命令需要執行,其中absolutePath需要是在您的可執行文件的絕對路徑。

我的錯誤是由於我使用了錯誤的路徑。

0

謝謝,我解決了它。事實證明,我必須將.lal文件放在根文件夾中,而不是使用.exe文件放置enclave_test_save.signed.dll。

0

您是通過命令提示符還是從IDE運行應用程序? 如果您使用的是IDE,則需要在項目屬性 - >配置屬性 - >調試 - >工作目錄下從$(ProjecttDir)中將調試屬性更改爲$(OutDir)(Enclave和Application)選擇Intel R)SGX調試器