Implement SGX getrandom/getentropy without ocall (#1176)
Implement SGX getrandom with sgx_read_rand and getentropy with `rdseed` instruction instead of ocall to improve the security.
This commit is contained in:
@ -10,7 +10,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/random.h>
|
||||
#include <sys/uio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
@ -303,18 +302,6 @@ ocall_getopt(int argc, char *argv_buf, unsigned int argv_buf_len,
|
||||
return getopt(argc, argv, optstring);
|
||||
}
|
||||
|
||||
ssize_t
|
||||
ocall_getrandom(void *buf, size_t buflen, unsigned int flags)
|
||||
{
|
||||
return getrandom(buf, buflen, flags);
|
||||
}
|
||||
|
||||
int
|
||||
ocall_getentropy(void *buffer, size_t length)
|
||||
{
|
||||
return getentropy(buffer, length);
|
||||
}
|
||||
|
||||
int
|
||||
ocall_sched_yield()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user