]> git.pld-linux.org Git - packages/eggdrop.git/blob - eggdrop-ssl.patch
- more ru_RU -> ru, uk_UA -> uk changes
[packages/eggdrop.git] / eggdrop-ssl.patch
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  ])
6  
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";
45 +        AC_DEFINE([EGG_SSL_EXT], [], [SSL support])
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)
56 +    AC_CHECK_HEADERS("openssl/ssl.h",,[AC_MSG_ERROR([OpenSSL was not found. Please supply a pathname to OpenSSL])],)
57 +
58 +    AC_SUBST(SSL_LIBS)dnl
59 +    AC_SUBST(SSL_INCLUDE)dnl
60 +])
61 +
62 +#end of ssl checks - hoe (.16 by poci)
63 +])dnl
64 +
65 +
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
75  
76 +/* Defines ssl mode  */
77 +#undef EGG_SSL_EXT
78 +
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"
88  
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=''
92  
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).
99  
100  Some influential environment variables:
101    CC          C compiler command
102 @@ -10100,6 +10101,374 @@
103  
104  
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
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
152 +  (eval $ac_link) 2>conftest.er1
153 +  ac_status=$?
154 +  grep -v '^ *+' conftest.er1 >conftest.err
155 +  rm -f conftest.er1
156 +  cat conftest.err >&5
157 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
158 +  (exit $ac_status); } &&
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'
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
179 +rm -f conftest.err conftest.$ac_objext \
180 +      conftest$ac_exeext conftest.$ac_ext
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
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
268 +  (eval $ac_link) 2>conftest.er1
269 +  ac_status=$?
270 +  grep -v '^ *+' conftest.er1 >conftest.err
271 +  rm -f conftest.er1
272 +  cat conftest.err >&5
273 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
274 +  (exit $ac_status); } &&
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'
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
295 +rm -f conftest.err conftest.$ac_objext \
296 +      conftest$ac_exeext conftest.$ac_ext
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
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
340 +  (eval $ac_compile) 2>conftest.er1
341 +  ac_status=$?
342 +  grep -v '^ *+' conftest.er1 >conftest.err
343 +  rm -f conftest.er1
344 +  cat conftest.err >&5
345 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
346 +  (exit $ac_status); } &&
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'
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
367 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
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
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
392 +    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
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?
412 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
413 +  yes:no: )
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;}
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
419 +    ;;
420 +  no:yes:* )
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;}
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;}
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;}
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;}
433 +    (
434 +      cat <<\_ASBOX
435 +## -------------------------------- ##
436 +## Report this to bugs@eggheads.org ##
437 +## -------------------------------- ##
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
448 +  eval "$as_ac_Header=\$ac_header_preproc"
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 +
471 +#end of ssl checks - hoe (.16 by poci)
472 +
473 +
474  
475  # Substitute Makefile variables.
476  
477 @@ -10811,6 +11180,8 @@
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
484  s,@DESTDIR@,$DESTDIR,;t t
485  s,@MOD_UPDIR@,$MOD_UPDIR,;t t
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
491  EGG_TCL_LUSH
492  
493 +EGG_SSL_CRAP
494 +
495  
496  # Substitute Makefile variables.
497  EGG_SUBST_EGGVERSION
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
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@
532  XREQS = @TCL_REQS@
533 +XSSL_LIBS = @SSL_LIBS@
534 +XSSL_INCLUDE = @SSL_INCLUDE@
535  TCLLIB = @TCLLIB@
536  TCLLIBFN = @TCLLIBFN@
537  
538 @@ -89,7 +91,8 @@
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)' \
542 -'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(standard build)' 'MODOBJS='
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)' \
547  'STRIP=$(SHLIB_STRIP)' 'CFLGS=$(CFLGS)' 'XLIBS=$(XLIBS)' 'MOD_EXT=$(MOD_EXT)' \
548 @@ -99,12 +102,13 @@
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)' \
564 @@ -113,7 +117,8 @@
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)' \
568 -'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(static debug version)' 'MODOBJS=mod/*.o'
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)'
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
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;
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
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;
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 - */
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   */
617 -} sock_list;
618  
619  enum {
620    EGG_OPTION_SET = 1,           /* Set option(s).               */
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 @@
625  int cx_ptr = 0;
626  #endif
627  
628 +#ifdef EGG_SSL_EXT
629 +int clean_net();
630 +#endif
631  
632  void fatal(const char *s, int recoverable)
633  {
634 @@ -171,6 +174,9 @@
635    for (i = 0; i < dcc_total; i++)
636      if (dcc[i].sock >= 0)
637        killsock(dcc[i].sock);
638 +  #ifdef EGG_SSL_EXT
639 +  clean_net();
640 +  #endif
641    unlink(pid_file);
642    if (!recoverable) {
643      bg_send_quit(BG_ABORT);
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  
654  CC = @CC@
655  LD = @CC@
656 @@ -37,7 +39,7 @@
657         @echo "Linking eggdrop $(EGGBUILD)."
658         @echo ""
659         @touch mod/mod.xlibs
660 -       $(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs`
661 +       $(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs` $(XSSL_LIBS) $(XSSL_INCLUDE)
662         $(STRIP) ../$(EGGEXEC)
663         @echo ""
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 @@
669  
670  #include <string.h>
671  
672 +#ifndef EGG_SSL_EXT
673  #include "md5.h"
674 +#else
675 +#include "openssl/md5.h"
676 +#endif
677 +
678  #include "compat/compat.h"
679  
680 +typedef unsigned long MD5_u32plus;
681 +
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
697   * the public domain.  See md5c.c for more information.
698   */
699 +#include "../config.h"
700 +#ifndef EGG_SSL_EXT
701 +
702  
703  #ifndef _MD5_H
704  #define _MD5_H
705 @@ -24,3 +27,4 @@
706  extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
707  
708  #endif
709 +#endif
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 @@
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        }
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 @@
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) {
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
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 *);
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 @@
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 {
762 @@ -1139,7 +1139,7 @@
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':
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 */
779 +#ifdef EGG_SSL_EXT
780 +#define net_switch_to_ssl ((int (*)(int))global[289])
781 +#define use_ssl (*(int *)global[290]) /* kyotou */
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])
795 +#endif
796  
797  /* hostmasking */
798  #define maskhost(a,b) _maskhost((a),(b),1)
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 @@
803        fatal("NO SERVERS WILL ACCEPT MY CONNECTION.", 0);
804    } else {
805      dcc[servidx].sock = serv;
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
814      /* Queue standard login */
815      dcc[servidx].timeval = now;
816      SERVER_SOCKET.timeout_val = &server_timeout;
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 @@
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 +
831  #include "users.h"
832  
833 +#include "net.h"
834 +
835  #ifndef STATIC
836  #  ifdef MOD_USE_SHL
837  #    include <dl.h>
838 @@ -94,6 +102,10 @@
839             password_timeout, force_expire, protect_readonly, reserved_port_min,
840             reserved_port_max, copy_to_tmp, quiet_reject;
841  
842 +#ifdef EGG_SSL_EXT
843 +extern int      use_ssl; /* kyotou */
844 +#endif
845 +
846  extern party_t *party;
847  extern time_t now, online_since;
848  extern tand_t *tandbot;
849 @@ -128,6 +140,10 @@
850  }
851  #endif /* STATIC */
852  
853 +#ifdef EGG_SSL_EXT
854 +int net_switch_to_ssl(int);
855 +#endif
856 +
857  
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 */
864 +#ifdef EGG_SSL_EXT
865    (Function) 0,                   /* IPv6 leftovers: 288                 */
866 +  (Function) net_switch_to_ssl,
867 +  (Function) & use_ssl, /* kyotou */
868 +#else
869 +  (Function) 0,                   /* IPv6 leftovers: 288                 */
870 +#endif
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 @@
878  #  endif
879  #endif
880  
881 +#ifdef EGG_SSL_EXT
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
888 +#endif
889 +
890 +#include "net.h"
891 +
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,
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 -
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
906  sock_list *socklist = NULL;   /* Enough to be safe.                           */
907  int MAXSOCKS = 0;
908  jmp_buf alarmret;             /* Env buffer for alarm() returns.              */
909 @@ -70,6 +86,46 @@
910    return ret;
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;
919 +
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
951 +
952 +
953  /* Initialize the socklist
954   */
955  void init_net()
956 @@ -78,8 +134,34 @@
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
963 +  }
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());
969 +  if (!ssl_ctx)
970 +  fatal("SSL_CTX_new() failed",0);
971 +  if (seed_PRNG())
972 +    fatal("Wasn't able to properly seed the PRNG!",0);
973 +#endif
974 +}
975 +
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;
982    }
983 +  if (tls_rand_file)
984 +       RAND_write_file(tls_rand_file);
985 + return 0;
986  }
987 +#endif
988  
989  int expmem_net()
990  {
991 @@ -289,6 +371,13 @@
992  
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);
998 +           SSL_free(socklist[i].ssl);
999 +           socklist[i].ssl=NULL;
1000 +      }
1001 +#endif
1002        close(socklist[i].sock);
1003        if (socklist[i].inbuf != NULL) {
1004          nfree(socklist[i].inbuf);
1005 @@ -428,6 +517,63 @@
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);
1037 +
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;
1048 +               return 0;
1049 +        }
1050 +        usleep(1000);
1051 +        err = SSL_connect(socklist[i].ssl);
1052 +     }
1053 +
1054 +     if (err==1) {
1055 +      debug0("SSL_connect() success");
1056 +      return 1;
1057 +     }
1058 +     debug0("Error while SSL_connect()");
1059 +     SSL_shutdown(socklist[i].ssl);
1060 +     SSL_free(socklist[i].ssl);
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  {
1069 @@ -639,6 +785,9 @@
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
1074 +                 ((socklist[i].ssl)&&(SSL_pending(socklist[i].ssl))) ||
1075 +#endif
1076            ((socklist[i].sock == STDOUT) && (!backgrd) &&
1077            (FD_ISSET(STDIN, &fd))))) {
1078          if (socklist[i].flags & (SOCK_LISTEN | SOCK_CONNECT)) {
1079 @@ -663,7 +812,31 @@
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);
1107 +#endif
1108          if (x <= 0) {           /* eof */
1109            if (errno != EAGAIN) { /* EAGAIN happens when the operation would
1110                                    * block on a non-blocking socket, if the
1111 @@ -956,6 +1129,26 @@
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:
1123 +                       errno = EAGAIN;
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 +               }
1132 +          }
1133 +      } else
1134 +#endif
1135        /* Try. */
1136        x = write(z, s, len);
1137        if (x == -1)
1138 @@ -1022,6 +1215,27 @@
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
1143 +      if (socklist[i].ssl) {
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
1162 +#endif
1163        x = write(socklist[i].sock, socklist[i].outbuf, socklist[i].outbuflen);
1164        if ((x < 0) && (errno != EAGAIN)
1165  #ifdef EBADSLT
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
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
1187 +  SSL *ssl;
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 */
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   *
1206   */
1207 -/* PATCH GOES HERE */
1208 +#ifdef EGG_SSL_EXT
1209 +patch("SSL");
1210 +#endif
1211  /*
1212   *
1213   *
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 @@
1218  
1219  extern time_t online_since;
1220  
1221 +#ifdef EGG_SSL_EXT\r
1222 +extern int      use_ssl; /* kyotou */\r
1223 +#endif
1224 +
1225  extern char origbotname[], botuser[], motdfile[], admin[], userfile[],
1226              firewall[], helpdir[], notify_new[], hostname[], myip[], moddir[],
1227              tempdir[], owner[], network[], botnetnick[], bannerfile[],
1228 @@ -524,6 +528,9 @@
1229    {"enable-simul",          &enable_simul,         0}, /* compat */
1230    {"debug-output",          &debug_output,         0}, /* compat */
1231    {"use-console-r",         &use_console_r,        0}, /* compat */
1232 +#ifdef EGG_SSL_EXT\r
1233 +  {"use-ssl",                  &use_ssl,               0}, /* kyotou */\r
1234 +#endif
1235    {NULL,                    NULL,                  0}
1236  };
1237  
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
1241 @@ -26,7 +26,13 @@
1242  #include "main.h"
1243  #include "modules.h"
1244  #include "tandem.h"
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
1252 +
1253  
1254  #ifdef TIME_WITH_SYS_TIME
1255  #  include <sys/time.h>
This page took 0.346784 seconds and 3 git commands to generate.