You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

os_port.h 1.2KB

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