summaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorMichael Brown2007-01-26 02:55:34 +0100
committerMichael Brown2007-01-26 02:55:34 +0100
commit7b8859ad15f9b0420a9a4c8df16d6576bb21cb23 (patch)
tree7b953af996a126b839f49040055922b6593e3f59 /src/crypto
parent#if 0 out for now (diff)
downloadipxe-7b8859ad15f9b0420a9a4c8df16d6576bb21cb23.tar.gz
ipxe-7b8859ad15f9b0420a9a4c8df16d6576bb21cb23.tar.xz
ipxe-7b8859ad15f9b0420a9a4c8df16d6576bb21cb23.zip
Enable the axtls code to at least build within gPXE
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/axtls/os_port.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/crypto/axtls/os_port.h b/src/crypto/axtls/os_port.h
new file mode 100644
index 00000000..3d098632
--- /dev/null
+++ b/src/crypto/axtls/os_port.h
@@ -0,0 +1,62 @@
+/**
+ * @file os_port.h
+ *
+ * Trick the axtls code into building within our build environment.
+ */
+
+#ifndef HEADER_OS_PORT_H
+#define HEADER_OS_PORT_H
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/time.h>
+#include <byteswap.h>
+
+#define STDCALL
+#define EXP_FUNC
+#define TTY_FLUSH()
+
+/** We can't actually abort, since we are effectively a kernel... */
+#define abort() assert ( 0 )
+
+/** crypto_misc.c has a bad #ifdef */
+static inline void close ( int fd __unused ) {
+ /* Do nothing */
+}
+
+typedef void FILE;
+#define SEEK_SET 0
+#define SEEK_CUR 0
+#define SEEK_END 0
+
+static inline FILE * fopen ( const char *filename __unused,
+ const char *mode __unused ) {
+ return NULL;
+}
+
+static inline int fseek ( FILE *stream __unused, long offset __unused,
+ int whence __unused ) {
+ return -1;
+}
+
+static inline long ftell ( FILE *stream __unused ) {
+ return -1;
+}
+
+static inline size_t fread ( void *ptr __unused, size_t size __unused,
+ size_t nmemb __unused, FILE *stream __unused ) {
+ return -1;
+}
+
+static inline int fclose ( FILE *stream __unused ) {
+ return -1;
+}
+
+#define CONFIG_SSL_CERT_VERIFICATION 1
+#define CONFIG_SSL_MAX_CERTS 1
+#define CONFIG_X509_MAX_CA_CERTS 1
+#define CONFIG_SSL_EXPIRY_TIME 24
+#define CONFIG_SSL_ENABLE_CLIENT 1
+
+#endif