From 9bf8366451b60148699657ed966c0913fbae9465 Mon Sep 17 00:00:00 2001 From: "rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Tue, 17 Oct 2006 20:42:40 +0000 Subject: BUILD : 1.7.17 (1185) BUGS : N/A NOTES : Encryption now offers the choice of none, old and md5 - the md5 module is nicely taken from irc-services and actaully works, yes, real md5, in anope, wow eh? git-svn-id: svn://svn.anope.org/anope/trunk@1185 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@905 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 2 +- Changes.conf | 24 +++ Config | 42 ----- configure | 245 +++++++++++++++---------- configure.in | 5 - data/example.conf | 24 +++ include/encrypt.h | 9 +- include/extern.h | 164 +++++++++-------- include/modules.h | 2 +- include/sysconf.h.in | 6 - include/version.sh | 10 - src/chanserv.c | 20 +- src/config.c | 4 +- src/core/cs_getpass.c | 28 +-- src/core/cs_identify.c | 5 +- src/core/cs_register.c | 25 +-- src/core/cs_sendpass.c | 68 +++---- src/core/cs_set.c | 14 +- src/core/enc_md5.c | 422 ++++++++++++++++++++++++++++++++++++++++++ src/core/enc_none.c | 76 ++++++++ src/core/enc_old.c | 451 +++++++++++++++++++++++++++++++++++++++++++++ src/core/ns_getpass.c | 23 +-- src/core/ns_ghost.c | 2 +- src/core/ns_group.c | 2 +- src/core/ns_identify.c | 2 +- src/core/ns_recover.c | 2 +- src/core/ns_register.c | 28 +-- src/core/ns_release.c | 2 +- src/core/ns_saset.c | 21 +-- src/core/ns_sendpass.c | 66 +++---- src/core/ns_set.c | 17 +- src/core/os_modlist.c | 22 +++ src/encrypt.c | 457 ++++++++-------------------------------------- src/init.c | 4 + src/main.c | 3 +- src/misc.c | 21 +++ src/modules.c | 47 +++++ src/mysql.c | 76 ++------ src/nickserv.c | 39 +--- src/protocol/bahamut.c | 5 +- src/protocol/charybdis.c | 4 +- src/protocol/dreamforge.c | 5 +- src/protocol/hybrid.c | 4 +- src/protocol/inspircd.c | 4 +- src/protocol/plexus2.c | 4 +- src/protocol/plexus3.c | 4 +- src/protocol/ptlink.c | 6 +- src/protocol/rageircd.c | 4 +- src/protocol/ratbox.c | 5 +- src/protocol/shadowircd.c | 4 +- src/protocol/solidircd.c | 6 +- src/protocol/ultimate2.c | 4 +- src/protocol/ultimate3.c | 5 +- src/protocol/unreal31.c | 4 +- src/protocol/unreal32.c | 4 +- src/protocol/viagra.c | 4 +- version.log | 7 +- 57 files changed, 1622 insertions(+), 941 deletions(-) create mode 100644 src/core/enc_md5.c create mode 100644 src/core/enc_none.c create mode 100644 src/core/enc_old.c diff --git a/Changes b/Changes index 9e4f57e14..309f8058e 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,6 @@ Anope Version S V N -------------------- - +10/17 F Encryption, users can now pick none, old or real md5. [ #00] Anope Version 1.7.17 -------------------- diff --git a/Changes.conf b/Changes.conf index 80fe9cf9f..554edc020 100644 --- a/Changes.conf +++ b/Changes.conf @@ -1,6 +1,30 @@ Anope Version S V N -------------------- ** ADDED CONFIGURATION DIRECTIVES ** +########################################################################### +# +# Encryption settings +# +########################################################################### + +# EncModule [REQUIRED] +# The encryption module to use when dealing with passwords. +# This determines how the passwords are stored in the databases, +# and does not add any security as far as transmitting passwords over +# the network goes. +# enc_none provides no password encryption, storing the password in +# plain text, this is the most versiatle as passwords can easily be +# recovered. +# +# NOTE: users of anope's previous (broken) md5 implementation should +# select the enc_old option, or things may break. +# +# Plain Text - enc_none +# Previous (broken) MD5 - enc_old +# MD5 - enc_md5 +# + +EncModule "enc_none" ** MODIFIED CONFIGURATION DIRECTIVES ** diff --git a/Config b/Config index 8e0a4111b..c9fc4b7cd 100755 --- a/Config +++ b/Config @@ -53,10 +53,6 @@ if [ "$DATDEST" != "" ] ; then WITH_DATA=" --with-datadir=$DATDEST" fi -if [ "$ENCRYPTION" != "" ] ; then - WITH_ENC=" --with-encryption" -fi - if [ "$RUNGROUP" != "" ] ; then WITH_RUN=" --with-rungroup=$RUNGROUP" fi @@ -97,7 +93,6 @@ DATDEST=$HOME/services RUNGROUP= UMASK= IRCTYPE="no default" -ENCRYPTION= CAN_QUICK="no" ########################################################################### @@ -277,42 +272,6 @@ echo "" #### -if [ "$ENCRYPTION" = "ENCRYPT_MD5" ] ; then - DEF=yes -else - DEF=no -fi - -ok=0 -echo "Do you want to use the MD5 message-digest algorithm to encrypt passwords?" -echo "(Selecting "\"yes\"" protects your passwords from being stolen if someone" -echo "gains access to the Services databases, but makes it impossible to recover" -echo "forgotten passwords. There is no way to reverse this operation, so make" -echo "sure you really want to enable it.)" -while [ $ok -eq 0 ] ; do - echo2 "[$DEF] " - if read INPUT ; then : ; else echo "" ; exit 1 ; fi - if [ ! "$INPUT" ] ; then - INPUT=$DEF - fi - case $INPUT in - n*|N*) - ENCRYPTION= - ok=1 - ;; - y*|Y*) - ENCRYPTION=ENCRYPT_MD5 - ok=1 - ;; - *) - echo "Please enter 'yes' or 'no'." - ;; - esac -done -echo "" - -#### - ok=0 DEF=yes echo "Allow anope to automatically check for mysql libaries?" @@ -355,7 +314,6 @@ RUNGROUP="$RUNGROUP" UMASK=$UMASK IRCTYPE="$IRCTYPE" IRCTYPE_DEF="$IRCTYPE_DEF" -ENCRYPTION="$ENCRYPTION" MYSQL="$MYSQL" EOT echo "done." diff --git a/configure b/configure index c46f31dba..7cb8023dd 100755 --- a/configure +++ b/configure @@ -846,7 +846,6 @@ Optional Packages: --with-permissions=permissions Specify the default permissions for anope --with-bindir=bindir Specify the default binary dir for anope --with-datadir=datadir Specify the location of the services data folder - --with-encryption Use md5 database encryption Some influential environment variables: CC C compiler command @@ -948,7 +947,7 @@ esac else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd "$ac_popdir" + cd $ac_popdir done fi @@ -1872,7 +1871,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1930,7 +1930,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2046,7 +2047,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2100,7 +2102,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2145,7 +2148,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2189,7 +2193,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2263,7 +2268,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2488,7 +2494,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2555,7 +2562,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2622,7 +2630,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2689,7 +2698,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2887,7 +2897,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3219,7 +3230,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3389,7 +3401,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3452,7 +3465,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3638,7 +3652,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3703,7 +3718,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3787,7 +3803,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3935,7 +3952,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3997,7 +4015,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4037,7 +4056,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4093,7 +4113,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4133,7 +4154,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4197,7 +4219,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4228,8 +4251,10 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -4341,7 +4366,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4403,7 +4429,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4443,7 +4470,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4499,7 +4527,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4539,7 +4568,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4603,7 +4633,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4634,8 +4665,10 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -4747,7 +4780,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4809,7 +4843,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4849,7 +4884,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4905,7 +4941,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4945,7 +4982,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5009,7 +5047,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5040,8 +5079,10 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -5154,7 +5195,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5219,7 +5261,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5285,7 +5328,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5350,7 +5394,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5421,7 +5466,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5486,7 +5532,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5552,7 +5599,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5617,7 +5665,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5683,7 +5732,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5748,7 +5798,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5818,7 +5869,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5963,7 +6015,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6108,7 +6161,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6293,7 +6347,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6397,7 +6452,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6501,7 +6557,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6605,7 +6662,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6709,7 +6767,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6813,7 +6872,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6917,7 +6977,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7021,7 +7082,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7125,7 +7187,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7229,7 +7292,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7333,7 +7397,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7437,7 +7502,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7541,7 +7607,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7645,7 +7712,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7749,7 +7817,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7853,7 +7922,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7964,24 +8034,6 @@ fi; - -# Check whether --with-encryption or --without-encryption was given. -if test "${with_encryption+set}" = set; then - withval="$with_encryption" - - -cat >>confdefs.h <<_ACEOF -#define USE_ENCRYPTION -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define ENCRYPT_MD5 -_ACEOF - - -fi; - ac_config_files="$ac_config_files Makefile src/bin/anoperc" @@ -8783,6 +8835,11 @@ esac + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -8821,12 +8878,6 @@ echo "$as_me: error: cannot find input file: $f" >&2;} fi;; esac done` || { (exit 1); exit 1; } - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub diff --git a/configure.in b/configure.in index 5d5b69d0f..6ce19e665 100644 --- a/configure.in +++ b/configure.in @@ -262,11 +262,6 @@ AC_ARG_WITH(datadir, [ --with-datadir=datadir Specify the location of the se AC_SUBST(DATDEST) AC_SUBST(MODULE_PATH) -AC_ARG_WITH(encryption, [ --with-encryption Use md5 database encryption], [ - AC_DEFINE_UNQUOTED(USE_ENCRYPTION,,"has encryption") - AC_DEFINE_UNQUOTED(ENCRYPT_MD5,,"Use md5") -]) - AC_CONFIG_FILES( \ Makefile \ src/bin/anoperc \ diff --git a/data/example.conf b/data/example.conf index 6c6edb727..59097c4f1 100644 --- a/data/example.conf +++ b/data/example.conf @@ -96,6 +96,30 @@ #IRCDModule "unreal32" +########################################################################### +# +# Encryption settings +# +########################################################################### + +# EncModule [REQUIRED] +# The encryption module to use when dealing with passwords. +# This determines how the passwords are stored in the databases, +# and does not add any security as far as transmitting passwords over +# the network goes. +# enc_none provides no password encryption, storing the password in +# plain text, this is the most versiatle as passwords can easily be +# recovered. +# +# NOTE: users of anope's previous (broken) md5 implementation should +# select the enc_old option, or things may break. +# +# Plain Text - enc_none +# Previous (broken) MD5 - enc_old +# MD5 - enc_md5 +# + +EncModule "enc_none" ########################################################################### # diff --git a/include/encrypt.h b/include/encrypt.h index 45569b5fb..fd17a00ee 100644 --- a/include/encrypt.h +++ b/include/encrypt.h @@ -12,4 +12,11 @@ * */ -E int encrypt(const char *src, int len, char *dest, int size); +typedef struct encryption_ { + int (*encrypt)(const char *src, int len, char *dest, int size); + int (*encrypt_in_place)(char *buf, int size); + int (*encrypt_check_len)(int passlen, int bufsize); + int (*decrypt)(const char *src, char *dest, int size); + int (*check_password)(const char *plaintext, const char *password); +} Encryption; + diff --git a/include/extern.h b/include/extern.h index efe5fb85c..873a4146e 100644 --- a/include/extern.h +++ b/include/extern.h @@ -17,19 +17,22 @@ #ifndef _WIN32 #define E extern -#define I extern +#define EI extern #else #ifndef MODULE_COMPILE #define E extern __declspec(dllexport) -#define I extern __declspec(dllimport) +#define EI extern __declspec(dllimport) #else #define E extern __declspec(dllimport) -#define I extern __declspec(dllexport) +#define EI extern __declspec(dllexport) #endif #endif #include "slist.h" + + + E char *uplink; /* IRC Variables */ @@ -39,7 +42,7 @@ E IRCDCAPAB *ircdcap; E char *flood_mode_char_set; E char *flood_mode_char_remove; E int UseTSMODE; /* hack to get around bahamut clones that don't send TSMODE */ -I unsigned long umodes[128]; +EI unsigned long umodes[128]; E char csmodes[128]; E CMMode cmmodes[128]; E CBMode cbmodes[128]; @@ -553,7 +556,18 @@ E long unsigned int UserKey3; E int convert_ircservices_44(void); /**** encrypt.c ****/ -E int check_password(const char *plaintext, const char *password); +E char *EncModule; +E void initEncryption(); +E int enc_encrypt(const char *src, int len, char *dest, int size); +E int enc_encrypt_in_place(char *buf, int size); +E int enc_encrypt_check_len(int passlen, int bufsize); +E int enc_decrypt(const char *src, char *dest, int size); +E int enc_check_password(const char *plaintext, const char *password); +E void encmodule_encrypt(int (*func)(const char *src, int len, char *dest, int size)); +E void encmodule_encrypt_in_place(int (*func)(char *buf, int size)); +E void encmodule_encrypt_check_len(int (*func)(int passlen, int bufsize)); +E void encmodule_decrypt(int (*func)(const char *src, char *dest, int size)); +E void encmodule_check_password(int (*func)(const char *plaintext, const char *password)); /**** helpserv.c ****/ E void helpserv(User * u, char *buf); @@ -846,6 +860,7 @@ E char *str_signed(unsigned char *str); E void ntoa(struct in_addr addr, char *ipaddr, int len); E char **buildStringList(char *src, int *number); +E void binary_to_hex(unsigned char *bin, char *hex, int length); @@ -905,7 +920,7 @@ E int nick_identified(User * u); E int nick_recognized(User * u); E void expire_nicks(void); E void expire_requests(void); -I int ns_do_register(User * u); +EI int ns_do_register(User * u); E int delnick(NickAlias * na); E NickAlias *findnick(const char *nick); E NickCore *findcore(const char *nick); @@ -1156,11 +1171,6 @@ E void db_mysql_load_news(void); E unsigned int mysql_rand(void); #endif -#ifdef USE_ENCRYPTION -E int encrypt_in_place(char *buf, int size); -#endif - - E void privmsg(char *source, char *dest, const char *fmt, ...); E void notice(char *source, char *dest, const char *fmt, ...); @@ -1248,72 +1258,72 @@ E void anope_cmd_burst(); /* BURST - use eob to send burst 0 */ E void anope_cmd_svswatch(char *sender, char *nick, char *parm); E void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...); /* CTCP */ -I int anope_event_482(char *source, int ac, char **av); -I int anope_event_436(char *source, int ac, char **av); -I int anope_event_away(char *source, int ac, char **av); -I int anope_event_ping(char *source, int ac, char **av); -I int anope_event_motd(char *source, int ac, char **av); -I int anope_event_join(char *source, int ac, char **av); -I int anope_event_kick(char *source, int ac, char **av); -I int anope_event_kill(char *source, int ac, char **av); -I int anope_event_mode(char *source, int ac, char **av); -I int anope_event_tmode(char *source, int ac, char **av); -I int anope_event_quit(char *source, int ac, char **av); -I int anope_event_squit(char *source, int ac, char **av); -I int anope_event_topic(char *source, int ac, char **av); -I int anope_event_whois(char *source, int ac, char **av); -I int anope_event_part(char *source, int ac, char **av); -I int anope_event_server(char *source, int ac, char **av); -I int anope_event_sid(char *source, int ac, char **av); -I int anope_event_nick(char *source, int ac, char **av); -I int anope_event_bmask(char *source, int ac, char **av); -I int anope_event_gnotice(char *source, int ac, char **av); -I int anope_event_privmsg(char *source, int ac, char **av); -I int anope_event_capab(char *source, int ac, char **av); -I int anope_event_sjoin(char *source, int ac, char **av); -I int anope_event_cs(char *source, int ac, char **av); -I int anope_event_hs(char *source, int ac, char **av); -I int anope_event_ms(char *source, int ac, char **av); -I int anope_event_ns(char *source, int ac, char **av); -I int anope_event_os(char *source, int ac, char **av); -I int anope_event_vs(char *source, int ac, char **av); -I int anope_event_svinfo(char *source, int ac, char **av); -I int anope_event_chghost(char *source, int ac, char **av); -I int anope_event_sethost(char *source, int ac, char **av); -I int anope_event_chgident(char *source, int ac, char **av); -I int anope_event_setident(char *source, int ac, char **av); -I int anope_event_chgname(char *source, int ac, char **av); -I int anope_event_setname(char *source, int ac, char **av); -I int anope_event_svsinfo(char *source, int ac, char **av); -I int anope_event_snick(char *source, int ac, char **av); -I int anope_event_vhost(char *source, int ac, char **av); -I int anope_event_tkl(char *source, int ac, char **av); -I int anope_event_eos(char *source, int ac, char **av); -I int anope_event_eob(char *source, int ac, char **av); -I int anope_event_pass(char *source, int ac, char **av); -I int anope_event_netinfo(char *source, int ac, char **av); -I int anope_event_error(char *source, int ac, char **av); -I int anope_event_eb(char *source, int ac, char **av); -I int anope_event_netctrl(char *source, int ac, char **av); -I int anope_event_notice(char *source, int ac, char **av); -I int anope_event_snotice(char *source, int ac, char **av); -I int anope_event_sqline(char *source, int ac, char **av); -I int anope_event_smo(char *source, int ac, char **av); -I int anope_event_myid(char *source, int ac, char **av); -I int anope_event_vctrl(char *source, int ac, char **av); -I int anope_event_tctrl(char *source, int ac, char **av); -I int anope_event_snetinfo(char *source, int ac, char **av); -I int anope_event_umode2(char *source, int ac, char **av); -I int anope_event_globops(char *source, int ac, char **av); -I int anope_event_swhois(char *source, int ac, char **av); -I int anope_event_burst(char *source, int ac, char **av); -I int anope_event_luserslock(char *source, int ac, char **av); -I int anope_event_admin(char *source, int ac, char **av); -I int anope_event_credits(char *source, int ac, char **av); -I int anope_event_rehash(char *source, int ac, char **av); -I int anope_event_sdesc(char *source, int ac, char **av); -I int anope_event_netglobal(char *source, int ac, char **av); -I int anope_event_invite(char *source, int ac, char **av); +EI int anope_event_482(char *source, int ac, char **av); +EI int anope_event_436(char *source, int ac, char **av); +EI int anope_event_away(char *source, int ac, char **av); +EI int anope_event_ping(char *source, int ac, char **av); +EI int anope_event_motd(char *source, int ac, char **av); +EI int anope_event_join(char *source, int ac, char **av); +EI int anope_event_kick(char *source, int ac, char **av); +EI int anope_event_kill(char *source, int ac, char **av); +EI int anope_event_mode(char *source, int ac, char **av); +EI int anope_event_tmode(char *source, int ac, char **av); +EI int anope_event_quit(char *source, int ac, char **av); +EI int anope_event_squit(char *source, int ac, char **av); +EI int anope_event_topic(char *source, int ac, char **av); +EI int anope_event_whois(char *source, int ac, char **av); +EI int anope_event_part(char *source, int ac, char **av); +EI int anope_event_server(char *source, int ac, char **av); +EI int anope_event_sid(char *source, int ac, char **av); +EI int anope_event_nick(char *source, int ac, char **av); +EI int anope_event_bmask(char *source, int ac, char **av); +EI int anope_event_gnotice(char *source, int ac, char **av); +EI int anope_event_privmsg(char *source, int ac, char **av); +EI int anope_event_capab(char *source, int ac, char **av); +EI int anope_event_sjoin(char *source, int ac, char **av); +EI int anope_event_cs(char *source, int ac, char **av); +EI int anope_event_hs(char *source, int ac, char **av); +EI int anope_event_ms(char *source, int ac, char **av); +EI int anope_event_ns(char *source, int ac, char **av); +EI int anope_event_os(char *source, int ac, char **av); +EI int anope_event_vs(char *source, int ac, char **av); +EI int anope_event_svinfo(char *source, int ac, char **av); +EI int anope_event_chghost(char *source, int ac, char **av); +EI int anope_event_sethost(char *source, int ac, char **av); +EI int anope_event_chgident(char *source, int ac, char **av); +EI int anope_event_setident(char *source, int ac, char **av); +EI int anope_event_chgname(char *source, int ac, char **av); +EI int anope_event_setname(char *source, int ac, char **av); +EI int anope_event_svsinfo(char *source, int ac, char **av); +EI int anope_event_snick(char *source, int ac, char **av); +EI int anope_event_vhost(char *source, int ac, char **av); +EI int anope_event_tkl(char *source, int ac, char **av); +EI int anope_event_eos(char *source, int ac, char **av); +EI int anope_event_eob(char *source, int ac, char **av); +EI int anope_event_pass(char *source, int ac, char **av); +EI int anope_event_netinfo(char *source, int ac, char **av); +EI int anope_event_error(char *source, int ac, char **av); +EI int anope_event_eb(char *source, int ac, char **av); +EI int anope_event_netctrl(char *source, int ac, char **av); +EI int anope_event_notice(char *source, int ac, char **av); +EI int anope_event_snotice(char *source, int ac, char **av); +EI int anope_event_sqline(char *source, int ac, char **av); +EI int anope_event_smo(char *source, int ac, char **av); +EI int anope_event_myid(char *source, int ac, char **av); +EI int anope_event_vctrl(char *source, int ac, char **av); +EI int anope_event_tctrl(char *source, int ac, char **av); +EI int anope_event_snetinfo(char *source, int ac, char **av); +EI int anope_event_umode2(char *source, int ac, char **av); +EI int anope_event_globops(char *source, int ac, char **av); +EI int anope_event_swhois(char *source, int ac, char **av); +EI int anope_event_burst(char *source, int ac, char **av); +EI int anope_event_luserslock(char *source, int ac, char **av); +EI int anope_event_admin(char *source, int ac, char **av); +EI int anope_event_credits(char *source, int ac, char **av); +EI int anope_event_rehash(char *source, int ac, char **av); +EI int anope_event_sdesc(char *source, int ac, char **av); +EI int anope_event_netglobal(char *source, int ac, char **av); +EI int anope_event_invite(char *source, int ac, char **av); E int anope_event_null(char *source, int ac, char **av); E void anope_set_umode(User * user, int ac, char **av); diff --git a/include/modules.h b/include/modules.h index 30d346150..46b573992 100644 --- a/include/modules.h +++ b/include/modules.h @@ -97,7 +97,7 @@ typedef void * ano_module_t; #endif /*************************************************************************/ -typedef enum { CORE,PROTOCOL,THIRD,SUPPORTED,QATESTED } MODType; +typedef enum { CORE,PROTOCOL,THIRD,SUPPORTED,QATESTED,ENCRYPTION } MODType; typedef enum { MOD_OP_LOAD, MOD_OP_UNLOAD } ModuleOperation; /*************************************************************************/ diff --git a/include/sysconf.h.in b/include/sysconf.h.in index 1aa83e421..d54f58617 100644 --- a/include/sysconf.h.in +++ b/include/sysconf.h.in @@ -6,9 +6,6 @@ /* "No prefix needed for dlopen" */ #undef DL_PREFIX -/* "Use md5" */ -#undef ENCRYPT_MD5 - /* "Has sys/types.h" */ #undef HAS_SYS_TYPES_H @@ -141,9 +138,6 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* "has encryption" */ -#undef USE_ENCRYPTION - /* "Modules available" */ #undef USE_MODULES diff --git a/include/version.sh b/include/version.sh index b83c58af9..80a9c70d4 100644 --- a/include/version.sh +++ b/include/version.sh @@ -58,16 +58,6 @@ cat >version.h <= 1400 # define VER_OS "W" diff --git a/src/chanserv.c b/src/chanserv.c index 1b05f8202..908cb1e69 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -496,25 +496,7 @@ void load_cs_dbase(void) SAFE(read_int32(&tmp32, f)); ci->last_topic_time = tmp32; SAFE(read_int32(&ci->flags, f)); -#ifdef USE_ENCRYPTION - if (!(ci->flags & (CI_ENCRYPTEDPW | CI_VERBOTEN))) { - if (debug) - alog("debug: %s: encrypting password for %s on load", - s_ChanServ, ci->name); - if (encrypt_in_place(ci->founderpass, PASSMAX) < 0) - fatal("%s: load database: Can't encrypt %s password!", - s_ChanServ, ci->name); - ci->flags |= CI_ENCRYPTEDPW; - } -#else - if (ci->flags & CI_ENCRYPTEDPW) { - /* Bail: it makes no sense to continue with encrypted - * passwords, since we won't be able to verify them */ - fatal("%s: load database: password for %s encrypted " - "but encryption disabled, aborting", - s_ChanServ, ci->name); - } -#endif + /* Leaveops cleanup */ if (ver <= 13 && (ci->flags & 0x00000020)) ci->flags &= ~0x00000020; diff --git a/src/config.c b/src/config.c index 50ffab865..b6728f0ca 100644 --- a/src/config.c +++ b/src/config.c @@ -19,7 +19,7 @@ /* Configurable variables: */ char *IRCDModule; - +char *EncModule; char *RemoteServer; int RemotePort; char *RemotePassword; @@ -445,6 +445,7 @@ Directive directives[] = { {{PARAM_STRING, PARAM_RELOAD, &DefConAkillReason}}}, {"DefConOffMessage", {{PARAM_STRING, PARAM_RELOAD, &DefConOffMessage}}}, + {"EncModule", {{PARAM_STRING, 0, &EncModule}}}, {"ExceptionDB", {{PARAM_STRING, PARAM_RELOAD, &ExceptionDBName}}}, {"ExceptionExpiry", {{PARAM_TIME, PARAM_RELOAD, &ExceptionExpiry}}}, {"ExpireTimeout", {{PARAM_TIME, PARAM_RELOAD, &ExpireTimeout}}}, @@ -968,6 +969,7 @@ int read_config(int reload) } CHECK(IRCDModule); + CHECK(EncModule); CHECK(NetworkName); if (!reload) { diff --git a/src/core/cs_getpass.c b/src/core/cs_getpass.c index ef9ea3cbb..fd1f241e1 100644 --- a/src/core/cs_getpass.c +++ b/src/core/cs_getpass.c @@ -38,11 +38,8 @@ int AnopeInit(int argc, char **argv) moduleAddCommand(CHANSERV, c, MOD_UNIQUE); moduleSetChanHelp(myChanServHelp); -#ifdef USE_ENCRYPTION - return MOD_STOP; -#else + return MOD_CONT; -#endif } /** @@ -75,6 +72,7 @@ void myChanServHelp(User * u) int do_getpass(User * u) { char *chan = strtok(NULL, " "); + char tmp_pass[PASSMAX]; ChannelInfo *ci; if (!chan) { @@ -86,15 +84,19 @@ int do_getpass(User * u) } else if (CSRestrictGetPass && !is_services_root(u)) { notice_lang(s_ChanServ, u, PERMISSION_DENIED); } else { - alog("%s: %s!%s@%s used GETPASS on %s", - s_ChanServ, u->nick, u->username, u->host, ci->name); - if (WallGetpass) { - anope_cmd_global(s_ChanServ, - "\2%s\2 used GETPASS on channel \2%s\2", - u->nick, chan); - } - notice_lang(s_ChanServ, u, CHAN_GETPASS_PASSWORD_IS, - chan, ci->founderpass); + if(enc_decrypt(ci->founderpass,tmp_pass,PASSMAX)==1) { + alog("%s: %s!%s@%s used GETPASS on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); + if (WallGetpass) { + anope_cmd_global(s_ChanServ, + "\2%s\2 used GETPASS on channel \2%s\2", + u->nick, chan); + } + notice_lang(s_ChanServ, u, CHAN_GETPASS_PASSWORD_IS, + chan, ci->founderpass); + } else { + notice_lang(s_ChanServ, u, CHAN_GETPASS_UNAVAILABLE); + } } return MOD_CONT; } diff --git a/src/core/cs_identify.c b/src/core/cs_identify.c index 33091c01a..6979c0f08 100644 --- a/src/core/cs_identify.c +++ b/src/core/cs_identify.c @@ -17,9 +17,6 @@ int do_identify(User * u); void myChanServHelp(User * u); -#ifdef _WIN32 -extern MDE int check_password(const char *plaintext, const char *password); -#endif /** * Create the command, and tell anope about it. @@ -92,7 +89,7 @@ int do_identify(User * u) } else { int res; - if ((res = check_password(pass, ci->founderpass)) == 1) { + if ((res = enc_check_password(pass, ci->founderpass)) == 1) { if (!is_identified(u, ci)) { uc = scalloc(sizeof(*uc), 1); uc->next = u->founder_chans; diff --git a/src/core/cs_register.c b/src/core/cs_register.c index d480f03c0..6d0167a1d 100644 --- a/src/core/cs_register.c +++ b/src/core/cs_register.c @@ -75,9 +75,8 @@ int do_register(User * u) ChannelInfo *ci; struct u_chaninfolist *uc; int is_servadmin = is_services_admin(u); -#ifdef USE_ENCRYPTION char founderpass[PASSMAX + 1]; -#endif + char tmp_pass[PASSMAX]; if (readonly) { notice_lang(s_ChanServ, u, CHAN_REGISTER_DISABLED); @@ -130,15 +129,12 @@ int do_register(User * u) alog("%s: makechan() failed for REGISTER %s", s_ChanServ, chan); notice_lang(s_ChanServ, u, CHAN_REGISTRATION_FAILED); -#ifdef USE_ENCRYPTION } else if (strscpy(founderpass, pass, PASSMAX + 1), - encrypt_in_place(founderpass, PASSMAX) < 0) { + enc_encrypt_in_place(founderpass, PASSMAX) < 0) { alog("%s: Couldn't encrypt password for %s (REGISTER)", s_ChanServ, chan); notice_lang(s_ChanServ, u, CHAN_REGISTRATION_FAILED); delchan(ci); -#endif - } else { c->ci = ci; ci->c = c; @@ -148,17 +144,12 @@ int do_register(User * u) ci->memos.memomax = MSMaxMemos; ci->last_used = ci->time_registered; ci->founder = nc; -#ifdef USE_ENCRYPTION if (strlen(pass) > PASSMAX) notice_lang(s_ChanServ, u, PASSWORD_TRUNCATED, PASSMAX); memset(pass, 0, strlen(pass)); memcpy(ci->founderpass, founderpass, PASSMAX); - ci->flags |= CI_ENCRYPTEDPW; -#else - if (strlen(pass) > PASSMAX - 1) /* -1 for null byte */ - notice_lang(s_ChanServ, u, PASSWORD_TRUNCATED, PASSMAX - 1); - strscpy(ci->founderpass, pass, PASSMAX); -#endif +// ci->flags |= CI_ENCRYPTEDPW; +// ci->desc = sstrdup(desc); if (c->topic) { ci->last_topic = sstrdup(c->topic); @@ -174,9 +165,11 @@ int do_register(User * u) alog("%s: Channel '%s' registered by %s!%s@%s", s_ChanServ, chan, u->nick, u->username, u->host); notice_lang(s_ChanServ, u, CHAN_REGISTERED, chan, u->nick); -#ifndef USE_ENCRYPTION - notice_lang(s_ChanServ, u, CHAN_PASSWORD_IS, ci->founderpass); -#endif + + if(enc_decrypt(ci->founderpass,tmp_pass,PASSMAX) == 1) { + notice_lang(s_ChanServ, u, CHAN_PASSWORD_IS, ci->founderpass); + } + uc = scalloc(sizeof(*uc), 1); uc->next = u->founder_chans; uc->prev = NULL; diff --git a/src/core/cs_sendpass.c b/src/core/cs_sendpass.c index 61eb70524..ee31287df 100644 --- a/src/core/cs_sendpass.c +++ b/src/core/cs_sendpass.c @@ -37,15 +37,12 @@ int AnopeInit(int argc, char **argv) moduleAddCommand(CHANSERV, c, MOD_UNIQUE); moduleSetChanHelp(myChanServHelp); -#ifdef USE_ENCRYPTION - return MOD_STOP; -#else + if (UseMail) { return MOD_CONT; } else { return MOD_STOP; } -#endif } /** @@ -89,35 +86,40 @@ int do_sendpass(User * u) notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan); } else { char buf[BUFSIZE]; - MailInfo *mail; - - snprintf(buf, sizeof(buf), - getstring2(founder, CHAN_SENDPASS_SUBJECT), ci->name); - mail = MailBegin(u, founder, buf, s_ChanServ); - if (!mail) - return MOD_CONT; - - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_HEAD)); - fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_1), - ci->name); - fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_2), - ci->founderpass); - fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_3)); - fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_4)); - fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_5), - NetworkName); - fprintf(mail->pipe, "\n.\n"); - - MailEnd(mail); - - alog("%s: %s!%s@%s used SENDPASS on %s", s_ChanServ, u->nick, - u->username, u->host, chan); - notice_lang(s_ChanServ, u, CHAN_SENDPASS_OK, chan); + char tmp_pass[PASSMAX]; + if(enc_decrypt(ci->founderpass,tmp_pass,PASSMAX)==1) { + MailInfo *mail; + + snprintf(buf, sizeof(buf), + getstring2(founder, CHAN_SENDPASS_SUBJECT), ci->name); + mail = MailBegin(u, founder, buf, s_ChanServ); + if (!mail) + return MOD_CONT; + + fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_HEAD)); + fprintf(mail->pipe, "\n\n"); + fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_1), + ci->name); + fprintf(mail->pipe, "\n\n"); + fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_2), + tmp_pass); + fprintf(mail->pipe, "\n\n"); + fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_3)); + fprintf(mail->pipe, "\n\n"); + fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_4)); + fprintf(mail->pipe, "\n\n"); + fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_5), + NetworkName); + fprintf(mail->pipe, "\n.\n"); + + MailEnd(mail); + + alog("%s: %s!%s@%s used SENDPASS on %s", s_ChanServ, u->nick, + u->username, u->host, chan); + notice_lang(s_ChanServ, u, CHAN_SENDPASS_OK, chan); + } else { + notice_lang(s_ChanServ, u, CHAN_SENDPASS_UNAVAILABLE); + } } return MOD_CONT; } diff --git a/src/core/cs_set.c b/src/core/cs_set.c index 15a0395be..c926ea583 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -14,9 +14,7 @@ /*************************************************************************/ #include "module.h" -#ifdef USE_ENCRYPTION #include "encrypt.h" -#endif int do_set(User * u); int do_set_founder(User * u, ChannelInfo * ci, char *param); @@ -368,14 +366,14 @@ int do_set_password(User * u, ChannelInfo * ci, char *param) notice_lang(s_ChanServ, u, MORE_OBSCURE_PASSWORD); return MOD_CONT; } -#ifdef USE_ENCRYPTION + if (len > PASSMAX) { len = PASSMAX; param[len] = 0; notice_lang(s_ChanServ, u, PASSWORD_TRUNCATED, PASSMAX); } - if (encrypt(param, len, ci->founderpass, PASSMAX) < 0) { + if (enc_encrypt(param, len, ci->founderpass, PASSMAX) < 0) { memset(param, 0, strlen(param)); alog("%s: Failed to encrypt password for %s (set)", s_ChanServ, ci->name); @@ -386,14 +384,6 @@ int do_set_password(User * u, ChannelInfo * ci, char *param) memset(param, 0, strlen(param)); notice_lang(s_ChanServ, u, CHAN_PASSWORD_CHANGED, ci->name); -#else /* !USE_ENCRYPTION */ - if (strlen(param) > PASSMAX - 1) /* -1 for null byte */ - notice_lang(s_ChanServ, u, PASSWORD_TRUNCATED, PASSMAX - 1); - strscpy(ci->founderpass, param, PASSMAX); - notice_lang(s_ChanServ, u, CHAN_PASSWORD_CHANGED_TO, ci->name, - ci->founderpass); -#endif /* USE_ENCRYPTION */ - if (get_access(u, ci) < ACCESS_FOUNDER) { alog("%s: %s!%s@%s set password as Services admin for %s", s_ChanServ, u->nick, u->username, u->host, ci->name); diff --git a/src/core/enc_md5.c b/src/core/enc_md5.c new file mode 100644 index 000000000..411e9f2a4 --- /dev/null +++ b/src/core/enc_md5.c @@ -0,0 +1,422 @@ +/* Module for encryption using MD5. + * + * Modified for Anope. + * (C) 2003-2006 Anope Team + * Contact us at dev@anope.org + * + * Taken from IRC Services and is copyright (c) 1996-2002 Andrew Church. + * E-mail: + * Parts written by Andrew Kempe and others. + * This program is free but copyrighted software; see the file COPYING for + * details. + */ + +#include "module.h" + + +/*************************************************************************/ + +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + */ + +#include + +typedef unsigned int UINT4; + +/* MD5 context