Changeset 4596

Show
Ignore:
Timestamp:
02/13/07 13:10:26 (2 years ago)
Author:
morris
Message:

Add basic p7 negotiation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/branches/p7/config.h.in

    r4519 r4596  
    77#undef HAVE_INTTYPES_H 
    88 
     9/* Define to 1 if you have the <libxml/parser.h> header file. */ 
     10#undef HAVE_LIBXML_PARSER_H 
     11 
    912/* Define to 1 if you have the <memory.h> header file. */ 
    1013#undef HAVE_MEMORY_H 
     
    1215/* Define to 1 if you have the <openssl/sha.h> header file. */ 
    1316#undef HAVE_OPENSSL_SHA_H 
    14  
    15 /* Define to 1 if you have the <openssl/ssl.h> header file. */ 
    16 #undef HAVE_OPENSSL_SSL_H 
    1717 
    1818/* Define to 1 if you have the <pthread.h> header file. */ 
     
    3939/* Define to 1 if you have the <unistd.h> header file. */ 
    4040#undef HAVE_UNISTD_H 
     41 
     42/* Define to 1 if you have the <zlib.h> header file. */ 
     43#undef HAVE_ZLIB_H 
    4144 
    4245/* Define to the address where bug reports for this package should be sent. */ 
  • wired/branches/p7/configure

    r4532 r4596  
    13881388 
    13891389 
     1390 
     1391 
     1392 
     1393 
     1394 
     1395 
     1396 
     1397 
     1398 
    13901399# Get host 
    13911400ac_aux_dir= 
     
    31473156        fi 
    31483157 
    3149         if test -d /usr/local/ssl/include; then 
    3150                 CPPFLAGS="$CPPFLAGS -I/usr/local/ssl/include" 
    3151         fi 
    3152  
    3153         if test -d /usr/kerberos/include; then 
    3154                 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" 
    3155         fi 
    3156  
    31573158 
    31583159        if test -d /usr/local/lib; then 
    31593160                LDFLAGS="$LDFLAGS -L/usr/local/lib" 
    3160         fi 
    3161  
    3162         if test -d /usr/local/ssl/lib; then 
    3163                 LDFLAGS="$LDFLAGS -L/usr/local/ssl/lib" 
    31643161        fi 
    31653162 
     
    43434340done 
    43444341 
     4342 
     4343 
     4344 
     4345        if test "$_wi_ssl_paths_added" != yes ; then 
     4346                if test -d /usr/local/ssl/include; then 
     4347                        CPPFLAGS="$CPPFLAGS -I/usr/local/ssl/include" 
     4348                fi 
     4349 
     4350                if test -d /usr/kerberos/include; then 
     4351                        CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" 
     4352                fi 
     4353 
     4354                if test -d /usr/local/ssl/lib; then 
     4355                        LDFLAGS="$LDFLAGS -L/usr/local/ssl/lib" 
     4356                fi 
     4357        fi 
     4358 
     4359        _wi_ssl_paths_added=yes 
    43454360 
    43464361 
     
    45994614 
    46004615 
    4601  
    4602  
    4603 for ac_header in openssl/ssl.h 
     4616#WI_INCLUDE_SSL_LIBRARY 
     4617 
     4618        if test -d /usr/include/libxml2; then 
     4619                CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2" 
     4620        fi 
     4621 
     4622        if test -d /usr/local/include/libxml2; then 
     4623                CPPFLAGS="$CPPFLAGS -I/usr/local/include/libxml2" 
     4624        fi 
     4625 
     4626 
     4627for ac_header in libxml/parser.h 
    46044628do 
    46054629as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     
    47464770_ACEOF 
    47474771 
    4748                 echo "$as_me:$LINENO: checking for SSL_library_init in -lssl" >&5 
    4749 echo $ECHO_N "checking for SSL_library_init in -lssl... $ECHO_C" >&6 
    4750 if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then 
     4772                echo "$as_me:$LINENO: checking for xmlParseFile in -lxml2" >&5 
     4773echo $ECHO_N "checking for xmlParseFile in -lxml2... $ECHO_C" >&6 
     4774if test "${ac_cv_lib_xml2_xmlParseFile+set}" = set; then 
    47514775  echo $ECHO_N "(cached) $ECHO_C" >&6 
    47524776else 
    47534777  ac_check_lib_save_LIBS=$LIBS 
    4754 LIBS="-lssl  $LIBS" 
     4778LIBS="-lxml2  $LIBS" 
    47554779cat >conftest.$ac_ext <<_ACEOF 
    47564780/* confdefs.h.  */ 
     
    47664790/* We use char because int might match the return type of a gcc2 
    47674791   builtin and then its argument prototype would still apply.  */ 
    4768 char SSL_library_init (); 
     4792char xmlParseFile (); 
    47694793int 
    47704794main () 
    47714795{ 
    4772 SSL_library_init (); 
     4796xmlParseFile (); 
    47734797  ; 
    47744798  return 0; 
     
    47974821  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    47984822  (exit $ac_status); }; }; then 
    4799   ac_cv_lib_ssl_SSL_library_init=yes 
     4823  ac_cv_lib_xml2_xmlParseFile=yes 
    48004824else 
    48014825  echo "$as_me: failed program was:" >&5 
    48024826sed 's/^/| /' conftest.$ac_ext >&5 
    48034827 
    4804 ac_cv_lib_ssl_SSL_library_init=no 
     4828ac_cv_lib_xml2_xmlParseFile=no 
    48054829fi 
    48064830rm -f conftest.err conftest.$ac_objext \ 
     
    48084832LIBS=$ac_check_lib_save_LIBS 
    48094833fi 
    4810 echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_library_init" >&5 
    4811 echo "${ECHO_T}$ac_cv_lib_ssl_SSL_library_init" >&6 
    4812 if test $ac_cv_lib_ssl_SSL_library_init = yes; then 
    4813  
    4814                         LIBS="$LIBS -lssl
    4815  
    4816 else 
    4817  
    4818  
    4819         { { echo "$as_me:$LINENO: error: could not locate OpenSSL 
    4820  
    4821 If you installed OpenSSL into a non-standard directory, please run: 
     4834echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlParseFile" >&5 
     4835echo "${ECHO_T}$ac_cv_lib_xml2_xmlParseFile" >&6 
     4836if test $ac_cv_lib_xml2_xmlParseFile = yes; then 
     4837 
     4838                        LIBS="$LIBS -lxml2
     4839 
     4840else 
     4841 
     4842 
     4843        { { echo "$as_me:$LINENO: error: could not locate libxml2 
     4844 
     4845If you installed libxml2 into a non-standard directory, please run: 
    48224846 
    48234847    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&5 
    4824 echo "$as_me: error: could not locate OpenSSL 
    4825  
    4826 If you installed OpenSSL into a non-standard directory, please run: 
     4848echo "$as_me: error: could not locate libxml2 
     4849 
     4850If you installed libxml2 into a non-standard directory, please run: 
    48274851 
    48284852    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&2;} 
     
    48364860 
    48374861 
    4838         { { echo "$as_me:$LINENO: error: could not locate OpenSSL 
    4839  
    4840 If you installed OpenSSL into a non-standard directory, please run: 
     4862        { { echo "$as_me:$LINENO: error: could not locate libxml2 
     4863 
     4864If you installed libxml2 into a non-standard directory, please run: 
    48414865 
    48424866    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&5 
    4843 echo "$as_me: error: could not locate OpenSSL 
    4844  
    4845 If you installed OpenSSL into a non-standard directory, please run: 
     4867echo "$as_me: error: could not locate libxml2 
     4868 
     4869If you installed libxml2 into a non-standard directory, please run: 
    48464870 
    48474871    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&2;} 
     
    48564880 
    48574881 
    4858 for ac_header in CoreServices/CoreServices.h 
     4882for ac_header in zlib.h 
    48594883do 
    48604884as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     
    50015025_ACEOF 
    50025026 
    5003                 LIBS="$LIBS -framework CoreServices -framework Carbon" 
     5027                echo "$as_me:$LINENO: checking for deflate in -lz" >&5 
     5028echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 
     5029if test "${ac_cv_lib_z_deflate+set}" = set; then 
     5030  echo $ECHO_N "(cached) $ECHO_C" >&6 
     5031else 
     5032  ac_check_lib_save_LIBS=$LIBS 
     5033LIBS="-lz  $LIBS" 
     5034cat >conftest.$ac_ext <<_ACEOF 
     5035/* confdefs.h.  */ 
     5036_ACEOF 
     5037cat confdefs.h >>conftest.$ac_ext 
     5038cat >>conftest.$ac_ext <<_ACEOF 
     5039/* end confdefs.h.  */ 
     5040 
     5041/* Override any gcc2 internal prototype to avoid an error.  */ 
     5042#ifdef __cplusplus 
     5043extern "C" 
     5044#endif 
     5045/* We use char because int might match the return type of a gcc2 
     5046   builtin and then its argument prototype would still apply.  */ 
     5047char deflate (); 
     5048int 
     5049main () 
     5050
     5051deflate (); 
     5052  ; 
     5053  return 0; 
     5054
     5055_ACEOF 
     5056rm -f conftest.$ac_objext conftest$ac_exeext 
     5057if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     5058  (eval $ac_link) 2>conftest.er1 
     5059  ac_status=$? 
     5060  grep -v '^ *+' conftest.er1 >conftest.err 
     5061  rm -f conftest.er1 
     5062  cat conftest.err >&5 
     5063  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     5064  (exit $ac_status); } && 
     5065         { ac_try='test -z "$ac_c_werror_flag" 
     5066                         || test ! -s conftest.err' 
     5067  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     5068  (eval $ac_try) 2>&5 
     5069  ac_status=$? 
     5070  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     5071  (exit $ac_status); }; } && 
     5072         { ac_try='test -s conftest$ac_exeext' 
     5073  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     5074  (eval $ac_try) 2>&5 
     5075  ac_status=$? 
     5076  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     5077  (exit $ac_status); }; }; then 
     5078  ac_cv_lib_z_deflate=yes 
     5079else 
     5080  echo "$as_me: failed program was:" >&5 
     5081sed 's/^/| /' conftest.$ac_ext >&5 
     5082 
     5083ac_cv_lib_z_deflate=no 
     5084fi 
     5085rm -f conftest.err conftest.$ac_objext \ 
     5086      conftest$ac_exeext conftest.$ac_ext 
     5087LIBS=$ac_check_lib_save_LIBS 
     5088fi 
     5089echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 
     5090echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 
     5091if test $ac_cv_lib_z_deflate = yes; then 
     5092 
     5093                        LIBS="$LIBS -lz" 
     5094 
     5095else 
     5096 
     5097 
     5098        { { echo "$as_me:$LINENO: error: could not locate zlib 
     5099 
     5100If you installed zlib into a non-standard directory, please run: 
     5101 
     5102    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&5 
     5103echo "$as_me: error: could not locate zlib 
     5104 
     5105If you installed zlib into a non-standard directory, please run: 
     5106 
     5107    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&2;} 
     5108   { (exit 1); exit 1; }; } 
     5109 
     5110 
     5111fi 
     5112 
     5113 
     5114else 
     5115 
     5116 
     5117        { { echo "$as_me:$LINENO: error: could not locate zlib 
     5118 
     5119If you installed zlib into a non-standard directory, please run: 
     5120 
     5121    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&5 
     5122echo "$as_me: error: could not locate zlib 
     5123 
     5124If you installed zlib into a non-standard directory, please run: 
     5125 
     5126    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&2;} 
     5127   { (exit 1); exit 1; }; } 
     5128 
    50045129 
    50055130fi 
     
    50095134 
    50105135 
    5011         case $host in 
    5012                 *-solaris*) 
    5013  
    5014 cat >>confdefs.h <<\_ACEOF 
    5015 #define _POSIX_PTHREAD_SEMANTICS 
    5016 _ACEOF 
    5017  
    5018                         ;; 
    5019         esac 
    5020  
    5021  
    5022 for ac_header in pthread.h 
     5136 
     5137for ac_header in CoreServices/CoreServices.h 
    50235138do 
    50245139as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     
    51655280_ACEOF 
    51665281 
     5282                LIBS="$LIBS -framework CoreServices -framework Carbon" 
     5283 
     5284fi 
     5285 
     5286done 
     5287 
     5288 
     5289 
     5290        case $host in 
     5291                *-solaris*) 
     5292 
     5293cat >>confdefs.h <<\_ACEOF 
     5294#define _POSIX_PTHREAD_SEMANTICS 
     5295_ACEOF 
     5296 
     5297                        ;; 
     5298        esac 
     5299 
     5300 
     5301for ac_header in pthread.h 
     5302do 
     5303as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     5304if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     5305  echo "$as_me:$LINENO: checking for $ac_header" >&5 
     5306echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 
     5307if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     5308  echo $ECHO_N "(cached) $ECHO_C" >&6 
     5309fi 
     5310echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 
     5311echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 
     5312else 
     5313  # Is the header compilable? 
     5314echo "$as_me:$LINENO: checking $ac_header usability" >&5 
     5315echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 
     5316cat >conftest.$ac_ext <<_ACEOF 
     5317/* confdefs.h.  */ 
     5318_ACEOF 
     5319cat confdefs.h >>conftest.$ac_ext 
     5320cat >>conftest.$ac_ext <<_ACEOF 
     5321/* end confdefs.h.  */ 
     5322$ac_includes_default 
     5323#include <$ac_header> 
     5324_ACEOF 
     5325rm -f conftest.$ac_objext 
     5326if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 
     5327  (eval $ac_compile) 2>conftest.er1 
     5328  ac_status=$? 
     5329  grep -v '^ *+' conftest.er1 >conftest.err 
     5330  rm -f conftest.er1 
     5331  cat conftest.err >&5 
     5332  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     5333  (exit $ac_status); } && 
     5334         { ac_try='test -z "$ac_c_werror_flag" 
     5335                         || test ! -s conftest.err' 
     5336  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     5337  (eval $ac_try) 2>&5 
     5338  ac_status=$? 
     5339  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     5340  (exit $ac_status); }; } && 
     5341         { ac_try='test -s conftest.$ac_objext' 
     5342  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     5343  (eval $ac_try) 2>&5 
     5344  ac_status=$? 
     5345  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     5346  (exit $ac_status); }; }; then 
     5347  ac_header_compiler=yes 
     5348else 
     5349  echo "$as_me: failed program was:" >&5 
     5350sed 's/^/| /' conftest.$ac_ext >&5 
     5351 
     5352ac_header_compiler=no 
     5353fi 
     5354rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 
     5355echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     5356echo "${ECHO_T}$ac_header_compiler" >&6 
     5357 
     5358# Is the header present? 
     5359echo "$as_me:$LINENO: checking $ac_header presence" >&5 
     5360echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 
     5361cat >conftest.$ac_ext <<_ACEOF 
     5362/* confdefs.h.  */ 
     5363_ACEOF 
     5364cat confdefs.h >>conftest.$ac_ext 
     5365cat >>conftest.$ac_ext <<_ACEOF 
     5366/* end confdefs.h.  */ 
     5367#include <$ac_header> 
     5368_ACEOF 
     5369if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 
     5370  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 
     5371  ac_status=$? 
     5372  grep -v '^ *+' conftest.er1 >conftest.err 
     5373  rm -f conftest.er1 
     5374  cat conftest.err >&5 
     5375  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     5376  (exit $ac_status); } >/dev/null; then 
     5377  if test -s conftest.err; then 
     5378    ac_cpp_err=$ac_c_preproc_warn_flag 
     5379    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag 
     5380  else 
     5381    ac_cpp_err= 
     5382  fi 
     5383else 
     5384  ac_cpp_err=yes 
     5385fi 
     5386if test -z "$ac_cpp_err"; then 
     5387  ac_header_preproc=yes 
     5388else 
     5389  echo "$as_me: failed program was:" >&5 
     5390sed 's/^/| /' conftest.$ac_ext >&5 
     5391 
     5392  ac_header_preproc=no 
     5393fi 
     5394rm -f conftest.err conftest.$ac_ext 
     5395echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     5396echo "${ECHO_T}$ac_header_preproc" >&6 
     5397 
     5398# So?  What about this header? 
     5399case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 
     5400  yes:no: ) 
     5401    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 
     5402echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     5403    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 
     5404echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} 
     5405    ac_header_preproc=yes 
     5406    ;; 
     5407  no:yes:* ) 
     5408    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 
     5409echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} 
     5410    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5 
     5411echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;} 
     5412    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 
     5413echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} 
     5414    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5 
     5415echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;} 
     5416    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 
     5417echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} 
     5418    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 
     5419echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} 
     5420    ( 
     5421      cat <<\_ASBOX 
     5422## ------------------------------------- ## 
     5423## Report this to axel@zankasoftware.com ## 
     5424## ------------------------------------- ## 
     5425_ASBOX 
     5426    ) | 
     5427      sed "s/^/$as_me: WARNING:     /" >&2 
     5428    ;; 
     5429esac 
     5430echo "$as_me:$LINENO: checking for $ac_header" >&5 
     5431echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 
     5432if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     5433  echo $ECHO_N "(cached) $ECHO_C" >&6 
     5434else 
     5435  eval "$as_ac_Header=\$ac_header_preproc" 
     5436fi 
     5437echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 
     5438echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 
     5439 
     5440fi 
     5441if test `eval echo '${'$as_ac_Header'}'` = yes; then 
     5442  cat >>confdefs.h <<_ACEOF 
     5443#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 
     5444_ACEOF 
     5445 
    51675446                echo "$as_me:$LINENO: checking for pthreads" >&5 
    51685447echo $ECHO_N "checking for pthreads... $ECHO_C" >&6 
     
    59946273 
    59956274if test "$wd_libwired"; then 
    5996         ac_configure_args="$ac_configure_args --enable-ssl --enable-pthreads --with-rundir=$wd_libwired_rundir --with-objdir=$wd_libwired_objdir" 
     6275        ac_configure_args="$ac_configure_args --enable-pthreads --enable-p7 --with-rundir=$wd_libwired_rundir --with-objdir=$wd_libwired_objdir" 
    59976276 
    59986277 
  • wired/branches/p7/configure.in

    r4519 r4596  
    174174WI_INCLUDE_RESOLV_LIBRARY 
    175175WI_INCLUDE_CRYPTO_LIBRARY 
    176 WI_INCLUDE_SSL_LIBRARY 
     176#WI_INCLUDE_SSL_LIBRARY 
     177WI_INCLUDE_LIBXML2_LIBRARY 
     178WI_INCLUDE_ZLIB_LIBRARY 
    177179WI_INCLUDE_CORESERVICES_FRAMEWORK 
    178180WI_INCLUDE_PTHREADS 
     
    200202 
    201203if test "$wd_libwired"; then 
    202         ac_configure_args="$ac_configure_args --enable-ssl --enable-pthreads --with-rundir=$wd_libwired_rundir --with-objdir=$wd_libwired_objdir" 
     204        ac_configure_args="$ac_configure_args --enable-pthreads --enable-p7 --with-rundir=$wd_libwired_rundir --with-objdir=$wd_libwired_objdir" 
    203205        AC_CONFIG_SUBDIRS([libwired]) 
    204206fi 
  • wired/branches/p7/wired/accounts.c

    r4508 r4596  
    4848 
    4949 
     50static wi_string_t *                            _wd_accounts_password_provider(wi_string_t *); 
     51 
    5052static wi_boolean_t                                     _wd_accounts_delete_from_file(wi_file_t *, wi_string_t *); 
    5153static void                                                     _wd_accounts_reload_user(wi_string_t *); 
     
    7678        wd_users_lock = wi_lock_init(wi_lock_alloc()); 
    7779        wd_groups_lock = wi_lock_init(wi_lock_alloc()); 
     80         
     81        wi_p7_socket_password_provider = _wd_accounts_password_provider; 
    7882} 
    7983 
     
    521525#pragma mark - 
    522526 
     527static wi_string_t * _wd_accounts_password_provider(wi_string_t *username) { 
     528        wd_account_t    *account; 
     529         
     530        account = wd_accounts_read_user(username); 
     531         
     532        if(!account) 
     533                return NULL; 
     534         
     535        if(wi_string_length(account->password) == 0) 
     536                return wi_string_sha1(account->password); 
     537         
     538        return account->password; 
     539} 
     540 
     541 
     542 
     543#pragma mark - 
     544 
    523545static wi_boolean_t _wd_accounts_delete_from_file(wi_file_t *file, wi_string_t *name) { 
    524546        wi_file_t               *tmpfile; 
  • wired/branches/p7/wired/clients.c

    r4576 r4596  
    166166 
    167167 
    168 wd_client_t * wd_client_init_with_socket(wd_client_t *client, wi_socket_t *socket) { 
     168wd_client_t * wd_client_init_with_socket(wd_client_t *client, wi_p7_socket_t *p7_socket) { 
    169169        wi_address_t    *address; 
    170170 
    171171        client->uid                             = wd_client_uid(); 
    172         client->socket                  = wi_retain(socket); 
     172        client->socket                  = wi_retain(wi_p7_socket_socket(p7_socket)); 
     173        client->p7_socket               = wi_retain(p7_socket); 
    173174        client->state                   = WD_CLIENT_STATE_CONNECTED; 
    174175        client->login_time              = wi_time_interval(); 
    175176        client->idle_time               = client->idle_time; 
    176177         
    177         address                                 = wi_socket_address(socket); 
     178        address                                 = wi_socket_address(client->socket); 
    178179        client->ip                              = wi_retain(wi_address_string(address)); 
    179180        client->host                    = wi_retain(wi_address_hostname(address)); 
     
    193194         
    194195        wi_release(client->socket); 
     196        wi_release(client->p7_socket); 
    195197         
    196198        wi_release(client->account); 
  • wired/branches/p7/wired/clients.h

    r4508 r4596  
    5757        wi_lock_t                                                       *socket_lock; 
    5858        wi_socket_t                                                     *socket; 
     59        wi_p7_socket_t                                          *p7_socket; 
    5960         
    6061        wi_lock_t                                                       *flag_lock; 
     
    9596 
    9697wd_client_t *                                                   wd_client_alloc(void); 
    97 wd_client_t *                                                   wd_client_init_with_socket(wd_client_t *, wi_socket_t *); 
     98wd_client_t *                                                   wd_client_init_with_socket(wd_client_t *, wi_p7_socket_t *); 
    9899 
    99100void                                                                    wd_client_lock_socket(wd_client_t *); 
  • wired/branches/p7/wired/server.c

    r4568 r4596  
    3636#include <wired/wired.h> 
    3737 
     38#include <openssl/rsa.h> 
     39#include <openssl/pem.h> 
     40#include <openssl/err.h> 
     41 
    3842#include "accounts.h" 
    3943#include "banlist.h" 
     
    6165static wi_socket_context_t                      *wd_transfer_socket_context; 
    6266 
     67static wi_p7_spec_t                                     *wd_p7_spec; 
     68static EVP_PKEY                                         *wd_p7_pkey; 
     69 
    6370wi_string_t                                                     *wd_banner; 
    6471 
     
    7178        wi_string_t                             *ip, *string; 
    7279        wi_address_family_t             family; 
    73  
     80         
    7481        wd_control_sockets      = wi_array_init(wi_array_alloc()); 
    7582        wd_transfer_sockets     = wi_array_init(wi_array_alloc()); 
     
    175182        wi_string_t             *string; 
    176183        wi_data_t               *data; 
     184 
     185        /* load protocol spec */ 
     186        if(!wd_p7_spec) { 
     187                wd_p7_spec = wi_p7_spec_init_with_file(wi_p7_spec_alloc(), WI_STR("protocol.xml"), true); 
     188     
     189                if(!wd_p7_spec) 
     190                        wi_log_err(WI_STR("Could not load protocol.xml: %m")); 
     191        } 
    177192 
    178193        /* reload banner */ 
     
    208223 
    209224        /* set SSL cipher list */ 
    210       if(wd_settings.controlcipher) { 
     225/*    if(wd_settings.controlcipher) { 
    211226                if(!wi_socket_context_set_ssl_ciphers(wd_control_socket_context, wd_settings.controlcipher)) { 
    212227                        wi_log_err(WI_STR("Could not set SSL cipher list \"%@\": %m"), 
     
    220235                                wd_settings.transfercipher); 
    221236           } 
    222         } 
     237        }*/ 
    223238 
    224239        /* load SSL certificate */ 
    225       if(wd_settings.certificate) { 
     240/*    if(wd_settings.certificate) { 
    226241                if(!wi_socket_context_set_ssl_certificate(wd_control_socket_context, wd_settings.certificate) || 
    227242                   !wi_socket_context_set_ssl_certificate(wd_transfer_socket_context, wd_settings.certificate)) { 
     
    229244                                wd_settings.certificate); 
    230245                } 
    231         } 
     246        }*/ 
    232247} 
    233248 
     
    237252 
    238253void wd_ssl_init(void) { 
    239       unsigned char   dh1024_p[] = { 
     254/*    unsigned char   dh1024_p[] = { 
    240255                0xBC,0xBB,0x2B,0x4F,0x58,0x58,0x9C,0x4D,0x46,0x0D,0xBB,0x9E, 
    241256                0x4D,0x85,0x69,0x56,0x43,0x5E,0xFB,0xC8,0xF6,0xC0,0xAC,0x8E, 
     
    260275        if(!wi_socket_context_set_ssl_dh(wd_control_socket_context, dh1024_p, sizeof(dh1024_p), dh1024_g, sizeof(dh1024_g)) || 
    261276           !wi_socket_context_set_ssl_dh(wd_transfer_socket_context, dh1024_p, sizeof(dh1024_p), dh1024_g, sizeof(dh1024_g))) 
    262                 wi_log_err(WI_STR("Could not set anonymous DH key: %m")); 
     277                wi_log_err(WI_STR("Could not set anonymous DH key: %m"));*/ 
     278         
     279         
     280         
     281         
     282        RSA         *rsa; 
     283        FILE        *fp; 
     284         
     285        fp = fopen("key", "r"); 
     286         
     287        if(!fp) 
     288                wi_log_err(WI_STR("fopen(): key: %s"), strerror(errno)); 
     289         
     290        ERR_load_crypto_strings(); 
     291         
     292        rsa = PEM_read_RSAPrivateKey(fp, NULL, NULL, NULL); 
     293         
     294        if(!rsa) 
     295                wi_log_err(WI_STR("PEM_read_RSAPublicKey(): %s"), ERR_reason_error_string(ERR_get_error())); 
     296         
     297        wd_p7_pkey = EVP_PKEY_new(); 
     298        EVP_PKEY_assign_RSA(wd_p7_pkey, rsa); 
    263299} 
    264300 
     
    270306        wi_pool_t                       *pool; 
    271307        wi_socket_t                     *socket; 
     308        wi_p7_socket_t          *p7_socket; 
    272309        wi_address_t            *address; 
    273310        wi_string_t                     *ip; 
     
    297334                wi_socket_set_direction(socket, WI_SOCKET_READ); 
    298335                 
     336                p7_socket = wi_autorelease(wi_p7_socket_init_with_socket(wi_p7_socket_alloc(), socket, wd_p7_spec)); 
     337                wi_p7_socket_set_private_key(p7_socket, wd_p7_pkey); 
     338                 
     339                if(!wi_p7_socket_accept(p7_socket, 10.0, WI_P7_ALL)) { 
     340                        wi_socket_close(socket); 
     341                         
     342                        wi_log_err(WI_STR("Could not accept a connection: %m")); 
     343                         
     344                        goto next; 
     345                } 
     346                 
    299347                wi_log_info(WI_STR("Connect from %@"), ip); 
    300348                 
    301349                /* spawn a client thread */ 
    302                 client = wi_autorelease(wd_client_init_with_socket(wd_client_alloc(), socket)); 
     350                client = wi_autorelease(wd_client_init_with_socket(wd_client_alloc(), p7_socket)); 
    303351 
    304352                if(!wi_thread_create_thread(wd_control_thread, client)) 
  • wired/branches/p7/wired/transfers.c

    r4576 r4596  
    587587 
    588588static void wd_transfer_download(wd_transfer_t *transfer) { 
     589#if 0 
    589590        wi_pool_t                               *pool; 
    590591        SSL                                             *ssl; 
     
    719720         
    720721        wi_release(pool); 
     722#endif 
    721723} 
    722724 
     
    724726 
    725727static void wd_transfer_upload(wd_transfer_t *transfer) { 
     728#if 0 
    726729        wi_pool_t                               *pool; 
    727730        wi_string_t                             *path; 
     
    868871         
    869872        wi_release(pool); 
    870 
     873#endif 
     874