I need to call some sgx methods in my C# code. I have found simple example with C# SGX integration on this page: https://software.intel.com/content/www/us/en/develop/articles/csharp-application-with-intel-software.... I try to rewrite it on my personal project, and everything builds fine, but when I run I have such error:
Exception thrown at 0x00007FFC598B9229 (ntdll.dll) in HttpClient.exe: 0xC0000374: Heap Memory corruption (parameters: 0x00007FFC599227F0).
What can be the issue of that? Moreover when I continue debugging, it returns valid data from enclave(I have included sceen), which makes it really difficult to me to diagnoze. It even run properly without exception approximately one time in six times.
Exception is thrown in "retValve = native->enclaveString(pString);" line in LinkManaged.cpp class:
String^ SigningEnclaveLinkManaged::enclaveString(String^ s)
{
string retValve;
char* pString = (char*)Marshal::StringToHGlobalAnsi(s).ToPointer();
string nativeString(pString); // make your std::string
retValve = native->enclaveString(pString);
String^ clistr = gcnew String(retValve.c_str()); // make your System::String^
return clistr;
}
Link Copied
Hello Vaurine,
Unfortunately, that C# sample is outdated and no longer supported. It has not been updated for modern SGX SDKs or .NET frameworks.
Microsoft’s OpenEnclave documentation may have advice on interacting with .NET languages.
Hello Vaurine,
Unfortunately, that C# sample is outdated and no longer supported. It has not been updated for modern SGX SDKs or .NET frameworks.
Microsoft’s OpenEnclave documentation may have advice on interacting with .NET languages.
Intel is no longer monitoring this thread. If you want a response from Intel in a follow-up question, please open a new thread.
For more complete information about compiler optimizations, see our Optimization Notice.