diff -ur ejabberd-2.1.5.orig/src/mod_caps.erl ejabberd-2.1.5/src/mod_caps.erl --- ejabberd-2.1.5.orig/src/mod_caps.erl 2010-08-02 19:33:20.000000000 +0300 +++ ejabberd-2.1.5/src/mod_caps.erl 2010-08-05 14:49:04.000000000 +0300 @@ -277,8 +277,6 @@ 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" -> @@ -354,9 +352,7 @@ concat_features(DiscoEls), concat_info(DiscoEls)], base64:encode_to_string( - if Algo == md2 -> - sha:md2(Concat); - Algo == md5 -> + if Algo == md5 -> crypto:md5(Concat); Algo == sha1 -> crypto:sha(Concat); diff -ur ejabberd-2.1.5.orig/src/sha.erl ejabberd-2.1.5/src/sha.erl --- ejabberd-2.1.5.orig/src/sha.erl 2010-08-02 19:33:20.000000000 +0300 +++ ejabberd-2.1.5/src/sha.erl 2010-08-05 14:49:34.000000000 +0300 @@ -28,7 +28,7 @@ -author('alexey@process-one.net'). -export([start/0, sha/1, sha1/1, sha224/1, sha256/1, sha384/1, - sha512/1, md2/1]). + sha512/1]). -include("ejabberd.hrl"). @@ -80,9 +80,6 @@ sha512(Text) -> erlang:port_control(?DRIVER, 512, Text). -md2(Text) -> - erlang:port_control(?DRIVER, 2, Text). - driver_path() -> Suffix = case os:type() of {win32, _} -> ".dll"; diff -ur ejabberd-2.1.5.orig/src/tls/sha_drv.c ejabberd-2.1.5/src/tls/sha_drv.c --- ejabberd-2.1.5.orig/src/tls/sha_drv.c 2010-08-02 19:33:20.000000000 +0300 +++ ejabberd-2.1.5/src/tls/sha_drv.c 2010-08-05 14:48:11.000000000 +0300 @@ -20,7 +20,6 @@ #include #include -#include static ErlDrvData sha_drv_start(ErlDrvPort port, char *buf) { @@ -36,11 +35,6 @@ ErlDrvBinary *b = NULL; switch (command) { - case 2: - rlen = MD2_DIGEST_LENGTH; - b = driver_alloc_binary(rlen); - if (b) MD2((unsigned char*)buf, len, (unsigned char*)b->orig_bytes); - break; case 224: rlen = SHA224_DIGEST_LENGTH; b = driver_alloc_binary(rlen);