diff options
author | Peter Volkov <pva@gentoo.org> | 2010-08-09 08:21:28 +0000 |
---|---|---|
committer | Peter Volkov <pva@gentoo.org> | 2010-08-09 08:21:28 +0000 |
commit | d443d06d781f96235630e59e236a8750eaef25f6 (patch) | |
tree | 06c0df9f331059073171c701220510006672fd30 /net-im/ejabberd | |
parent | x86 stable, bug 322791 (diff) | |
download | gentoo-2-d443d06d781f96235630e59e236a8750eaef25f6.tar.gz gentoo-2-d443d06d781f96235630e59e236a8750eaef25f6.tar.bz2 gentoo-2-d443d06d781f96235630e59e236a8750eaef25f6.zip |
Fix openssl breakage due to missed md2 support, bug 331299, thank Rion for report and Samuli Suominen for quick fix.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'net-im/ejabberd')
-rw-r--r-- | net-im/ejabberd/ChangeLog | 7 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-2.1.5.ebuild | 5 | ||||
-rw-r--r-- | net-im/ejabberd/files/ejabberd-2.1.5-md2-optional.patch | 259 |
3 files changed, 268 insertions, 3 deletions
diff --git a/net-im/ejabberd/ChangeLog b/net-im/ejabberd/ChangeLog index 6485a5fe39b0..14be54949046 100644 --- a/net-im/ejabberd/ChangeLog +++ b/net-im/ejabberd/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-im/ejabberd # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.83 2010/08/05 10:41:17 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.84 2010/08/09 08:21:28 pva Exp $ + + 09 Aug 2010; Peter Volkov <pva@gentoo.org> ejabberd-2.1.5.ebuild, + +files/ejabberd-2.1.5-md2-optional.patch: + Fix openssl breakage due to missed md2 support, bug 331299, thank Rion for + report and Samuli Suominen for quick fix. *ejabberd-2.1.5 (05 Aug 2010) diff --git a/net-im/ejabberd/ejabberd-2.1.5.ebuild b/net-im/ejabberd/ejabberd-2.1.5.ebuild index b29527c780e5..5b7979904372 100644 --- a/net-im/ejabberd/ejabberd-2.1.5.ebuild +++ b/net-im/ejabberd/ejabberd-2.1.5.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-2.1.5.ebuild,v 1.1 2010/08/05 10:41:17 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-2.1.5.ebuild,v 1.2 2010/08/09 08:21:28 pva Exp $ EAPI=3 @@ -14,7 +14,7 @@ SRC_URI="http://www.process-one.net/downloads/${PN}/${PV}/${P}.tar.gz LICENSE="GPL-2" SLOT="0" -KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~sparc ~x86" +KEYWORDS="amd64 ~arm ~ia64 ~ppc ~sparc x86" EJABBERD_MODULES="mod_irc mod_muc mod_proxy65 mod_pubsub mod_srl mod_statsdx" IUSE="captcha debug ldap odbc pam +web zlib ${EJABBERD_MODULES}" @@ -42,6 +42,7 @@ JABBER_LOG="${EPREFIX}/var/log/jabber" JABBER_DOC="${EPREFIX}/usr/share/doc/${PF}" src_prepare() { + epatch "${FILESDIR}/${P}-md2-optional.patch" #331299 if use mod_statsdx; then ewarn "mod_statsdx is not a part of upstream tarball but is a third-party module" ewarn "taken from here: http://www.ejabberd.im/mod_stats2file" diff --git a/net-im/ejabberd/files/ejabberd-2.1.5-md2-optional.patch b/net-im/ejabberd/files/ejabberd-2.1.5-md2-optional.patch new file mode 100644 index 000000000000..e11cad3b7d12 --- /dev/null +++ b/net-im/ejabberd/files/ejabberd-2.1.5-md2-optional.patch @@ -0,0 +1,259 @@ +commit d2d8a09b4afdb5f77b903411ff16fbb0b739d3e4 +Author: Evgeniy Khramtsov <ekhramtsov@process-one.net> +Date: Sat Aug 7 22:04:57 2010 +1000 + + Make MD2 autodetected (EJAB-1285) + +diff --git a/src/Makefile.in b/src/Makefile.in +index 7d225f3..4e56181 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -64,6 +64,11 @@ ifeq (@transient_supervisors@, false) + EFLAGS+=-DNO_TRANSIENT_SUPERVISORS + endif + ++ifeq (@md2@, true) ++ EFLAGS+=-DHAVE_MD2 ++ ERLANG_CFLAGS += -DHAVE_MD2 ++endif ++ + INSTALL_EPAM= + ifeq (@pam@, pam) + INSTALL_EPAM=install -m 750 $(O_USER) epam $(PBINDIR) +diff --git a/src/configure.ac b/src/configure.ac +index 1497643..1d25dd8 100644 +--- a/src/configure.ac ++++ b/src/configure.ac +@@ -148,6 +148,9 @@ if test "$ENABLEUSER" != ""; then + AC_SUBST([INSTALLUSER], [$ENABLEUSER]) + fi + ++AC_CHECK_HEADER(openssl/md2.h, md2=true, md2=false) ++AC_SUBST(md2) ++ + AC_CANONICAL_SYSTEM + #AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$target") + #AC_SUBST(target_os) +diff --git a/src/mod_caps.erl b/src/mod_caps.erl +index 7fb011e..d9f4f30 100644 +--- a/src/mod_caps.erl ++++ b/src/mod_caps.erl +@@ -276,25 +276,8 @@ feature_response(#iq{type = result, + sub_el = [{xmlelement, _, _, Els}]}, + Host, From, Caps, [SubNode | SubNodes]) -> + BinaryNode = node_to_binary(Caps#caps.node, SubNode), +- IsValid = case Caps#caps.hash of +- "md2" -> +- Caps#caps.version == make_disco_hash(Els, md2); +- "md5" -> +- Caps#caps.version == make_disco_hash(Els, md5); +- "sha-1" -> +- Caps#caps.version == make_disco_hash(Els, sha1); +- "sha-224" -> +- Caps#caps.version == make_disco_hash(Els, sha224); +- "sha-256" -> +- Caps#caps.version == make_disco_hash(Els, sha256); +- "sha-384" -> +- Caps#caps.version == make_disco_hash(Els, sha384); +- "sha-512" -> +- Caps#caps.version == make_disco_hash(Els, sha512); +- _ -> +- true +- end, +- if IsValid -> ++ case check_hash(Caps, Els) of ++ true -> + Features = lists:flatmap( + fun({xmlelement, "feature", FAttrs, _}) -> + [xml:get_attr_s("var", FAttrs)]; +@@ -304,7 +287,7 @@ feature_response(#iq{type = result, + mnesia:dirty_write( + #caps_features{node_pair = BinaryNode, + features = features_to_binary(Features)}); +- true -> ++ false -> + mnesia:dirty_write(#caps_features{node_pair = BinaryNode}) + end, + feature_request(Host, From, Caps, SubNodes); +@@ -349,6 +332,7 @@ make_my_disco_hash(Host) -> + "" + end. + ++-ifdef(HAVE_MD2). + make_disco_hash(DiscoEls, Algo) -> + Concat = [concat_identities(DiscoEls), + concat_features(DiscoEls), +@@ -370,6 +354,64 @@ make_disco_hash(DiscoEls, Algo) -> + sha:sha512(Concat) + end). + ++check_hash(Caps, Els) -> ++ case Caps#caps.hash of ++ "md2" -> ++ Caps#caps.version == make_disco_hash(Els, md2); ++ "md5" -> ++ Caps#caps.version == make_disco_hash(Els, md5); ++ "sha-1" -> ++ Caps#caps.version == make_disco_hash(Els, sha1); ++ "sha-224" -> ++ Caps#caps.version == make_disco_hash(Els, sha224); ++ "sha-256" -> ++ Caps#caps.version == make_disco_hash(Els, sha256); ++ "sha-384" -> ++ Caps#caps.version == make_disco_hash(Els, sha384); ++ "sha-512" -> ++ Caps#caps.version == make_disco_hash(Els, sha512); ++ _ -> ++ true ++ end. ++-else. ++make_disco_hash(DiscoEls, Algo) -> ++ Concat = [concat_identities(DiscoEls), ++ concat_features(DiscoEls), ++ concat_info(DiscoEls)], ++ base64:encode_to_string( ++ if Algo == md5 -> ++ crypto:md5(Concat); ++ Algo == sha1 -> ++ crypto:sha(Concat); ++ Algo == sha224 -> ++ sha:sha224(Concat); ++ Algo == sha256 -> ++ sha:sha256(Concat); ++ Algo == sha384 -> ++ sha:sha384(Concat); ++ Algo == sha512 -> ++ sha:sha512(Concat) ++ end). ++ ++check_hash(Caps, Els) -> ++ case Caps#caps.hash of ++ "md5" -> ++ Caps#caps.version == make_disco_hash(Els, md5); ++ "sha-1" -> ++ Caps#caps.version == make_disco_hash(Els, sha1); ++ "sha-224" -> ++ Caps#caps.version == make_disco_hash(Els, sha224); ++ "sha-256" -> ++ Caps#caps.version == make_disco_hash(Els, sha256); ++ "sha-384" -> ++ Caps#caps.version == make_disco_hash(Els, sha384); ++ "sha-512" -> ++ Caps#caps.version == make_disco_hash(Els, sha512); ++ _ -> ++ true ++ end. ++-endif. ++ + concat_features(Els) -> + lists:usort( + lists:flatmap( +diff --git a/src/sha.erl b/src/sha.erl +index 64c15c1..06dd3c2 100644 +--- a/src/sha.erl ++++ b/src/sha.erl +@@ -28,7 +28,11 @@ + -author('alexey@process-one.net'). + + -export([start/0, sha/1, sha1/1, sha224/1, sha256/1, sha384/1, +- sha512/1, md2/1]). ++ sha512/1]). ++ ++-ifdef(HAVE_MD2). ++-export([md2/1]). ++-endif. + + -include("ejabberd.hrl"). + +@@ -80,8 +84,10 @@ sha384(Text) -> + sha512(Text) -> + erlang:port_control(?DRIVER, 512, Text). + ++-ifdef(HAVE_MD2). + md2(Text) -> + erlang:port_control(?DRIVER, 2, Text). ++-endif. + + driver_path() -> + Suffix = case os:type() of +diff --git a/src/tls/Makefile.in b/src/tls/Makefile.in +index 4458796..ee40f93 100644 +--- a/src/tls/Makefile.in ++++ b/src/tls/Makefile.in +@@ -30,6 +30,11 @@ ifdef debug + EFLAGS+=+debug_info +export_all + endif + ++ifeq (@md2@, true) ++ EFLAGS+=-DHAVE_MD2 ++ ERLANG_CFLAGS += -DHAVE_MD2 ++endif ++ + ERLSHLIBS = ../tls_drv.so ../sha_drv.so + OUTDIR = .. + SOURCES = $(wildcard *.erl) +diff --git a/src/tls/sha_drv.c b/src/tls/sha_drv.c +index 13d6580..8e6de32 100644 +--- a/src/tls/sha_drv.c ++++ b/src/tls/sha_drv.c +@@ -20,7 +20,9 @@ + + #include <erl_driver.h> + #include <openssl/sha.h> ++#ifdef HAVE_MD2 + #include <openssl/md2.h> ++#endif + + static ErlDrvData sha_drv_start(ErlDrvPort port, char *buf) + { +@@ -36,11 +38,13 @@ static int sha_drv_control(ErlDrvData handle, + ErlDrvBinary *b = NULL; + + switch (command) { ++#ifdef HAVE_MD2 + case 2: + rlen = MD2_DIGEST_LENGTH; + b = driver_alloc_binary(rlen); + if (b) MD2((unsigned char*)buf, len, (unsigned char*)b->orig_bytes); + break; ++#endif + case 224: + rlen = SHA224_DIGEST_LENGTH; + b = driver_alloc_binary(rlen); + + +commit b14899d41ae8f0d3e750ba42e297ea5815bf30c1 +Author: Badlop <badlop@process-one.net> +Date: Sat Aug 7 19:42:56 2010 +0200 + + Update the 'configure' script + +diff --git a/src/configure b/src/configure +index 2d44646..d515abc 100755 +--- a/src/configure ++++ b/src/configure +@@ -608,6 +608,7 @@ build_os + build_vendor + build_cpu + build ++md2 + INSTALLUSER + SSL_CFLAGS + SSL_LIBS +@@ -4822,6 +4823,16 @@ if test "$ENABLEUSER" != ""; then + + fi + ++ac_fn_c_check_header_mongrel "$LINENO" "openssl/md2.h" "ac_cv_header_openssl_md2_h" "$ac_includes_default" ++if test "x$ac_cv_header_openssl_md2_h" = x""yes; then : ++ md2=true ++else ++ md2=false ++fi ++ ++ ++ ++ + ac_aux_dir= + for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do |