[openssl-commits] [openssl] master update
Richard Levitte
levitte at openssl.org
Thu May 12 20:11:10 UTC 2016
The branch master has been updated
via 2c25ebd1e29a837b1c0e5fea5f464d4b6ddbab5a (commit)
via ae69c7d35351f9b1dcf42a21455e62d0ed5379e9 (commit)
from 396ba1ca6846a3a19d39275d771082c8674c6a50 (commit)
- Log -----------------------------------------------------------------
commit 2c25ebd1e29a837b1c0e5fea5f464d4b6ddbab5a
Author: Richard Levitte <levitte at openssl.org>
Date: Tue May 10 14:41:19 2016 +0200
DJGPP adjustments
* Configure: Replaced -DTERMIO by -DTERMIOS in CFLAGS.
* crypto/bio/bss_dgram.c [WATT32]: Remove obsolete redefinition of
function names: sock_write, sock_read and sock_puts.
* crypto/bio/bss_sock.c [WATT32]: For Watt-32 2.2.11 sock_write,
sock_read and sock_puts are redefined to their private names so
their names must be undefined first before they can be redefined
again.
* crypto/bio/bss_file.c (file_fopen) [__DJGPP__]: Make a copy of the
passed file name and replace the leading dots in the dirname part
and the basname part of the file name, unless LFN is supported.
* e_os.h [__DJGPP__]: Undefine macro DEVRANDOM_EGD. Neither MS-DOS nor
FreeDOS provide 'egd' sockets.
New macro HAS_LFN_SUPPORT checks if underlying file system supports
long file names or not.
Include sys/un.h.
Define WATT32_NO_OLDIES.
* INSTALL.DJGPP: Update URL of WATT-32 library.
Submitted by Juan Manuel Guerrero <juan.guerrero at gmx.de>
RT#4217
Reviewed-by: Andy Polyakov <appro at openssl.org>
commit ae69c7d35351f9b1dcf42a21455e62d0ed5379e9
Author: Richard Levitte <levitte at openssl.org>
Date: Wed May 11 13:47:19 2016 +0200
Move the DJGPP target to its own config.
DJGPP is a 3rd party configuration, we rely entirely on the OpenSSL to
help us fine tune and test. Therefore, it's moved to its own config.
Reviewed-by: Andy Polyakov <appro at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
Configurations/10-main.conf | 11 -----------
Configurations/50-djgpp.conf | 15 +++++++++++++++
INSTALL.DJGPP | 2 +-
crypto/bio/bss_dgram.c | 6 ------
crypto/bio/bss_file.c | 30 ++++++++++++++++++++++++++++++
crypto/bio/bss_sock.c | 6 +++++-
e_os.h | 4 ++++
7 files changed, 55 insertions(+), 19 deletions(-)
create mode 100644 Configurations/50-djgpp.conf
diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index f4246de..c708f5e 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -1514,17 +1514,6 @@ sub vms_info {
inherit_from => [ "Cygwin-x86" ]
},
-#### DJGPP
- "DJGPP" => {
- inherit_from => [ asm("x86_asm") ],
- cc => "gcc",
- cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
- sys_id => "MSDOS",
- ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
- bn_ops => "BN_LLONG",
- perlasm_scheme => "a.out",
- },
-
##### MacOS X (a.k.a. Darwin) setup
"darwin-common" => {
inherit_from => [ "BASE_unix" ],
diff --git a/Configurations/50-djgpp.conf b/Configurations/50-djgpp.conf
new file mode 100644
index 0000000..f532bd1
--- /dev/null
+++ b/Configurations/50-djgpp.conf
@@ -0,0 +1,15 @@
+# We can't make any commitment to support the DJGPP platform,
+# and rely entirely on the OpenSSL community to help is fine
+# tune and test.
+
+%targets = (
+ "DJGPP" => {
+ inherit_from => [ asm("x86_asm") ],
+ cc => "gcc",
+ cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
+ sys_id => "MSDOS",
+ ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
+ bn_ops => "BN_LLONG",
+ perlasm_scheme => "a.out",
+ },
+);
diff --git a/INSTALL.DJGPP b/INSTALL.DJGPP
index e1ec676..4fd94e4 100644
--- a/INSTALL.DJGPP
+++ b/INSTALL.DJGPP
@@ -19,7 +19,7 @@
files to download, see the DJGPP "ZIP PICKER" page at
"http://www.delorie.com/djgpp/zip-picker.html". You also need to have
the WATT-32 networking package installed before you try to compile
- OpenSSL. This can be obtained from "http://www.bgnett.no/~giva/".
+ OpenSSL. This can be obtained from "http://www.watt-32.net/".
The Makefile assumes that the WATT-32 code is in the directory
specified by the environment variable WATT_ROOT. If you have watt-32
in directory "watt32" under your main DJGPP directory, specify
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index cf2f9f6..e6d74e4 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -94,12 +94,6 @@
((a)->s6_addr32[2] == htonl(0x0000ffff)))
# endif
-# ifdef WATT32
-# define sock_write SockWrite /* Watt-32 uses same names */
-# define sock_read SockRead
-# define sock_puts SockPuts
-# endif
-
static int dgram_write(BIO *h, const char *buf, int num);
static int dgram_read(BIO *h, char *buf, int size);
static int dgram_puts(BIO *h, const char *str);
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index a37e89d..3c05660 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -154,6 +154,36 @@ static FILE *file_fopen(const char *filename, const char *mode)
} else if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) {
file = fopen(filename, mode);
}
+# elif defined(__DJGPP__)
+ {
+ char *newname = NULL;
+
+ if (!HAS_LFN_SUPPORT(filename)) {
+ char *iterator;
+ char lastchar;
+
+ newname = OPENSSL_malloc(strlen(filename) + 1);
+ if (newname == NULL)
+ return NULL;
+
+ for(iterator = newname, lastchar = '\0';
+ *filename; filename++, iterator++) {
+ if (lastchar == '/' && filename[0] == '.'
+ && filename[1] != '.' && filename[1] != '/') {
+ /* Leading dots are not permitted in plain DOS. */
+ *iterator = '_';
+ } else {
+ *iterator = *filename;
+ }
+ lastchar = *filename;
+ }
+ *iterator = '\0';
+ filename = newname;
+ }
+ file = fopen(filename, mode);
+
+ OPENSSL_free(newname);
+ }
# else
file = fopen(filename, mode);
# endif
diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
index c1f76a2..c4e263d 100644
--- a/crypto/bio/bss_sock.c
+++ b/crypto/bio/bss_sock.c
@@ -66,7 +66,11 @@
# include <openssl/bio.h>
# ifdef WATT32
-# define sock_write SockWrite /* Watt-32 uses same names */
+/* Watt-32 uses same names */
+# undef sock_write
+# undef sock_read
+# undef sock_puts
+# define sock_write SockWrite
# define sock_read SockRead
# define sock_puts SockPuts
# endif
diff --git a/e_os.h b/e_os.h
index eaa9396..0166d79 100644
--- a/e_os.h
+++ b/e_os.h
@@ -151,6 +151,7 @@ extern "C" {
# define writesocket(s,b,n) send((s),(b),(n),0)
# elif defined(__DJGPP__)
# define WATT32
+# define WATT32_NO_OLDIES
# define get_last_socket_error() errno
# define clear_socket_error() errno=0
# define closesocket(s) close_s(s)
@@ -185,11 +186,14 @@ extern "C" {
# include <unistd.h>
# include <sys/stat.h>
# include <sys/socket.h>
+# include <sys/un.h>
# include <tcp.h>
# include <netdb.h>
# define _setmode setmode
# define _O_TEXT O_TEXT
# define _O_BINARY O_BINARY
+# define HAS_LFN_SUPPORT(name) (pathconf((name), _PC_NAME_MAX) > 12)
+# undef DEVRANDOM_EGD /* Neither MS-DOS nor FreeDOS provide 'egd' sockets. */
# undef DEVRANDOM
# define DEVRANDOM "/dev/urandom\x24"
# endif /* __DJGPP__ */
More information about the openssl-commits
mailing list