Skip to content

Commit 673d697

Browse files
remove zlib and libssp dependency
1 parent 5655e83 commit 673d697

18 files changed

+116
-75
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,10 @@ regress/t6.out1
248248
regress/t8.out.pub
249249
regress/t9.out.pub
250250
regress/t6.out1
251-
regress/t10.out.pub
251+
regress/t10.out.pub
252+
regress/t10.out.pub
253+
regress/t6.out1
254+
Makefile
255+
openbsd-compat/Makefile
256+
openbsd-compat/regress/Makefile
257+
contrib/win32/win32compat/Makefile

compress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
#include "buffer.h"
2323
#include "compress.h"
2424

25+
#ifndef WIN32_ZLIB_NO
2526
#include <zlib.h>
27+
#endif
2628

2729
z_stream incoming_stream;
2830
z_stream outgoing_stream;

config.h.tail

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,7 @@
9898
#define HAVE_DECL_NFDBITS 0
9999
#define HAVE_DECL_HOWMANY 0
100100

101+
#define WIN32_ZLIB_NO 1
102+
101103
//#define HAVE_ARC4RANDOM_UNIFORM 1
102104

configure.ac

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -160,42 +160,42 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
160160
# -fstack-protector-all doesn't always work for some GCC versions
161161
# and/or platforms, so we test if we can. If it's not supported
162162
# on a given platform gcc will emit a warning so we use -Werror.
163-
if test "x$use_stack_protector" = "x1"; then
164-
for t in -fstack-protector-all -fstack-protector; do
165-
AC_MSG_CHECKING([if $CC supports $t])
166-
saved_CFLAGS="$CFLAGS"
167-
saved_LDFLAGS="$LDFLAGS"
168-
CFLAGS="$CFLAGS $t -Werror"
169-
LDFLAGS="$LDFLAGS $t -Werror"
170-
AC_LINK_IFELSE(
171-
[AC_LANG_PROGRAM([[ #include <stdio.h> ]],
172-
[[
173-
char x[256];
174-
snprintf(x, sizeof(x), "XXX");
175-
]])],
176-
[ AC_MSG_RESULT([yes])
177-
CFLAGS="$saved_CFLAGS $t"
178-
LDFLAGS="$saved_LDFLAGS $t"
179-
AC_MSG_CHECKING([if $t works])
180-
AC_RUN_IFELSE(
181-
[AC_LANG_PROGRAM([[ #include <stdio.h> ]],
182-
[[
183-
char x[256];
184-
snprintf(x, sizeof(x), "XXX");
185-
]])],
186-
[ AC_MSG_RESULT([yes])
187-
break ],
188-
[ AC_MSG_RESULT([no]) ],
189-
[ AC_MSG_WARN([cross compiling: cannot test])
190-
break ]
191-
)
192-
],
193-
[ AC_MSG_RESULT([no]) ]
194-
)
195-
CFLAGS="$saved_CFLAGS"
196-
LDFLAGS="$saved_LDFLAGS"
197-
done
198-
fi
163+
# if test "x$use_stack_protector" = "x1"; then
164+
# for t in -fstack-protector-all -fstack-protector; do
165+
# AC_MSG_CHECKING([if $CC supports $t])
166+
# saved_CFLAGS="$CFLAGS"
167+
# saved_LDFLAGS="$LDFLAGS"
168+
# CFLAGS="$CFLAGS $t -Werror"
169+
# LDFLAGS="$LDFLAGS $t -Werror"
170+
# AC_LINK_IFELSE(
171+
# [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
172+
# [[
173+
# char x[256];
174+
# snprintf(x, sizeof(x), "XXX");
175+
# ]])],
176+
# [ AC_MSG_RESULT([yes])
177+
# CFLAGS="$saved_CFLAGS $t"
178+
# LDFLAGS="$saved_LDFLAGS $t"
179+
# AC_MSG_CHECKING([if $t works])
180+
# AC_RUN_IFELSE(
181+
# [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
182+
# [[
183+
# char x[256];
184+
# snprintf(x, sizeof(x), "XXX");
185+
# ]])],
186+
# [ AC_MSG_RESULT([yes])
187+
# break ],
188+
# [ AC_MSG_RESULT([no]) ],
189+
# [ AC_MSG_WARN([cross compiling: cannot test])
190+
# break ]
191+
# )
192+
# ],
193+
# [ AC_MSG_RESULT([no]) ]
194+
# )
195+
# CFLAGS="$saved_CFLAGS"
196+
# LDFLAGS="$saved_LDFLAGS"
197+
# done
198+
# fi
199199

200200
if test -z "$have_llong_max"; then
201201
# retry LLONG_MAX with -std=gnu99, needed on some Linuxes

monitor.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@
8888
#include "zlib.h"
8989
#define TARGET_OS_MAC 1
9090
#else
91+
#ifndef WIN32_ZLIB_NO
9192
#include "zlib.h"
9293
#endif
94+
#endif
9395
#include "packet.h"
9496
#include "auth-options.h"
9597
#include "sshpty.h"
@@ -1886,11 +1888,13 @@ monitor_apply_keystate(struct monitor *pmonitor)
18861888
}
18871889

18881890
/* Update with new address */
1891+
#ifndef WIN32_ZLIB_NO
18891892
if (options.compression) {
18901893
ssh_packet_set_compress_hooks(ssh, pmonitor->m_zlib,
18911894
(ssh_packet_comp_alloc_func *)mm_zalloc,
18921895
(ssh_packet_comp_free_func *)mm_zfree);
18931896
}
1897+
#endif
18941898
}
18951899

18961900
/* This function requries careful sanity checking */

monitor_wrap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@
7474
#include "zlib.h"
7575
#define TARGET_OS_MAC 1
7676
#else
77+
#ifndef WIN32_ZLIB_NO
7778
#include "zlib.h"
7879
#endif
80+
#endif
7981
#include "monitor.h"
8082
#ifdef GSSAPI
8183
#include "ssh-gss.h"
@@ -95,8 +97,10 @@
9597

9698
/* Imports */
9799
extern int compat20;
100+
#ifndef WIN32_ZLIB_NO
98101
extern z_stream incoming_stream;
99102
extern z_stream outgoing_stream;
103+
#endif
100104
extern struct monitor *pmonitor;
101105
extern Buffer loginmsg;
102106
extern ServerOptions options;

0 commit comments

Comments
 (0)