1 /** 2 * @file os_port.h 3 * 4 * Trick the axtls code into building within our build environment. 5 */ 6 7 #ifndef HEADER_OS_PORT_H 8 #define HEADER_OS_PORT_H 9 10 #include <stdint.h> 11 #include <stddef.h> 12 #include <stdlib.h> 13 #include <time.h> 14 #include <sys/time.h> 15 #include <byteswap.h> 16 17 #define STDCALL 18 #define EXP_FUNC 19 #define TTY_FLUSH() 20 21 /** We can't actually abort, since we are effectively a kernel... */ 22 #define abort() assert ( 0 ) 23 24 /** crypto_misc.c has a bad #ifdef */ 25 static inline void close ( int fd __unused ) { 26 /* Do nothing */ 27 } 28 29 typedef void FILE; 30 31 static inline FILE * fopen ( const char *filename __unused, 32 const char *mode __unused ) { 33 return NULL; 34 } 35 36 static inline int fseek ( FILE *stream __unused, long offset __unused, 37 int whence __unused ) { 38 return -1; 39 } 40 41 static inline long ftell ( FILE *stream __unused ) { 42 return -1; 43 } 44 45 static inline size_t fread ( void *ptr __unused, size_t size __unused, 46 size_t nmemb __unused, FILE *stream __unused ) { 47 return -1; 48 } 49 50 static inline int fclose ( FILE *stream __unused ) { 51 return -1; 52 } 53 54 #define CONFIG_SSL_CERT_VERIFICATION 1 55 #define CONFIG_SSL_MAX_CERTS 1 56 #define CONFIG_X509_MAX_CA_CERTS 1 57 #define CONFIG_SSL_EXPIRY_TIME 24 58 #define CONFIG_SSL_ENABLE_CLIENT 1 59 #define CONFIG_BIGINT_CLASSICAL 1 60 61 #endif 62