From 856d0511d63bd791b4a18df0c3ffc80b8e47c470 Mon Sep 17 00:00:00 2001 From: kinichiro Date: Sun, 28 Jul 2019 19:03:27 +0900 Subject: Use posix_win.c functions on WIN32 - read() returns bytes count as 1 for crlf unless binary mode isn't specified with open(). Reported by @ulfworsoe in libressl-portable#542 - err could be WSANOTINITIALISED when WSAStartup() is not called --- patches/keypairtest.c.patch | 13 ------------- patches/tls_config.c.patch | 25 ------------------------- patches/tls_util.c.patch | 25 ------------------------- 3 files changed, 63 deletions(-) delete mode 100644 patches/keypairtest.c.patch delete mode 100644 patches/tls_config.c.patch delete mode 100644 patches/tls_util.c.patch (limited to 'patches') diff --git a/patches/keypairtest.c.patch b/patches/keypairtest.c.patch deleted file mode 100644 index b1f03da..0000000 --- a/patches/keypairtest.c.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- tests/keypairtest.c.orig Sun Mar 18 00:31:20 2018 -+++ tests/keypairtest.c Sun Mar 18 00:31:33 2018 -@@ -15,6 +15,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#ifdef _MSC_VER -+#define NO_REDEF_POSIX_FUNCTIONS -+#endif -+ - #include - - #include diff --git a/patches/tls_config.c.patch b/patches/tls_config.c.patch deleted file mode 100644 index cd9817c..0000000 --- a/patches/tls_config.c.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- tls/tls_config.c.orig Fri Jul 26 22:16:53 2019 -+++ tls/tls_config.c Fri Jul 26 22:21:25 2019 -@@ -15,6 +15,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#ifdef _MSC_VER -+#define NO_REDEF_POSIX_FUNCTIONS -+#endif -+ - #include - - #include -@@ -48,7 +52,11 @@ tls_config_load_file(struct tls_error *error, const ch - *buf = NULL; - *len = 0; - -+#ifndef _WIN32 - if ((fd = open(filename, O_RDONLY)) == -1) { -+#else -+ if ((fd = open(filename, O_RDONLY | O_BINARY)) == -1) { -+#endif - tls_error_set(error, "failed to open %s file '%s'", - filetype, filename); - goto err; diff --git a/patches/tls_util.c.patch b/patches/tls_util.c.patch deleted file mode 100644 index 9f57d83..0000000 --- a/patches/tls_util.c.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- tls/tls_util.c.orig Fri Jul 26 22:17:04 2019 -+++ tls/tls_util.c Fri Jul 26 22:21:22 2019 -@@ -17,6 +17,10 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#ifdef _MSC_VER -+#define NO_REDEF_POSIX_FUNCTIONS -+#endif -+ - #include - - #include -@@ -161,7 +165,11 @@ tls_load_file(const char *name, size_t *len, char *pas - - *len = 0; - -+#ifndef _WIN32 - if ((fd = open(name, O_RDONLY)) == -1) -+#else -+ if ((fd = open(name, O_RDONLY | O_BINARY)) == -1) -+#endif - return (NULL); - - /* Just load the file into memory without decryption */ -- cgit v1.2.3-55-g6feb