]>
Commit | Line | Data |
---|---|---|
6e8c346a AG |
1 | diff -burN eggdrop1.6.17.orig/aclocal.m4 eggdrop1.6.17/aclocal.m4 |
2 | --- eggdrop1.6.17.orig/aclocal.m4 2004-11-01 14:40:44.093457768 +0100 | |
3 | +++ eggdrop1.6.17/aclocal.m4 2004-11-01 14:41:51.767169800 +0100 | |
4 | @@ -37,6 +37,64 @@ | |
5 | ]) | |
e3a05f4b | 6 | |
e3a05f4b AG |
7 | |
8 | +dnl EGG_SSL_CRAP() | |
9 | +dnl | |
10 | +AC_DEFUN(EGG_SSL_CRAP, [dnl | |
11 | +#ssl checks - hoe | |
12 | +AC_MSG_CHECKING(whether to include SSL support) | |
13 | +AC_ARG_WITH(ssl, | |
14 | +[ --with-ssl[=PATH] Include SSL support (DIR is OpenSSL's install dir).], | |
15 | +[ | |
16 | + case "$withval" in | |
17 | + no) | |
18 | + AC_MSG_RESULT(no) ;; | |
19 | + yes) | |
20 | + AC_MSG_RESULT(yes) | |
21 | + AC_CHECK_LIB(ssl,SSL_accept,[AC_DEFINE(EGG_SSL_EXT) | |
22 | + SSL_LIBS="-lssl -lcrypto"],[AC_MSG_ERROR([You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL])],-lcrypto) | |
23 | + ;; | |
24 | + *) | |
25 | +dnl A whole whack of possible places where this might be | |
26 | + test -f $withval/openssl/ssl.h && SSL_INCLUDE="$withval" | |
27 | + test -f $withval/include/openssl/ssl.h && SSL_INCLUDE="$withval/include" | |
28 | + | |
29 | + test -f $withval/lib/libssl.a && SSL_LIB="$withval/lib" | |
30 | + test -f $withval/lib/ssl/libssl.a && SSL_LIB="$withval/lib/ssl" | |
31 | + test -f $withval/lib/openssl/libssl.a && SSL_LIB="$withval/lib/openssl/ssl" | |
32 | + test -f $withval/libssl.a && SSL_LIB="$withval" | |
33 | + test -f $withval/ssl/libssl.a && SSL_LIB="$withval/ssl" | |
34 | + test -f $withval/openssl/libssl.a && SSL_LIB="$withval/openssl" | |
35 | + | |
36 | + test -f $withval/lib/libcrypto.a && CRYPTO_LIB="$withval/lib" | |
37 | + test -f $withval/lib/ssl/libcrypto.a && CRYPTO_LIB="$withval/lib/ssl" | |
38 | + test -f $withval/lib/openssl/libcrypto.a && CRYPTO_LIB="$withval/lib/openssl/ssl" | |
39 | + test -f $withval/libcrypto.a && CRYPTO_LIB="$withval" | |
40 | + test -f $withval/ssl/libcrypto.a && CRYPTO_LIB="$withval/ssl" | |
41 | + test -f $withval/openssl/libcrypto.a && CRYPTO_LIB="$withval/openssl" | |
42 | + | |
43 | + if test -n "$SSL_INCLUDE" && test -n "$SSL_LIB" && test -n "$CRYPTO_LIB"; then | |
44 | + SSL_LIBS="-lssl -lcrypto -L$SSL_LIB -L$CRYPTO_LIB"; | |
6e8c346a | 45 | + AC_DEFINE([EGG_SSL_EXT], [], [SSL support]) |
e3a05f4b AG |
46 | + AC_MSG_RESULT(yes) |
47 | + else | |
48 | + AC_MSG_RESULT(no) | |
49 | + AC_MSG_ERROR([You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL]) | |
50 | + fi ;; | |
51 | + esac | |
52 | +],[ | |
53 | + AC_MSG_RESULT(will try to find) | |
54 | + AC_CHECK_LIB(ssl,SSL_accept,[AC_DEFINE(EGG_SSL_EXT) | |
55 | + SSL_LIBS="-lssl -lcrypto"],[AC_MSG_ERROR([OpenSSL was not found. Please supply a pathname to OpenSSL])],-lcrypto) | |
6e8c346a | 56 | + AC_CHECK_HEADERS("openssl/ssl.h",,[AC_MSG_ERROR([OpenSSL was not found. Please supply a pathname to OpenSSL])],) |
e3a05f4b | 57 | + |
6e8c346a AG |
58 | + AC_SUBST(SSL_LIBS)dnl |
59 | + AC_SUBST(SSL_INCLUDE)dnl | |
60 | +]) | |
e3a05f4b | 61 | + |
6e8c346a AG |
62 | +#end of ssl checks - hoe (.16 by poci) |
63 | +])dnl | |
e3a05f4b | 64 | + |
e3a05f4b | 65 | + |
6e8c346a AG |
66 | dnl EGG_MSG_CONFIGURE_END() |
67 | dnl | |
68 | AC_DEFUN([EGG_MSG_CONFIGURE_END], | |
69 | diff -burN eggdrop1.6.17.orig/config.h.in eggdrop1.6.17/config.h.in | |
70 | --- eggdrop1.6.17.orig/config.h.in 2004-11-01 14:40:44.110455184 +0100 | |
71 | +++ eggdrop1.6.17/config.h.in 2004-11-01 14:41:51.769169496 +0100 | |
72 | @@ -30,6 +30,9 @@ | |
73 | /* Define to 1 if you have the `clock' function. */ | |
74 | #undef HAVE_CLOCK | |
e3a05f4b | 75 | |
6e8c346a AG |
76 | +/* Defines ssl mode */ |
77 | +#undef EGG_SSL_EXT | |
e3a05f4b | 78 | + |
6e8c346a AG |
79 | /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. |
80 | */ | |
81 | #undef HAVE_DIRENT_H | |
82 | diff -burN eggdrop1.6.17.orig/configure eggdrop1.6.17/configure | |
83 | --- eggdrop1.6.17.orig/configure 2004-11-01 14:40:44.098457008 +0100 | |
84 | +++ eggdrop1.6.17/configure 2004-11-01 14:43:30.021232912 +0100 | |
85 | @@ -315,7 +315,7 @@ | |
86 | # include <unistd.h> | |
87 | #endif" | |
e3a05f4b | 88 | |
6e8c346a AG |
89 | -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS egg_ac_parameters CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB LN_S HEAD_1 STRIP AWK BASENAME UNAME DEFAULT_MAKE MOD_EXT MODULE_XLIBS MOD_LD MOD_CC MOD_STRIP SHLIB_LD SHLIB_CC SHLIB_STRIP EGGEXEC TCLLIB TCLLIBFN TCLINC TCLINCFN TCL_REQS TCL_LIBS EGGVERSION DESTDIR MOD_UPDIR LIBOBJS LTLIBOBJS' |
90 | +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS egg_ac_parameters CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB LN_S HEAD_1 STRIP AWK BASENAME UNAME DEFAULT_MAKE MOD_EXT MODULE_XLIBS MOD_LD MOD_CC MOD_STRIP SHLIB_LD SHLIB_CC SHLIB_STRIP EGGEXEC TCLLIB TCLLIBFN TCLINC TCLINCFN TCL_REQS TCL_LIBS SSL_LIBS SSL_INCLUDE EGGVERSION DESTDIR MOD_UPDIR LIBOBJS LTLIBOBJS' | |
91 | ac_subst_files='' | |
e3a05f4b | 92 | |
6e8c346a AG |
93 | # Initialize some variables set by options. |
94 | @@ -856,6 +856,7 @@ | |
95 | --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) | |
96 | --with-tcllib=PATH full path to Tcl library | |
97 | --with-tclinc=PATH full path to Tcl header | |
98 | + --with-ssl=PATH Include SSL support (DIR is OpenSSL's install dir). | |
e3a05f4b | 99 | |
6e8c346a AG |
100 | Some influential environment variables: |
101 | CC C compiler command | |
102 | @@ -10100,6 +10101,374 @@ | |
e3a05f4b | 103 | |
e3a05f4b | 104 | |
e3a05f4b AG |
105 | |
106 | +#ssl checks - hoe | |
107 | +echo "$as_me:$LINENO: checking whether to include SSL support" >&5 | |
108 | +echo $ECHO_N "checking whether to include SSL support... $ECHO_C" >&6 | |
109 | + | |
110 | +# Check whether --with-ssl or --without-ssl was given. | |
111 | +if test "${with_ssl+set}" = set; then | |
112 | + withval="$with_ssl" | |
113 | + | |
114 | + case "$withval" in | |
115 | + no) | |
116 | + echo "$as_me:$LINENO: result: no" >&5 | |
117 | +echo "${ECHO_T}no" >&6 ;; | |
118 | + yes) | |
119 | + echo "$as_me:$LINENO: result: yes" >&5 | |
120 | +echo "${ECHO_T}yes" >&6 | |
121 | + echo "$as_me:$LINENO: checking for SSL_accept in -lssl" >&5 | |
122 | +echo $ECHO_N "checking for SSL_accept in -lssl... $ECHO_C" >&6 | |
123 | +if test "${ac_cv_lib_ssl_SSL_accept+set}" = set; then | |
124 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | |
125 | +else | |
126 | + ac_check_lib_save_LIBS=$LIBS | |
127 | +LIBS="-lssl -lcrypto $LIBS" | |
128 | +cat >conftest.$ac_ext <<_ACEOF | |
e3a05f4b AG |
129 | +/* confdefs.h. */ |
130 | +_ACEOF | |
131 | +cat confdefs.h >>conftest.$ac_ext | |
132 | +cat >>conftest.$ac_ext <<_ACEOF | |
133 | +/* end confdefs.h. */ | |
134 | + | |
135 | +/* Override any gcc2 internal prototype to avoid an error. */ | |
136 | +#ifdef __cplusplus | |
137 | +extern "C" | |
138 | +#endif | |
139 | +/* We use char because int might match the return type of a gcc2 | |
140 | + builtin and then its argument prototype would still apply. */ | |
141 | +char SSL_accept (); | |
142 | +int | |
143 | +main () | |
144 | +{ | |
145 | +SSL_accept (); | |
146 | + ; | |
147 | + return 0; | |
148 | +} | |
149 | +_ACEOF | |
150 | +rm -f conftest.$ac_objext conftest$ac_exeext | |
151 | +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 | |
6e8c346a | 152 | + (eval $ac_link) 2>conftest.er1 |
e3a05f4b | 153 | + ac_status=$? |
6e8c346a AG |
154 | + grep -v '^ *+' conftest.er1 >conftest.err |
155 | + rm -f conftest.er1 | |
156 | + cat conftest.err >&5 | |
e3a05f4b AG |
157 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
158 | + (exit $ac_status); } && | |
6e8c346a AG |
159 | + { ac_try='test -z "$ac_c_werror_flag" |
160 | + || test ! -s conftest.err' | |
161 | + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | |
162 | + (eval $ac_try) 2>&5 | |
163 | + ac_status=$? | |
164 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
165 | + (exit $ac_status); }; } && | |
166 | + { ac_try='test -s conftest$ac_exeext' | |
e3a05f4b AG |
167 | + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
168 | + (eval $ac_try) 2>&5 | |
169 | + ac_status=$? | |
170 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
171 | + (exit $ac_status); }; }; then | |
172 | + ac_cv_lib_ssl_SSL_accept=yes | |
173 | +else | |
174 | + echo "$as_me: failed program was:" >&5 | |
175 | +sed 's/^/| /' conftest.$ac_ext >&5 | |
176 | + | |
177 | +ac_cv_lib_ssl_SSL_accept=no | |
178 | +fi | |
6e8c346a AG |
179 | +rm -f conftest.err conftest.$ac_objext \ |
180 | + conftest$ac_exeext conftest.$ac_ext | |
e3a05f4b AG |
181 | +LIBS=$ac_check_lib_save_LIBS |
182 | +fi | |
183 | +echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_accept" >&5 | |
184 | +echo "${ECHO_T}$ac_cv_lib_ssl_SSL_accept" >&6 | |
185 | +if test $ac_cv_lib_ssl_SSL_accept = yes; then | |
186 | + cat >>confdefs.h <<\_ACEOF | |
187 | +#define EGG_SSL_EXT 1 | |
188 | +_ACEOF | |
189 | + | |
190 | + SSL_LIBS="-lssl -lcrypto" | |
191 | +else | |
192 | + { { echo "$as_me:$LINENO: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 | |
193 | +echo "$as_me: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} | |
194 | + { (exit 1); exit 1; }; } | |
195 | +fi | |
196 | + | |
197 | + ;; | |
198 | + *) | |
199 | + test -f $withval/openssl/ssl.h && SSL_INCLUDE="$withval" | |
200 | + test -f $withval/include/openssl/ssl.h && SSL_INCLUDE="$withval/include" | |
201 | + | |
202 | + test -f $withval/lib/libssl.a && SSL_LIB="$withval/lib" | |
203 | + test -f $withval/lib/ssl/libssl.a && SSL_LIB="$withval/lib/ssl" | |
204 | + test -f $withval/lib/openssl/libssl.a && SSL_LIB="$withval/lib/openssl/ssl" | |
205 | + test -f $withval/libssl.a && SSL_LIB="$withval" | |
206 | + test -f $withval/ssl/libssl.a && SSL_LIB="$withval/ssl" | |
207 | + test -f $withval/openssl/libssl.a && SSL_LIB="$withval/openssl" | |
208 | + | |
209 | + test -f $withval/lib/libcrypto.a && CRYPTO_LIB="$withval/lib" | |
210 | + test -f $withval/lib/ssl/libcrypto.a && CRYPTO_LIB="$withval/lib/ssl" | |
211 | + test -f $withval/lib/openssl/libcrypto.a && CRYPTO_LIB="$withval/lib/openssl/ssl" | |
212 | + test -f $withval/libcrypto.a && CRYPTO_LIB="$withval" | |
213 | + test -f $withval/ssl/libcrypto.a && CRYPTO_LIB="$withval/ssl" | |
214 | + test -f $withval/openssl/libcrypto.a && CRYPTO_LIB="$withval/openssl" | |
215 | + | |
216 | + if test -n "$SSL_INCLUDE" && test -n "$SSL_LIB" && test -n "$CRYPTO_LIB"; then | |
217 | + SSL_LIBS="-lssl -lcrypto -L$SSL_LIB -L$CRYPTO_LIB"; | |
218 | + cat >>confdefs.h <<\_ACEOF | |
219 | +#define EGG_SSL_EXT 1 | |
220 | +_ACEOF | |
221 | + | |
222 | + echo "$as_me:$LINENO: result: yes" >&5 | |
223 | +echo "${ECHO_T}yes" >&6 | |
224 | + else | |
225 | + echo "$as_me:$LINENO: result: no" >&5 | |
226 | +echo "${ECHO_T}no" >&6 | |
227 | + { { echo "$as_me:$LINENO: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 | |
228 | +echo "$as_me: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} | |
229 | + { (exit 1); exit 1; }; } | |
230 | + fi ;; | |
231 | + esac | |
232 | + | |
233 | +else | |
234 | + | |
235 | + echo "$as_me:$LINENO: result: will try to find" >&5 | |
236 | +echo "${ECHO_T}will try to find" >&6 | |
237 | + echo "$as_me:$LINENO: checking for SSL_accept in -lssl" >&5 | |
238 | +echo $ECHO_N "checking for SSL_accept in -lssl... $ECHO_C" >&6 | |
239 | +if test "${ac_cv_lib_ssl_SSL_accept+set}" = set; then | |
240 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | |
241 | +else | |
242 | + ac_check_lib_save_LIBS=$LIBS | |
243 | +LIBS="-lssl -lcrypto $LIBS" | |
244 | +cat >conftest.$ac_ext <<_ACEOF | |
e3a05f4b AG |
245 | +/* confdefs.h. */ |
246 | +_ACEOF | |
247 | +cat confdefs.h >>conftest.$ac_ext | |
248 | +cat >>conftest.$ac_ext <<_ACEOF | |
249 | +/* end confdefs.h. */ | |
250 | + | |
251 | +/* Override any gcc2 internal prototype to avoid an error. */ | |
252 | +#ifdef __cplusplus | |
253 | +extern "C" | |
254 | +#endif | |
255 | +/* We use char because int might match the return type of a gcc2 | |
256 | + builtin and then its argument prototype would still apply. */ | |
257 | +char SSL_accept (); | |
258 | +int | |
259 | +main () | |
260 | +{ | |
261 | +SSL_accept (); | |
262 | + ; | |
263 | + return 0; | |
264 | +} | |
265 | +_ACEOF | |
266 | +rm -f conftest.$ac_objext conftest$ac_exeext | |
267 | +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 | |
6e8c346a | 268 | + (eval $ac_link) 2>conftest.er1 |
e3a05f4b | 269 | + ac_status=$? |
6e8c346a AG |
270 | + grep -v '^ *+' conftest.er1 >conftest.err |
271 | + rm -f conftest.er1 | |
272 | + cat conftest.err >&5 | |
e3a05f4b AG |
273 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
274 | + (exit $ac_status); } && | |
6e8c346a AG |
275 | + { ac_try='test -z "$ac_c_werror_flag" |
276 | + || test ! -s conftest.err' | |
277 | + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | |
278 | + (eval $ac_try) 2>&5 | |
279 | + ac_status=$? | |
280 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
281 | + (exit $ac_status); }; } && | |
282 | + { ac_try='test -s conftest$ac_exeext' | |
e3a05f4b AG |
283 | + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
284 | + (eval $ac_try) 2>&5 | |
285 | + ac_status=$? | |
286 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
287 | + (exit $ac_status); }; }; then | |
288 | + ac_cv_lib_ssl_SSL_accept=yes | |
289 | +else | |
290 | + echo "$as_me: failed program was:" >&5 | |
291 | +sed 's/^/| /' conftest.$ac_ext >&5 | |
292 | + | |
293 | +ac_cv_lib_ssl_SSL_accept=no | |
294 | +fi | |
6e8c346a AG |
295 | +rm -f conftest.err conftest.$ac_objext \ |
296 | + conftest$ac_exeext conftest.$ac_ext | |
e3a05f4b AG |
297 | +LIBS=$ac_check_lib_save_LIBS |
298 | +fi | |
299 | +echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_accept" >&5 | |
300 | +echo "${ECHO_T}$ac_cv_lib_ssl_SSL_accept" >&6 | |
301 | +if test $ac_cv_lib_ssl_SSL_accept = yes; then | |
302 | + cat >>confdefs.h <<\_ACEOF | |
303 | +#define EGG_SSL_EXT 1 | |
304 | +_ACEOF | |
305 | + | |
306 | + SSL_LIBS="-lssl -lcrypto" | |
307 | +else | |
308 | + { { echo "$as_me:$LINENO: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 | |
309 | +echo "$as_me: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} | |
310 | + { (exit 1); exit 1; }; } | |
311 | +fi | |
312 | + | |
313 | + | |
314 | +for ac_header in "openssl/ssl.h" | |
315 | +do | |
316 | +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
317 | +if eval "test \"\${$as_ac_Header+set}\" = set"; then | |
318 | + echo "$as_me:$LINENO: checking for $ac_header" >&5 | |
319 | +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 | |
320 | +if eval "test \"\${$as_ac_Header+set}\" = set"; then | |
321 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | |
322 | +fi | |
323 | +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 | |
324 | +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 | |
325 | +else | |
326 | + # Is the header compilable? | |
327 | +echo "$as_me:$LINENO: checking $ac_header usability" >&5 | |
328 | +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 | |
329 | +cat >conftest.$ac_ext <<_ACEOF | |
e3a05f4b AG |
330 | +/* confdefs.h. */ |
331 | +_ACEOF | |
332 | +cat confdefs.h >>conftest.$ac_ext | |
333 | +cat >>conftest.$ac_ext <<_ACEOF | |
334 | +/* end confdefs.h. */ | |
335 | +$ac_includes_default | |
336 | +#include <$ac_header> | |
337 | +_ACEOF | |
338 | +rm -f conftest.$ac_objext | |
339 | +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | |
6e8c346a | 340 | + (eval $ac_compile) 2>conftest.er1 |
e3a05f4b | 341 | + ac_status=$? |
6e8c346a AG |
342 | + grep -v '^ *+' conftest.er1 >conftest.err |
343 | + rm -f conftest.er1 | |
344 | + cat conftest.err >&5 | |
e3a05f4b AG |
345 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
346 | + (exit $ac_status); } && | |
6e8c346a AG |
347 | + { ac_try='test -z "$ac_c_werror_flag" |
348 | + || test ! -s conftest.err' | |
349 | + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | |
350 | + (eval $ac_try) 2>&5 | |
351 | + ac_status=$? | |
352 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
353 | + (exit $ac_status); }; } && | |
354 | + { ac_try='test -s conftest.$ac_objext' | |
e3a05f4b AG |
355 | + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
356 | + (eval $ac_try) 2>&5 | |
357 | + ac_status=$? | |
358 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
359 | + (exit $ac_status); }; }; then | |
360 | + ac_header_compiler=yes | |
361 | +else | |
362 | + echo "$as_me: failed program was:" >&5 | |
363 | +sed 's/^/| /' conftest.$ac_ext >&5 | |
364 | + | |
365 | +ac_header_compiler=no | |
366 | +fi | |
6e8c346a | 367 | +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext |
e3a05f4b AG |
368 | +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 |
369 | +echo "${ECHO_T}$ac_header_compiler" >&6 | |
370 | + | |
371 | +# Is the header present? | |
372 | +echo "$as_me:$LINENO: checking $ac_header presence" >&5 | |
373 | +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 | |
374 | +cat >conftest.$ac_ext <<_ACEOF | |
e3a05f4b AG |
375 | +/* confdefs.h. */ |
376 | +_ACEOF | |
377 | +cat confdefs.h >>conftest.$ac_ext | |
378 | +cat >>conftest.$ac_ext <<_ACEOF | |
379 | +/* end confdefs.h. */ | |
380 | +#include <$ac_header> | |
381 | +_ACEOF | |
382 | +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 | |
383 | + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 | |
384 | + ac_status=$? | |
385 | + grep -v '^ *+' conftest.er1 >conftest.err | |
386 | + rm -f conftest.er1 | |
387 | + cat conftest.err >&5 | |
388 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 | |
389 | + (exit $ac_status); } >/dev/null; then | |
390 | + if test -s conftest.err; then | |
391 | + ac_cpp_err=$ac_c_preproc_warn_flag | |
6e8c346a | 392 | + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag |
e3a05f4b AG |
393 | + else |
394 | + ac_cpp_err= | |
395 | + fi | |
396 | +else | |
397 | + ac_cpp_err=yes | |
398 | +fi | |
399 | +if test -z "$ac_cpp_err"; then | |
400 | + ac_header_preproc=yes | |
401 | +else | |
402 | + echo "$as_me: failed program was:" >&5 | |
403 | +sed 's/^/| /' conftest.$ac_ext >&5 | |
404 | + | |
405 | + ac_header_preproc=no | |
406 | +fi | |
407 | +rm -f conftest.err conftest.$ac_ext | |
408 | +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 | |
409 | +echo "${ECHO_T}$ac_header_preproc" >&6 | |
410 | + | |
411 | +# So? What about this header? | |
6e8c346a AG |
412 | +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in |
413 | + yes:no: ) | |
e3a05f4b AG |
414 | + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 |
415 | +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} | |
6e8c346a AG |
416 | + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 |
417 | +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} | |
418 | + ac_header_preproc=yes | |
e3a05f4b | 419 | + ;; |
6e8c346a | 420 | + no:yes:* ) |
e3a05f4b AG |
421 | + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 |
422 | +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} | |
6e8c346a AG |
423 | + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 |
424 | +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} | |
425 | + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 | |
426 | +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} | |
427 | + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 | |
428 | +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} | |
e3a05f4b AG |
429 | + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 |
430 | +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} | |
6e8c346a AG |
431 | + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 |
432 | +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} | |
e3a05f4b AG |
433 | + ( |
434 | + cat <<\_ASBOX | |
6e8c346a AG |
435 | +## -------------------------------- ## |
436 | +## Report this to bugs@eggheads.org ## | |
437 | +## -------------------------------- ## | |
e3a05f4b AG |
438 | +_ASBOX |
439 | + ) | | |
440 | + sed "s/^/$as_me: WARNING: /" >&2 | |
441 | + ;; | |
442 | +esac | |
443 | +echo "$as_me:$LINENO: checking for $ac_header" >&5 | |
444 | +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 | |
445 | +if eval "test \"\${$as_ac_Header+set}\" = set"; then | |
446 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | |
447 | +else | |
6e8c346a | 448 | + eval "$as_ac_Header=\$ac_header_preproc" |
e3a05f4b AG |
449 | +fi |
450 | +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 | |
451 | +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 | |
452 | + | |
453 | +fi | |
454 | +if test `eval echo '${'$as_ac_Header'}'` = yes; then | |
455 | + cat >>confdefs.h <<_ACEOF | |
456 | +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
457 | +_ACEOF | |
458 | + | |
459 | +else | |
460 | + { { echo "$as_me:$LINENO: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 | |
461 | +echo "$as_me: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} | |
462 | + { (exit 1); exit 1; }; } | |
463 | +fi | |
464 | + | |
465 | +done | |
466 | + | |
467 | + | |
468 | + | |
469 | +fi; | |
470 | + | |
6e8c346a | 471 | +#end of ssl checks - hoe (.16 by poci) |
e3a05f4b | 472 | + |
e3a05f4b | 473 | + |
e3a05f4b | 474 | |
6e8c346a | 475 | # Substitute Makefile variables. |
e3a05f4b | 476 | |
6e8c346a | 477 | @@ -10811,6 +11180,8 @@ |
e3a05f4b AG |
478 | s,@TCLINCFN@,$TCLINCFN,;t t |
479 | s,@TCL_REQS@,$TCL_REQS,;t t | |
480 | s,@TCL_LIBS@,$TCL_LIBS,;t t | |
481 | +s,@SSL_LIBS@,$SSL_LIBS,;t t | |
482 | +s,@SSL_INCLUDE@,$SSL_INCLUDE,;t t | |
483 | s,@EGGVERSION@,$EGGVERSION,;t t | |
6e8c346a | 484 | s,@DESTDIR@,$DESTDIR,;t t |
e3a05f4b | 485 | s,@MOD_UPDIR@,$MOD_UPDIR,;t t |
6e8c346a AG |
486 | diff -burN eggdrop1.6.17.orig/configure.ac eggdrop1.6.17/configure.ac |
487 | --- eggdrop1.6.17.orig/configure.ac 2004-11-01 14:40:44.109455336 +0100 | |
488 | +++ eggdrop1.6.17/configure.ac 2004-11-01 14:41:51.866154752 +0100 | |
489 | @@ -148,6 +148,8 @@ | |
490 | EGG_TCL_LIB_REQS | |
e3a05f4b | 491 | EGG_TCL_LUSH |
e3a05f4b AG |
492 | |
493 | +EGG_SSL_CRAP | |
494 | + | |
e3a05f4b | 495 | |
6e8c346a | 496 | # Substitute Makefile variables. |
e3a05f4b | 497 | EGG_SUBST_EGGVERSION |
6e8c346a AG |
498 | diff -burN eggdrop1.6.17.orig/disabled_modules eggdrop1.6.17/disabled_modules |
499 | --- eggdrop1.6.17.orig/disabled_modules 2004-11-01 14:40:44.110455184 +0100 | |
500 | +++ eggdrop1.6.17/disabled_modules 1970-01-01 01:00:00.000000000 +0100 | |
501 | @@ -1,12 +0,0 @@ | |
502 | -# disabled_modules -- File which lists all Eggdrop modules that are | |
503 | -# disabled by default. | |
504 | -# | |
505 | -# $Id$ | |
506 | -# | |
507 | -# Note: | |
508 | -# - Lines which start with a '#' character are ignored. | |
509 | -# - Every module name needs to be on its own line | |
510 | - | |
511 | -# Woobie only serves as an example for module programming. No need to | |
512 | -# compile it for normal bots ... | |
513 | -woobie | |
6e8c346a AG |
514 | diff -burN eggdrop1.6.17.orig/Makefile eggdrop1.6.17/Makefile |
515 | --- eggdrop1.6.17.orig/Makefile 2004-11-01 14:40:44.093457768 +0100 | |
516 | +++ eggdrop1.6.17/Makefile 1970-01-01 01:00:00.000000000 +0100 | |
517 | @@ -1,8 +0,0 @@ | |
518 | -all: | |
519 | - @echo "" | |
520 | - @echo "Before you can compile your bot you have to configure it." | |
521 | - @echo "Please start the configure script now:" | |
522 | - @echo "" | |
523 | - @echo " % ./configure" | |
524 | - @echo "" | |
525 | - | |
526 | diff -burN eggdrop1.6.17.orig/Makefile.in eggdrop1.6.17/Makefile.in | |
527 | --- eggdrop1.6.17.orig/Makefile.in 2004-11-01 14:40:44.109455336 +0100 | |
528 | +++ eggdrop1.6.17/Makefile.in 2004-11-01 14:41:51.766169952 +0100 | |
529 | @@ -57,6 +57,8 @@ | |
530 | RANLIB = @RANLIB@ | |
531 | MOD_EXT = @MOD_EXT@ | |
e3a05f4b | 532 | XREQS = @TCL_REQS@ |
e3a05f4b AG |
533 | +XSSL_LIBS = @SSL_LIBS@ |
534 | +XSSL_INCLUDE = @SSL_INCLUDE@ | |
535 | TCLLIB = @TCLLIB@ | |
536 | TCLLIBFN = @TCLLIBFN@ | |
537 | ||
6e8c346a | 538 | @@ -89,7 +91,8 @@ |
e3a05f4b AG |
539 | MAKE_MODEGG = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(MOD_CC)' 'LD=$(MOD_LD)' \ |
540 | 'STRIP=$(MOD_STRIP)' 'RANLIB=$(RANLIB)' 'CFLGS=$(CFLGS)' \ | |
541 | 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \ | |
6e8c346a | 542 | -'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(standard build)' 'MODOBJS=' |
e3a05f4b AG |
543 | +'XSSL_LIBS=$(XSSL_LIBS)' 'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' \ |
544 | +'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'EGGBUILD=' 'MODOBJS=' | |
545 | ||
546 | MAKE_MODULES = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(SHLIB_CC)' 'LD=$(SHLIB_LD)' \ | |
6e8c346a AG |
547 | 'STRIP=$(SHLIB_STRIP)' 'CFLGS=$(CFLGS)' 'XLIBS=$(XLIBS)' 'MOD_EXT=$(MOD_EXT)' \ |
548 | @@ -99,12 +102,13 @@ | |
e3a05f4b AG |
549 | 'STRIP=$(STRIP)' 'RANLIB=$(RANLIB)' 'CFLGS=$(CFLGS) -DSTATIC' \ |
550 | 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \ | |
551 | 'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(static version)' \ | |
552 | -'MODOBJS=mod/*.o' | |
553 | +'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'XSSL_LIBS=$(XSSL_LIBS)' 'MODOBJS=mod/*.o' | |
554 | ||
555 | MAKE_DEBEGG = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(MOD_CC)' 'LD=$(MOD_LD) -g' \ | |
556 | 'STRIP=touch' 'RANLIB=$(RANLIB)' 'CFLGS=-g3 $(DEBCFLAGS) $(CFLGS)' \ | |
557 | 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \ | |
558 | -'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(debug version)' 'MODOBJS=' | |
559 | +'XSSL_LIBS=$(XSSL_LIBS)' 'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' \ | |
560 | +'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'EGGBUILD=(debug version)' 'MODOBJS=' | |
561 | ||
562 | MAKE_DEBMODULES = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(SHLIB_CC)' 'LD=$(SHLIB_LD)' \ | |
563 | 'XLIBS=$(XLIBS)' 'STRIP=touch' 'CFLGS=-g3 $(DEBCFLAGS) $(CFLGS)' \ | |
6e8c346a | 564 | @@ -113,7 +117,8 @@ |
e3a05f4b AG |
565 | MAKE_SDEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD) -g' \ |
566 | 'STRIP=touch' 'RANLIB=$(RANLIB)' 'CFLGS=-g3 $(DEBCFLAGS) -DSTATIC $(CFLGS)' \ | |
567 | 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' 'XLIBS=$(XLIBS)' \ | |
6e8c346a | 568 | -'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(static debug version)' 'MODOBJS=mod/*.o' |
e3a05f4b AG |
569 | +'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'XSSL_LIBS=$(XSSL_LIBS)' 'EGGEXEC=$(EGGEXEC)' \ |
570 | +'EGGBUILD=(static and debug version)' 'MODOBJS=mod/*.o' | |
571 | ||
572 | MAKE_DEPEND = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD)' \ | |
573 | 'STRIP=$(STRIP)' 'CFLGS=$(CFLGS)' | |
6e8c346a AG |
574 | diff -burN eggdrop1.6.17.orig/src/dcc.c eggdrop1.6.17/src/dcc.c |
575 | --- eggdrop1.6.17.orig/src/dcc.c 2004-11-01 14:40:44.050464304 +0100 | |
576 | +++ eggdrop1.6.17/src/dcc.c 2004-11-01 14:41:51.870154144 +0100 | |
e3a05f4b AG |
577 | @@ -32,7 +32,11 @@ |
578 | #include "tandem.h" | |
579 | ||
580 | /* Includes for botnet md5 challenge/response code <cybah> */ | |
581 | +#ifndef EGG_SSL_EXT | |
582 | #include "md5/md5.h" | |
583 | +#else | |
584 | +#include "openssl/md5.h" | |
585 | +#endif | |
586 | ||
587 | extern struct userrec *userlist; | |
588 | extern struct chanset_t *chanset; | |
6e8c346a AG |
589 | diff -burN eggdrop1.6.17.orig/src/dccutil.c eggdrop1.6.17/src/dccutil.c |
590 | --- eggdrop1.6.17.orig/src/dccutil.c 2004-11-01 14:40:44.053463848 +0100 | |
591 | +++ eggdrop1.6.17/src/dccutil.c 2004-11-01 14:41:51.872153840 +0100 | |
e3a05f4b AG |
592 | @@ -33,6 +33,7 @@ |
593 | #include "chan.h" | |
594 | #include "modules.h" | |
595 | #include "tandem.h" | |
596 | +#include "net.h" | |
597 | ||
598 | extern struct dcc_t *dcc; | |
599 | extern int dcc_total, max_dcc, dcc_flood_thr, backgrd, copy_to_tmp, MAXSOCKS; | |
6e8c346a AG |
600 | diff -burN eggdrop1.6.17.orig/src/eggdrop.h eggdrop1.6.17/src/eggdrop.h |
601 | --- eggdrop1.6.17.orig/src/eggdrop.h 2004-11-01 14:40:44.068461568 +0100 | |
602 | +++ eggdrop1.6.17/src/eggdrop.h 2004-11-01 14:41:51.873153688 +0100 | |
603 | @@ -616,17 +616,6 @@ | |
604 | #define HELP_TEXT 2 | |
605 | #define HELP_IRC 16 | |
606 | ||
607 | -/* This is used by the net module to keep track of sockets and what's | |
608 | - * queued on them | |
609 | - */ | |
e3a05f4b AG |
610 | -typedef struct { |
611 | - int sock; | |
612 | - short flags; | |
613 | - char *inbuf; | |
614 | - char *outbuf; | |
615 | - unsigned long outbuflen; /* Outbuf could be binary data */ | |
616 | - unsigned long inbuflen; /* Inbuf could be binary data */ | |
e3a05f4b | 617 | -} sock_list; |
e3a05f4b AG |
618 | |
619 | enum { | |
620 | EGG_OPTION_SET = 1, /* Set option(s). */ | |
6e8c346a AG |
621 | diff -burN eggdrop1.6.17.orig/src/main.c eggdrop1.6.17/src/main.c |
622 | --- eggdrop1.6.17.orig/src/main.c 2004-11-01 14:40:44.069461416 +0100 | |
623 | +++ eggdrop1.6.17/src/main.c 2004-11-01 14:41:51.875153384 +0100 | |
624 | @@ -161,6 +161,9 @@ | |
e3a05f4b AG |
625 | int cx_ptr = 0; |
626 | #endif | |
627 | ||
628 | +#ifdef EGG_SSL_EXT | |
6e8c346a | 629 | +int clean_net(); |
e3a05f4b AG |
630 | +#endif |
631 | ||
632 | void fatal(const char *s, int recoverable) | |
633 | { | |
6e8c346a | 634 | @@ -171,6 +174,9 @@ |
e3a05f4b AG |
635 | for (i = 0; i < dcc_total; i++) |
636 | if (dcc[i].sock >= 0) | |
637 | killsock(dcc[i].sock); | |
6e8c346a | 638 | + #ifdef EGG_SSL_EXT |
e3a05f4b | 639 | + clean_net(); |
6e8c346a | 640 | + #endif |
e3a05f4b AG |
641 | unlink(pid_file); |
642 | if (!recoverable) { | |
643 | bg_send_quit(BG_ABORT); | |
6e8c346a AG |
644 | diff -burN eggdrop1.6.17.orig/src/Makefile.in eggdrop1.6.17/src/Makefile.in |
645 | --- eggdrop1.6.17.orig/src/Makefile.in 2004-11-01 14:40:44.067461720 +0100 | |
646 | +++ eggdrop1.6.17/src/Makefile.in 2004-11-01 14:41:51.868154448 +0100 | |
647 | @@ -11,6 +11,8 @@ | |
648 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
649 | INSTALL_DATA = @INSTALL_DATA@ | |
650 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
651 | +XSSL_LIBS = @SSL_LIBS@ | |
652 | +XSSL_INCLUDE = @SSL_INCLUDE@ | |
653 | ||
e3a05f4b AG |
654 | CC = @CC@ |
655 | LD = @CC@ | |
6e8c346a AG |
656 | @@ -37,7 +39,7 @@ |
657 | @echo "Linking eggdrop $(EGGBUILD)." | |
e3a05f4b AG |
658 | @echo "" |
659 | @touch mod/mod.xlibs | |
660 | - $(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs` | |
6e8c346a | 661 | + $(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs` $(XSSL_LIBS) $(XSSL_INCLUDE) |
e3a05f4b | 662 | $(STRIP) ../$(EGGEXEC) |
e3a05f4b | 663 | @echo "" |
6e8c346a AG |
664 | @echo "Successful compile: $(EGGEXEC)" |
665 | diff -burN eggdrop1.6.17.orig/src/md5/md5c.c eggdrop1.6.17/src/md5/md5c.c | |
666 | --- eggdrop1.6.17.orig/src/md5/md5c.c 2004-11-01 14:40:43.906486192 +0100 | |
667 | +++ eggdrop1.6.17/src/md5/md5c.c 2004-11-01 14:41:51.920146544 +0100 | |
668 | @@ -17,9 +17,23 @@ | |
e3a05f4b | 669 | |
e3a05f4b AG |
670 | #include <string.h> |
671 | ||
6e8c346a | 672 | +#ifndef EGG_SSL_EXT |
e3a05f4b | 673 | #include "md5.h" |
6e8c346a AG |
674 | +#else |
675 | +#include "openssl/md5.h" | |
676 | +#endif | |
677 | + | |
678 | #include "compat/compat.h" | |
e3a05f4b | 679 | |
6e8c346a | 680 | +typedef unsigned long MD5_u32plus; |
e3a05f4b | 681 | + |
6e8c346a AG |
682 | +typedef struct { |
683 | + MD5_u32plus lo, hi; | |
684 | + MD5_u32plus a, b, c, d; | |
685 | + unsigned char buffer[64]; | |
686 | + MD5_u32plus block[16]; | |
687 | +} MD5_CTX; | |
688 | + | |
689 | /* | |
690 | * The basic MD5 functions. | |
691 | * | |
692 | diff -burN eggdrop1.6.17.orig/src/md5/md5.h eggdrop1.6.17/src/md5/md5.h | |
693 | --- eggdrop1.6.17.orig/src/md5/md5.h 2004-11-01 14:40:43.905486344 +0100 | |
694 | +++ eggdrop1.6.17/src/md5/md5.h 2004-11-01 14:41:51.876153232 +0100 | |
695 | @@ -5,6 +5,9 @@ | |
696 | * Written by Solar Designer <solar@openwall.com> in 2001, and placed in | |
e3a05f4b AG |
697 | * the public domain. See md5c.c for more information. |
698 | */ | |
e3a05f4b AG |
699 | +#include "../config.h" |
700 | +#ifndef EGG_SSL_EXT | |
701 | + | |
6e8c346a | 702 | |
e3a05f4b AG |
703 | #ifndef _MD5_H |
704 | #define _MD5_H | |
e3a05f4b AG |
705 | @@ -24,3 +27,4 @@ |
706 | extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); | |
707 | ||
708 | #endif | |
709 | +#endif | |
6e8c346a AG |
710 | diff -burN eggdrop1.6.17.orig/src/mod/irc.mod/chan.c eggdrop1.6.17/src/mod/irc.mod/chan.c |
711 | --- eggdrop1.6.17.orig/src/mod/irc.mod/chan.c 2004-11-01 14:40:44.040465824 +0100 | |
712 | +++ eggdrop1.6.17/src/mod/irc.mod/chan.c 2004-11-01 14:41:51.953141528 +0100 | |
713 | @@ -952,10 +952,10 @@ | |
e3a05f4b AG |
714 | q = strchr(p, ' '); |
715 | if (q != NULL) { | |
716 | *q = 0; | |
717 | - set_key(chan, p); | |
718 | + set_keyegg(chan, p); | |
719 | strcpy(p, q + 1); | |
720 | } else { | |
721 | - set_key(chan, p); | |
722 | + set_keyegg(chan, p); | |
723 | *p = 0; | |
724 | } | |
725 | } | |
6e8c346a AG |
726 | diff -burN eggdrop1.6.17.orig/src/mod/irc.mod/irc.c eggdrop1.6.17/src/mod/irc.mod/irc.c |
727 | --- eggdrop1.6.17.orig/src/mod/irc.mod/irc.c 2004-11-01 14:40:44.037466280 +0100 | |
728 | +++ eggdrop1.6.17/src/mod/irc.mod/irc.c 2004-11-01 14:41:51.987136360 +0100 | |
729 | @@ -256,7 +256,7 @@ | |
e3a05f4b AG |
730 | |
731 | /* Set the key. | |
732 | */ | |
733 | -static void set_key(struct chanset_t *chan, char *k) | |
734 | +static void set_keyegg(struct chanset_t *chan, char *k) | |
735 | { | |
736 | nfree(chan->channel.key); | |
737 | if (k == NULL) { | |
6e8c346a AG |
738 | diff -burN eggdrop1.6.17.orig/src/mod/irc.mod/irc.h eggdrop1.6.17/src/mod/irc.mod/irc.h |
739 | --- eggdrop1.6.17.orig/src/mod/irc.mod/irc.h 2004-11-01 14:40:44.039465976 +0100 | |
740 | +++ eggdrop1.6.17/src/mod/irc.mod/irc.h 2004-11-01 14:41:51.988136208 +0100 | |
e3a05f4b AG |
741 | @@ -69,7 +69,7 @@ |
742 | ||
743 | static void reset_chan_info(struct chanset_t *); | |
744 | static void recheck_channel(struct chanset_t *, int); | |
745 | -static void set_key(struct chanset_t *, char *); | |
746 | +static void set_keyegg(struct chanset_t *, char *); | |
747 | static void maybe_revenge(struct chanset_t *, char *, char *, int); | |
748 | static int detect_chan_flood(char *, char *, char *, struct chanset_t *, int, | |
749 | char *); | |
6e8c346a AG |
750 | diff -burN eggdrop1.6.17.orig/src/mod/irc.mod/mode.c eggdrop1.6.17/src/mod/irc.mod/mode.c |
751 | --- eggdrop1.6.17.orig/src/mod/irc.mod/mode.c 2004-11-01 14:40:44.041465672 +0100 | |
752 | +++ eggdrop1.6.17/src/mod/irc.mod/mode.c 2004-11-01 14:41:51.991135752 +0100 | |
753 | @@ -1128,7 +1128,7 @@ | |
e3a05f4b AG |
754 | } |
755 | check_tcl_mode(nick, from, u, chan->dname, ms2, op); | |
756 | if (ms2[0] == '+') { | |
757 | - set_key(chan, op); | |
758 | + set_keyegg(chan, op); | |
759 | if (channel_active(chan)) | |
760 | got_key(chan, nick, from, op); | |
761 | } else { | |
6e8c346a | 762 | @@ -1139,7 +1139,7 @@ |
e3a05f4b AG |
763 | !chan_master(user) && !match_my_nick(nick)) |
764 | add_mode(chan, '+', 'k', chan->key_prot); | |
765 | } | |
766 | - set_key(chan, NULL); | |
767 | + set_keyegg(chan, NULL); | |
768 | } | |
769 | break; | |
770 | case 'o': | |
6e8c346a AG |
771 | diff -burN eggdrop1.6.17.orig/src/mod/module.h eggdrop1.6.17/src/mod/module.h |
772 | --- eggdrop1.6.17.orig/src/mod/module.h 2004-11-01 14:40:43.926483152 +0100 | |
773 | +++ eggdrop1.6.17/src/mod/module.h 2004-11-01 14:41:51.995135144 +0100 | |
774 | @@ -471,13 +471,23 @@ | |
775 | /* IPv6 leftovers: 286 */ | |
776 | /* IPv6 leftovers: 287 */ | |
777 | /* 288 - 291 */ | |
778 | -/* IPv6 leftovers: 288 */ | |
e3a05f4b AG |
779 | +#ifdef EGG_SSL_EXT |
780 | +#define net_switch_to_ssl ((int (*)(int))global[289]) | |
781 | +#define use_ssl (*(int *)global[290]) /* kyotou */ | |
6e8c346a AG |
782 | +#define strip_mirc_codes ((void (*)(int, char *))global[291]) |
783 | +#define check_ansi ((int (*) (char *))global[292]) | |
784 | +#define oatoi ((int (*) (const char *))global[293]) | |
785 | +/* 292 - 295 */ | |
786 | +#define str_isdigit ((int (*) (const char *))global[294]) | |
787 | +#define remove_crlf ((void (*)(char **))global[295]) | |
788 | +#else | |
789 | #define strip_mirc_codes ((void (*)(int, char *))global[289]) | |
790 | #define check_ansi ((int (*) (char *))global[290]) | |
791 | #define oatoi ((int (*) (const char *))global[291]) | |
792 | /* 292 - 295 */ | |
793 | #define str_isdigit ((int (*) (const char *))global[292]) | |
794 | #define remove_crlf ((void (*)(char **))global[293]) | |
e3a05f4b AG |
795 | +#endif |
796 | ||
797 | /* hostmasking */ | |
798 | #define maskhost(a,b) _maskhost((a),(b),1) | |
6e8c346a AG |
799 | diff -burN eggdrop1.6.17.orig/src/mod/server.mod/servmsg.c eggdrop1.6.17/src/mod/server.mod/servmsg.c |
800 | --- eggdrop1.6.17.orig/src/mod/server.mod/servmsg.c 2004-11-01 14:40:43.987473880 +0100 | |
801 | +++ eggdrop1.6.17/src/mod/server.mod/servmsg.c 2004-11-01 14:41:52.036128912 +0100 | |
802 | @@ -1239,6 +1239,14 @@ | |
e3a05f4b AG |
803 | fatal("NO SERVERS WILL ACCEPT MY CONNECTION.", 0); |
804 | } else { | |
805 | dcc[servidx].sock = serv; | |
6e8c346a AG |
806 | + #ifdef EGG_SSL_EXT |
807 | + if (use_ssl) { /* kyotou */ | |
808 | + if (net_switch_to_ssl(serv)==0) { | |
809 | + putlog(LOG_SERV, "*", "SSL %s %s (Error while switching to SSL)", IRC_FAILEDCONNECT, dcc[servidx].host); | |
810 | + lostdcc(servidx); | |
811 | + } | |
812 | + } | |
813 | + #endif | |
e3a05f4b AG |
814 | /* Queue standard login */ |
815 | dcc[servidx].timeval = now; | |
816 | SERVER_SOCKET.timeout_val = &server_timeout; | |
6e8c346a AG |
817 | diff -burN eggdrop1.6.17.orig/src/modules.c eggdrop1.6.17/src/modules.c |
818 | --- eggdrop1.6.17.orig/src/modules.c 2004-11-01 14:40:44.071461112 +0100 | |
819 | +++ eggdrop1.6.17/src/modules.c 2004-11-01 14:41:52.041128152 +0100 | |
820 | @@ -29,9 +29,17 @@ | |
e3a05f4b AG |
821 | #include "main.h" |
822 | #include "modules.h" | |
823 | #include "tandem.h" | |
824 | + | |
825 | +#ifndef EGG_SSL_EXT | |
826 | #include "md5/md5.h" | |
827 | +#else | |
828 | +#include "openssl/md5.h" | |
829 | +#endif | |
830 | + | |
e3a05f4b | 831 | #include "users.h" |
e3a05f4b | 832 | |
6e8c346a AG |
833 | +#include "net.h" |
834 | + | |
835 | #ifndef STATIC | |
836 | # ifdef MOD_USE_SHL | |
837 | # include <dl.h> | |
838 | @@ -94,6 +102,10 @@ | |
e3a05f4b AG |
839 | password_timeout, force_expire, protect_readonly, reserved_port_min, |
840 | reserved_port_max, copy_to_tmp, quiet_reject; | |
6e8c346a | 841 | |
e3a05f4b AG |
842 | +#ifdef EGG_SSL_EXT |
843 | +extern int use_ssl; /* kyotou */ | |
844 | +#endif | |
6e8c346a | 845 | + |
e3a05f4b AG |
846 | extern party_t *party; |
847 | extern time_t now, online_since; | |
6e8c346a AG |
848 | extern tand_t *tandbot; |
849 | @@ -128,6 +140,10 @@ | |
850 | } | |
851 | #endif /* STATIC */ | |
e3a05f4b AG |
852 | |
853 | +#ifdef EGG_SSL_EXT | |
854 | +int net_switch_to_ssl(int); | |
855 | +#endif | |
e3a05f4b AG |
856 | + |
857 | ||
6e8c346a AG |
858 | /* The null functions */ |
859 | void null_func() | |
860 | @@ -564,7 +580,13 @@ | |
861 | (Function) 0, /* IPv6 leftovers: 286 */ | |
862 | (Function) 0, /* IPv6 leftovers: 287 */ | |
863 | /* 288 - 291 */ | |
e3a05f4b | 864 | +#ifdef EGG_SSL_EXT |
6e8c346a | 865 | (Function) 0, /* IPv6 leftovers: 288 */ |
e3a05f4b | 866 | + (Function) net_switch_to_ssl, |
6e8c346a | 867 | + (Function) & use_ssl, /* kyotou */ |
e3a05f4b | 868 | +#else |
6e8c346a | 869 | + (Function) 0, /* IPv6 leftovers: 288 */ |
e3a05f4b | 870 | +#endif |
6e8c346a AG |
871 | (Function) strip_mirc_codes, |
872 | (Function) check_ansi, | |
873 | (Function) oatoi, | |
874 | diff -burN eggdrop1.6.17.orig/src/net.c eggdrop1.6.17/src/net.c | |
875 | --- eggdrop1.6.17.orig/src/net.c 2004-11-01 14:40:44.052464000 +0100 | |
876 | +++ eggdrop1.6.17/src/net.c 2004-11-01 14:41:52.044127696 +0100 | |
877 | @@ -34,6 +34,18 @@ | |
e3a05f4b AG |
878 | # endif |
879 | #endif | |
880 | ||
881 | +#ifdef EGG_SSL_EXT | |
6e8c346a AG |
882 | +# ifndef EGG_SSL_INCS |
883 | +# include <openssl/ssl.h> | |
884 | +# include <openssl/err.h> | |
885 | +# include <openssl/rand.h> | |
886 | +# define EGG_SSL_INCS 1 | |
887 | +# endif | |
e3a05f4b AG |
888 | +#endif |
889 | + | |
890 | +#include "net.h" | |
6e8c346a | 891 | + |
e3a05f4b AG |
892 | + |
893 | extern struct dcc_t *dcc; | |
894 | extern int backgrd, use_stderr, resolve_timeout, dcc_total; | |
895 | extern unsigned long otraffic_irc_today, otraffic_bn_today, otraffic_dcc_today, | |
6e8c346a AG |
896 | @@ -46,7 +58,11 @@ |
897 | int firewallport = 1080; /* Default port of socks 4/5 firewalls. */ | |
898 | char botuser[21] = "eggdrop"; /* Username of the user running the bot. */ | |
899 | int dcc_sanitycheck = 0; /* Do some sanity checking on dcc connections. */ | |
900 | - | |
e3a05f4b AG |
901 | +#ifdef EGG_SSL_EXT |
902 | +SSL_CTX *ssl_ctx=NULL; | |
903 | +char *tls_rand_file = NULL; | |
904 | +int use_ssl = 0; /* kyotou */ | |
905 | +#endif | |
6e8c346a | 906 | sock_list *socklist = NULL; /* Enough to be safe. */ |
e3a05f4b | 907 | int MAXSOCKS = 0; |
6e8c346a AG |
908 | jmp_buf alarmret; /* Env buffer for alarm() returns. */ |
909 | @@ -70,6 +86,46 @@ | |
910 | return ret; | |
e3a05f4b AG |
911 | } |
912 | ||
913 | +#ifdef EGG_SSL_EXT | |
914 | +int seed_PRNG(void) | |
915 | +{ | |
916 | + char stackdata[1024]; | |
917 | + static char rand_file[300]; | |
918 | + FILE *fh; | |
6e8c346a | 919 | + |
e3a05f4b AG |
920 | +#if OPENSSL_VERSION_NUMBER >= 0x00905100 |
921 | + if (RAND_status()) | |
922 | + return 0; /* PRNG already good seeded */ | |
923 | +#endif | |
924 | + /* if the device '/dev/urandom' is present, OpenSSL uses it by default. | |
925 | + * check if it's present, else we have to make random data ourselfs. | |
926 | + */ | |
927 | + if ((fh = fopen("/dev/urandom", "r"))) { | |
928 | + fclose(fh); | |
929 | + return 0; | |
930 | + } | |
931 | + if (RAND_file_name(rand_file, sizeof(rand_file))) | |
932 | + tls_rand_file = rand_file; | |
933 | + else | |
934 | + return 1; | |
935 | + if (!RAND_load_file(rand_file, 1024)) { | |
936 | + /* no .rnd file found, create new seed */ | |
937 | + unsigned int c; | |
938 | + c = time(NULL); | |
939 | + RAND_seed(&c, sizeof(c)); | |
940 | + c = getpid(); | |
941 | + RAND_seed(&c, sizeof(c)); | |
942 | + RAND_seed(stackdata, sizeof(stackdata)); | |
943 | + } | |
944 | +#if OPENSSL_VERSION_NUMBER >= 0x00905100 | |
945 | + if (!RAND_status()) | |
946 | + return 2; /* PRNG still badly seeded */ | |
947 | +#endif | |
948 | + return 0; | |
949 | +} | |
950 | +#endif | |
6e8c346a | 951 | + |
e3a05f4b AG |
952 | + |
953 | /* Initialize the socklist | |
954 | */ | |
955 | void init_net() | |
6e8c346a | 956 | @@ -78,8 +134,34 @@ |
e3a05f4b AG |
957 | |
958 | for (i = 0; i < MAXSOCKS; i++) { | |
959 | socklist[i].flags = SOCK_UNUSED; | |
960 | +#ifdef EGG_SSL_EXT | |
961 | + socklist[i].ssl=NULL; | |
962 | +#endif | |
6e8c346a | 963 | + } |
e3a05f4b AG |
964 | +#ifdef EGG_SSL_EXT |
965 | + /* good place to init ssl stuff */ | |
966 | + SSL_load_error_strings(); | |
967 | + OpenSSL_add_ssl_algorithms(); | |
968 | + ssl_ctx=SSL_CTX_new(SSLv23_client_method()); | |
6e8c346a AG |
969 | + if (!ssl_ctx) |
970 | + fatal("SSL_CTX_new() failed",0); | |
e3a05f4b | 971 | + if (seed_PRNG()) |
6e8c346a | 972 | + fatal("Wasn't able to properly seed the PRNG!",0); |
e3a05f4b | 973 | +#endif |
6e8c346a AG |
974 | +} |
975 | + | |
e3a05f4b AG |
976 | +#ifdef EGG_SSL_EXT |
977 | +/* cleanup mess when quiting */ | |
978 | +int clean_net() { | |
979 | + if (ssl_ctx) { | |
980 | + SSL_CTX_free(ssl_ctx); | |
981 | + ssl_ctx = NULL; | |
6e8c346a | 982 | } |
e3a05f4b AG |
983 | + if (tls_rand_file) |
984 | + RAND_write_file(tls_rand_file); | |
985 | + return 0; | |
6e8c346a | 986 | } |
e3a05f4b | 987 | +#endif |
6e8c346a | 988 | |
e3a05f4b AG |
989 | int expmem_net() |
990 | { | |
6e8c346a AG |
991 | @@ -289,6 +371,13 @@ |
992 | ||
e3a05f4b AG |
993 | for (i = 0; i < MAXSOCKS; i++) { |
994 | if ((socklist[i].sock == sock) && !(socklist[i].flags & SOCK_UNUSED)) { | |
995 | +#ifdef EGG_SSL_EXT | |
996 | + if (socklist[i].ssl) { | |
997 | + SSL_shutdown(socklist[i].ssl); | |
6e8c346a AG |
998 | + SSL_free(socklist[i].ssl); |
999 | + socklist[i].ssl=NULL; | |
1000 | + } | |
e3a05f4b AG |
1001 | +#endif |
1002 | close(socklist[i].sock); | |
1003 | if (socklist[i].inbuf != NULL) { | |
1004 | nfree(socklist[i].inbuf); | |
6e8c346a | 1005 | @@ -428,6 +517,63 @@ |
e3a05f4b AG |
1006 | return sock; |
1007 | } | |
1008 | ||
1009 | +#ifdef EGG_SSL_EXT | |
1010 | +int net_switch_to_ssl(int sock) { | |
1011 | +int err; | |
1012 | +int i=0; | |
1013 | + debug0("net_switch_to_ssl()"); | |
1014 | + while (i<MAXSOCKS) { | |
1015 | + if (socklist[i].sock==sock) { | |
1016 | + break; | |
1017 | + } | |
1018 | + i++; | |
1019 | + } | |
1020 | + if (i==MAXSOCKS) { | |
1021 | + debug0("Error while swithing to SSL - sock not found in list"); | |
1022 | + return 0; | |
1023 | + } | |
1024 | + | |
1025 | + if (socklist[i].ssl) { | |
1026 | + debug0("Error while swithing to SSL - already in ssl"); | |
1027 | + return 0; | |
1028 | + } | |
1029 | + socklist[i].ssl = SSL_new(ssl_ctx); | |
1030 | + if (!socklist[i].ssl) { | |
1031 | + debug0("Error while swithing to SSL - SSL_new() error"); | |
1032 | + return 0; | |
1033 | + } | |
1034 | + | |
1035 | + SSL_set_fd(socklist[i].ssl, socklist[i].sock); | |
1036 | + err = SSL_connect(socklist[i].ssl); | |
6e8c346a | 1037 | + |
e3a05f4b AG |
1038 | + while (err <= 0) { |
1039 | + int errs; | |
1040 | + errs=SSL_get_error(socklist[i].ssl,err); | |
1041 | + if ((errs!=SSL_ERROR_WANT_READ)&&(errs!=SSL_ERROR_WANT_WRITE)&& | |
1042 | + (errs!=SSL_ERROR_WANT_X509_LOOKUP)) { | |
1043 | + putlog(LOG_DEBUG,"*", "SSL_connect() = %d, %s", err, | |
1044 | + (char *)ERR_error_string(ERR_get_error(), NULL)); | |
1045 | + SSL_shutdown(socklist[i].ssl); | |
1046 | + SSL_free(socklist[i].ssl); | |
1047 | + socklist[i].ssl = NULL; | |
6e8c346a | 1048 | + return 0; |
e3a05f4b AG |
1049 | + } |
1050 | + usleep(1000); | |
1051 | + err = SSL_connect(socklist[i].ssl); | |
1052 | + } | |
1053 | + | |
1054 | + if (err==1) { | |
6e8c346a | 1055 | + debug0("SSL_connect() success"); |
e3a05f4b AG |
1056 | + return 1; |
1057 | + } | |
6e8c346a | 1058 | + debug0("Error while SSL_connect()"); |
e3a05f4b | 1059 | + SSL_shutdown(socklist[i].ssl); |
6e8c346a | 1060 | + SSL_free(socklist[i].ssl); |
e3a05f4b AG |
1061 | + socklist[i].ssl = NULL; |
1062 | + return 0; | |
1063 | +} | |
1064 | +#endif | |
1065 | + | |
1066 | /* Ordinary non-binary connection attempt */ | |
1067 | int open_telnet(char *server, int port) | |
1068 | { | |
6e8c346a | 1069 | @@ -639,6 +785,9 @@ |
e3a05f4b AG |
1070 | for (i = 0; i < MAXSOCKS; i++) { |
1071 | if ((!(socklist[i].flags & SOCK_UNUSED)) && | |
1072 | ((FD_ISSET(socklist[i].sock, &fd)) || | |
1073 | +#ifdef EGG_SSL_EXT | |
6e8c346a AG |
1074 | + ((socklist[i].ssl)&&(SSL_pending(socklist[i].ssl))) || |
1075 | +#endif | |
e3a05f4b AG |
1076 | ((socklist[i].sock == STDOUT) && (!backgrd) && |
1077 | (FD_ISSET(STDIN, &fd))))) { | |
1078 | if (socklist[i].flags & (SOCK_LISTEN | SOCK_CONNECT)) { | |
6e8c346a | 1079 | @@ -663,7 +812,31 @@ |
e3a05f4b AG |
1080 | if ((socklist[i].sock == STDOUT) && !backgrd) |
1081 | x = read(STDIN, s, grab); | |
1082 | else | |
1083 | +#ifdef EGG_SSL_EXT | |
1084 | + { | |
1085 | + if (socklist[i].ssl) { | |
1086 | + x=SSL_read(socklist[i].ssl,s,grab); | |
1087 | + if (x < 0) { | |
1088 | + int err = SSL_get_error(socklist[i].ssl, x); | |
1089 | + x = -1; | |
1090 | + switch (err) { | |
1091 | + case SSL_ERROR_WANT_READ: | |
1092 | + errno = EAGAIN; | |
1093 | + break; | |
1094 | + case SSL_ERROR_WANT_WRITE: | |
1095 | + errno = EAGAIN; | |
1096 | + break; | |
1097 | + case SSL_ERROR_WANT_X509_LOOKUP: | |
1098 | + errno = EAGAIN; | |
1099 | + break; | |
1100 | + } | |
1101 | + } | |
1102 | + } else | |
1103 | x = read(socklist[i].sock, s, grab); | |
1104 | + } | |
1105 | +#else | |
1106 | + x = read(socklist[i].sock, s, grab); | |
6e8c346a | 1107 | +#endif |
e3a05f4b AG |
1108 | if (x <= 0) { /* eof */ |
1109 | if (errno != EAGAIN) { /* EAGAIN happens when the operation would | |
1110 | * block on a non-blocking socket, if the | |
6e8c346a | 1111 | @@ -956,6 +1129,26 @@ |
e3a05f4b AG |
1112 | socklist[i].outbuflen += len; |
1113 | return; | |
1114 | } | |
1115 | +#ifdef EGG_SSL_EXT | |
1116 | + if (socklist[i].ssl) { | |
1117 | + x=SSL_write(socklist[i].ssl,s,len); | |
1118 | + if (x < 0) { | |
1119 | + int err = SSL_get_error(socklist[i].ssl, x); | |
1120 | + x = -1; | |
1121 | + switch (err) { | |
1122 | + case SSL_ERROR_WANT_READ: | |
6e8c346a | 1123 | + errno = EAGAIN; |
e3a05f4b AG |
1124 | + break; |
1125 | + case SSL_ERROR_WANT_WRITE: | |
1126 | + errno = EAGAIN; | |
1127 | + break; | |
1128 | + case SSL_ERROR_WANT_X509_LOOKUP: | |
1129 | + errno = EAGAIN; | |
1130 | + break; | |
1131 | + } | |
6e8c346a | 1132 | + } |
e3a05f4b | 1133 | + } else |
6e8c346a | 1134 | +#endif |
e3a05f4b AG |
1135 | /* Try. */ |
1136 | x = write(z, s, len); | |
1137 | if (x == -1) | |
6e8c346a | 1138 | @@ -1022,6 +1215,27 @@ |
e3a05f4b AG |
1139 | (socklist[i].outbuf != NULL) && (FD_ISSET(socklist[i].sock, &wfds))) { |
1140 | /* Trick tputs into doing the work */ | |
1141 | errno = 0; | |
1142 | +#ifdef EGG_SSL_EXT | |
6e8c346a | 1143 | + if (socklist[i].ssl) { |
e3a05f4b AG |
1144 | + x = write(socklist[i].sock, socklist[i].outbuf, |
1145 | + socklist[i].outbuflen); | |
1146 | + if (x < 0) { | |
1147 | + int err = SSL_get_error(socklist[i].ssl, x); | |
1148 | + x = -1; | |
1149 | + switch (err) { | |
1150 | + case SSL_ERROR_WANT_READ: | |
1151 | + errno = EAGAIN; | |
1152 | + break; | |
1153 | + case SSL_ERROR_WANT_WRITE: | |
1154 | + errno = EAGAIN; | |
1155 | + break; | |
1156 | + case SSL_ERROR_WANT_X509_LOOKUP: | |
1157 | + errno = EAGAIN; | |
1158 | + break; | |
1159 | + } | |
1160 | + } | |
1161 | + } else | |
6e8c346a | 1162 | +#endif |
e3a05f4b AG |
1163 | x = write(socklist[i].sock, socklist[i].outbuf, socklist[i].outbuflen); |
1164 | if ((x < 0) && (errno != EAGAIN) | |
1165 | #ifdef EBADSLT | |
6e8c346a AG |
1166 | diff -burN eggdrop1.6.17.orig/src/net.h eggdrop1.6.17/src/net.h |
1167 | --- eggdrop1.6.17.orig/src/net.h 1970-01-01 01:00:00.000000000 +0100 | |
1168 | +++ eggdrop1.6.17/src/net.h 2004-11-01 14:41:52.045127544 +0100 | |
e3a05f4b AG |
1169 | @@ -0,0 +1,30 @@ |
1170 | +#ifndef _EGG_NET_H | |
1171 | +#define _EGG_NET_H | |
1172 | +#ifdef EGG_SSL_EXT | |
1173 | +# ifndef EGG_SSL_INCS | |
1174 | +# include <openssl/ssl.h> | |
1175 | +# include <openssl/err.h> | |
1176 | +# include <openssl/rand.h> | |
1177 | +# define EGG_SSL_INCS 1 | |
1178 | +# endif | |
1179 | +#endif | |
1180 | + | |
1181 | +/* This is used by the net module to keep track of sockets and what's | |
1182 | + * queued on them | |
1183 | + */ | |
1184 | +typedef struct { | |
1185 | + int sock; | |
1186 | +#ifdef EGG_SSL_EXT | |
6e8c346a | 1187 | + SSL *ssl; |
e3a05f4b AG |
1188 | +#endif |
1189 | + short flags; | |
1190 | + char *inbuf; | |
1191 | + char *outbuf; | |
1192 | + unsigned long outbuflen; /* Outbuf could be binary data */ | |
1193 | + unsigned long inbuflen; /* Inbuf could be binary data */ | |
1194 | +#ifdef USE_IPV6 | |
1195 | + unsigned int af; | |
1196 | +#endif /* USE_IPV6 */ | |
1197 | +} sock_list; | |
1198 | + | |
1199 | +#endif /* _EGG_NET_H */ | |
6e8c346a AG |
1200 | diff -burN eggdrop1.6.17.orig/src/patch.h eggdrop1.6.17/src/patch.h |
1201 | --- eggdrop1.6.17.orig/src/patch.h 2004-11-01 14:40:44.074460656 +0100 | |
1202 | +++ eggdrop1.6.17/src/patch.h 2004-11-01 14:42:19.178002720 +0100 | |
1203 | @@ -46,7 +46,9 @@ | |
1204 | * | |
1205 | * | |
e3a05f4b | 1206 | */ |
6e8c346a | 1207 | -/* PATCH GOES HERE */ |
e3a05f4b AG |
1208 | +#ifdef EGG_SSL_EXT |
1209 | +patch("SSL"); | |
1210 | +#endif | |
1211 | /* | |
1212 | * | |
1213 | * | |
6e8c346a AG |
1214 | diff -burN eggdrop1.6.17.orig/src/tcl.c eggdrop1.6.17/src/tcl.c |
1215 | --- eggdrop1.6.17.orig/src/tcl.c 2004-11-01 14:40:44.052464000 +0100 | |
1216 | +++ eggdrop1.6.17/src/tcl.c 2004-11-01 14:41:52.049126936 +0100 | |
1217 | @@ -45,6 +45,10 @@ | |
e3a05f4b AG |
1218 | |
1219 | extern time_t online_since; | |
e3a05f4b | 1220 | |
6e8c346a AG |
1221 | +#ifdef EGG_SSL_EXT\r |
1222 | +extern int use_ssl; /* kyotou */\r | |
1223 | +#endif | |
1224 | + | |
e3a05f4b AG |
1225 | extern char origbotname[], botuser[], motdfile[], admin[], userfile[], |
1226 | firewall[], helpdir[], notify_new[], hostname[], myip[], moddir[], | |
6e8c346a AG |
1227 | tempdir[], owner[], network[], botnetnick[], bannerfile[], |
1228 | @@ -524,6 +528,9 @@ | |
e3a05f4b AG |
1229 | {"enable-simul", &enable_simul, 0}, /* compat */ |
1230 | {"debug-output", &debug_output, 0}, /* compat */ | |
1231 | {"use-console-r", &use_console_r, 0}, /* compat */ | |
6e8c346a AG |
1232 | +#ifdef EGG_SSL_EXT\r |
1233 | + {"use-ssl", &use_ssl, 0}, /* kyotou */\r | |
e3a05f4b AG |
1234 | +#endif |
1235 | {NULL, NULL, 0} | |
1236 | }; | |
1237 | ||
6e8c346a AG |
1238 | diff -burN eggdrop1.6.17.orig/src/tclmisc.c eggdrop1.6.17/src/tclmisc.c |
1239 | --- eggdrop1.6.17.orig/src/tclmisc.c 2004-11-01 14:40:44.070461264 +0100 | |
1240 | +++ eggdrop1.6.17/src/tclmisc.c 2004-11-01 14:41:52.089120856 +0100 | |
e3a05f4b AG |
1241 | @@ -26,7 +26,13 @@ |
1242 | #include "main.h" | |
1243 | #include "modules.h" | |
1244 | #include "tandem.h" | |
6e8c346a AG |
1245 | -#include "md5/md5.h" |
1246 | +\r | |
1247 | +#ifndef EGG_SSL_EXT\r | |
1248 | + #include "md5/md5.h"\r | |
1249 | +#else\r | |
1250 | +#include "openssl/md5.h"\r | |
1251 | +#endif\r | |
e3a05f4b | 1252 | + |
6e8c346a | 1253 | |
e3a05f4b | 1254 | #ifdef TIME_WITH_SYS_TIME |
6e8c346a | 1255 | # include <sys/time.h> |