|
@@ -0,0 +1,62 @@
|
|
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 <stdlib.h>
|
|
12
|
+#include <time.h>
|
|
13
|
+#include <sys/time.h>
|
|
14
|
+#include <byteswap.h>
|
|
15
|
+
|
|
16
|
+#define STDCALL
|
|
17
|
+#define EXP_FUNC
|
|
18
|
+#define TTY_FLUSH()
|
|
19
|
+
|
|
20
|
+/** We can't actually abort, since we are effectively a kernel... */
|
|
21
|
+#define abort() assert ( 0 )
|
|
22
|
+
|
|
23
|
+/** crypto_misc.c has a bad #ifdef */
|
|
24
|
+static inline void close ( int fd __unused ) {
|
|
25
|
+ /* Do nothing */
|
|
26
|
+}
|
|
27
|
+
|
|
28
|
+typedef void FILE;
|
|
29
|
+#define SEEK_SET 0
|
|
30
|
+#define SEEK_CUR 0
|
|
31
|
+#define SEEK_END 0
|
|
32
|
+
|
|
33
|
+static inline FILE * fopen ( const char *filename __unused,
|
|
34
|
+ const char *mode __unused ) {
|
|
35
|
+ return NULL;
|
|
36
|
+}
|
|
37
|
+
|
|
38
|
+static inline int fseek ( FILE *stream __unused, long offset __unused,
|
|
39
|
+ int whence __unused ) {
|
|
40
|
+ return -1;
|
|
41
|
+}
|
|
42
|
+
|
|
43
|
+static inline long ftell ( FILE *stream __unused ) {
|
|
44
|
+ return -1;
|
|
45
|
+}
|
|
46
|
+
|
|
47
|
+static inline size_t fread ( void *ptr __unused, size_t size __unused,
|
|
48
|
+ size_t nmemb __unused, FILE *stream __unused ) {
|
|
49
|
+ return -1;
|
|
50
|
+}
|
|
51
|
+
|
|
52
|
+static inline int fclose ( FILE *stream __unused ) {
|
|
53
|
+ return -1;
|
|
54
|
+}
|
|
55
|
+
|
|
56
|
+#define CONFIG_SSL_CERT_VERIFICATION 1
|
|
57
|
+#define CONFIG_SSL_MAX_CERTS 1
|
|
58
|
+#define CONFIG_X509_MAX_CA_CERTS 1
|
|
59
|
+#define CONFIG_SSL_EXPIRY_TIME 24
|
|
60
|
+#define CONFIG_SSL_ENABLE_CLIENT 1
|
|
61
|
+
|
|
62
|
+#endif
|