From 6c17fcd8f7af66809448856a343328feaac9507d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 18 Mar 2007 09:37:14 +0000 Subject: [PATCH] Use mcrypt instead of des.inc whose license is non-free --- debian/control | 2 +- debian/copyright | 1 - debian/patches/series | 1 + debian/patches/use_mcrypt.patch | 34 +++++++++++++++++++++++++++++++++ debian/rules | 2 ++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 debian/patches/use_mcrypt.patch diff --git a/debian/control b/debian/control index 4fb546d..1611b69 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Standards-Version: 3.7.2 Package: roundcube Architecture: all -Depends: dbconfig-common, debconf | debconf-2.0, apache2 | httpd, php5 | php4, php5-mysql | php4-mysql | php5-pgsql | php4-pgsql | php5-sqlite | php4-sqlite, php-db, php-auth, php-net-smtp, php-net-socket, php-mail-mime, ucf, mysql-client | virtual-mysql-client | postgresql-client-8.1 | postgresql-client | sqlite, ${misc:Depends} +Depends: dbconfig-common, debconf | debconf-2.0, apache2 | httpd, php5 | php4, php5-mysql | php4-mysql | php5-pgsql | php4-pgsql | php5-sqlite | php4-sqlite, php5-mcrypt | php4-mcrypt, php-db, php-auth, php-net-smtp, php-net-socket, php-mail-mime, ucf, mysql-client | virtual-mysql-client | postgresql-client-8.1 | postgresql-client | sqlite, ${misc:Depends} Suggests: mysql-server | posgresql-server Description: modern, skinnable, AJAX based webmail solution for IMAP servers RoundCube Webmail is a browser-based multilingual IMAP client with an diff --git a/debian/copyright b/debian/copyright index b9801fd..440d03a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -14,7 +14,6 @@ Version 2 or later, found on Debian systems in the file Some files are taken from other projects : - googiespell from amix@amix.dk, MIT license - lib/html2text.inc from jon@chuggnutt.com, GPL license - - lib/des.inc from Paul Tero, unknown license - lib/utf8.class.php from Alexander Minkovsky, public domain - lib/{enriched,icl_commons,imap,mime,utf7}.inc from IlohaMail project, GPL license - lib/encoding/*.map from Unicode, Inc., with "BSD-lite" license diff --git a/debian/patches/series b/debian/patches/series index 70787a4..d9c2b5e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ dbconfig-common_support.patch correct_install_path.patch +use_mcrypt.patch diff --git a/debian/patches/use_mcrypt.patch b/debian/patches/use_mcrypt.patch new file mode 100644 index 0000000..51edad1 --- /dev/null +++ b/debian/patches/use_mcrypt.patch @@ -0,0 +1,34 @@ +--- roundcube_0.1~beta2.2/program/include/main.inc 2006-12-22 23:26:24.000000000 +0100 ++++ roundcube_0.1~beta2.2/program/include/main.inc 2007-03-18 10:24:11.000000000 +0100 +@@ -758,7 +758,13 @@ + // encrypt IMAP password using DES encryption + function encrypt_passwd($pass) + { +- $cypher = des(get_des_key(), $pass, 1, 0, NULL); ++ $td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, ""); ++ $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); ++ mcrypt_generic_init($td, get_des_key(), $iv); ++ $cypher = mcrypt_generic($td, $pass); ++ mcrypt_generic_end($td); ++ mcrypt_module_close($td); ++ + return base64_encode($cypher); + } + +@@ -766,8 +772,14 @@ + // decrypt IMAP password using DES encryption + function decrypt_passwd($cypher) + { +- $pass = des(get_des_key(), base64_decode($cypher), 0, 0, NULL); +- return preg_replace('/\x00/', '', $pass); ++ $td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, ""); ++ $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); ++ mcrypt_generic_init($td, get_des_key(), $iv); ++ $pass = mdecrypt_generic($td, base64_decode($cypher)); ++ mcrypt_generic_end($td); ++ mcrypt_module_close($td); ++ ++ return $pass; + } + + diff --git a/debian/rules b/debian/rules index 196ff00..fb07457 100755 --- a/debian/rules +++ b/debian/rules @@ -15,6 +15,8 @@ binary-install/roundcube:: rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/Mail rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/Net rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/PEAR.php + # Removing non-licensed des.inc + rm -rf $(CURDIR)/debian/roundcube/usr/share/roundcube/program/lib/des.inc # Symlink all that is in /usr/share/roundcube to /var/lib/roundcube find debian/roundcube/usr/share/roundcube -maxdepth 1 -mindepth 1 | \ while read i; do \ -- 2.39.5