2016-08-30 12:40:58 +00:00
|
|
|
#if !defined(MBEDTLS_CONFIG_FILE)
|
|
|
|
#include "mbedtls/config.h"
|
|
|
|
#else
|
|
|
|
#include MBEDTLS_CONFIG_FILE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2016-09-02 03:31:38 +00:00
|
|
|
|
2016-08-30 12:40:58 +00:00
|
|
|
#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
|
|
|
|
|
2016-09-08 09:41:43 +00:00
|
|
|
extern int os_get_random(unsigned char *buf, size_t len);
|
2016-08-30 12:40:58 +00:00
|
|
|
int mbedtls_hardware_poll( void *data,
|
|
|
|
unsigned char *output, size_t len, size_t *olen )
|
|
|
|
{
|
2016-09-02 03:31:38 +00:00
|
|
|
os_get_random(output, len);
|
|
|
|
*olen = len;
|
|
|
|
|
|
|
|
return 0;
|
2016-08-30 12:40:58 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|