Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 331299
Collapse All | Expand All

(-)ejabberd-2.1.5.orig/src/mod_caps.erl (-5 / +1 lines)
Lines 277-284 Link Here
277
		 Host, From, Caps, [SubNode | SubNodes]) ->
277
		 Host, From, Caps, [SubNode | SubNodes]) ->
278
    BinaryNode = node_to_binary(Caps#caps.node, SubNode),
278
    BinaryNode = node_to_binary(Caps#caps.node, SubNode),
279
    IsValid = case Caps#caps.hash of
279
    IsValid = case Caps#caps.hash of
280
		  "md2" ->
281
		      Caps#caps.version == make_disco_hash(Els, md2);
282
		  "md5" ->
280
		  "md5" ->
283
		      Caps#caps.version == make_disco_hash(Els, md5);
281
		      Caps#caps.version == make_disco_hash(Els, md5);
284
		  "sha-1" ->
282
		  "sha-1" ->
Lines 354-362 Link Here
354
	      concat_features(DiscoEls),
352
	      concat_features(DiscoEls),
355
	      concat_info(DiscoEls)],
353
	      concat_info(DiscoEls)],
356
    base64:encode_to_string(
354
    base64:encode_to_string(
357
      if Algo == md2 ->
355
      if Algo == md5 ->
358
	      sha:md2(Concat);
359
	 Algo == md5 ->
360
	      crypto:md5(Concat);
356
	      crypto:md5(Concat);
361
	 Algo == sha1 ->
357
	 Algo == sha1 ->
362
	      crypto:sha(Concat);
358
	      crypto:sha(Concat);
(-)ejabberd-2.1.5.orig/src/sha.erl (-4 / +1 lines)
Lines 28-34 Link Here
28
-author('alexey@process-one.net').
28
-author('alexey@process-one.net').
29
29
30
-export([start/0, sha/1, sha1/1, sha224/1, sha256/1, sha384/1,
30
-export([start/0, sha/1, sha1/1, sha224/1, sha256/1, sha384/1,
31
	 sha512/1, md2/1]).
31
	 sha512/1]).
32
32
33
-include("ejabberd.hrl").
33
-include("ejabberd.hrl").
34
34
Lines 80-88 Link Here
80
sha512(Text) ->
80
sha512(Text) ->
81
    erlang:port_control(?DRIVER, 512, Text).
81
    erlang:port_control(?DRIVER, 512, Text).
82
82
83
md2(Text) ->
84
    erlang:port_control(?DRIVER, 2, Text).
85
86
driver_path() ->
83
driver_path() ->
87
    Suffix = case os:type() of
84
    Suffix = case os:type() of
88
		 {win32, _} -> ".dll";
85
		 {win32, _} -> ".dll";
(-)ejabberd-2.1.5.orig/src/tls/sha_drv.c (-6 lines)
Lines 20-26 Link Here
20
20
21
#include <erl_driver.h>
21
#include <erl_driver.h>
22
#include <openssl/sha.h>
22
#include <openssl/sha.h>
23
#include <openssl/md2.h>
24
23
25
static ErlDrvData sha_drv_start(ErlDrvPort port, char *buf)
24
static ErlDrvData sha_drv_start(ErlDrvPort port, char *buf)
26
{
25
{
Lines 36-46 Link Here
36
  ErlDrvBinary *b = NULL;
35
  ErlDrvBinary *b = NULL;
37
36
38
  switch (command) {
37
  switch (command) {
39
  case 2:
40
    rlen = MD2_DIGEST_LENGTH;
41
    b = driver_alloc_binary(rlen);
42
    if (b) MD2((unsigned char*)buf, len, (unsigned char*)b->orig_bytes);
43
    break;
44
  case 224:
38
  case 224:
45
    rlen = SHA224_DIGEST_LENGTH;
39
    rlen = SHA224_DIGEST_LENGTH;
46
    b = driver_alloc_binary(rlen);
40
    b = driver_alloc_binary(rlen);

Return to bug 331299