Skip to content

Commit

Permalink
Use Digest::SHA instead of deprecated module Digest::SHA1 (#625904).
Browse files Browse the repository at this point in the history
  • Loading branch information
racke committed Aug 22, 2011
1 parent a3f2836 commit 430afc2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions code/Filter/sha1.filter
Expand Up @@ -5,15 +5,15 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. See the LICENSE file for details.

Require module Digest::SHA1
Require module Digest::SHA

CodeDef sha1 Filter
CodeDef sha1 Description sha1 sum
CodeDef sha1 Routine <<EOR

use Digest::SHA1;
use Digest::SHA;

sub {
return Digest::SHA1::sha1_hex($_[0]);
return Digest::SHA::sha1_hex($_[0]);
}
EOR
16 changes: 8 additions & 8 deletions lib/Vend/UserDB.pm
Expand Up @@ -34,16 +34,16 @@ no warnings qw(uninitialized numeric);

my $ready = new Vend::Safe;

my $HAVE_SHA1;
my $HAVE_SHA;

eval {
require Digest::SHA1;
import Digest::SHA1;
$HAVE_SHA1 = 1;
require Digest::SHA;
import Digest::SHA;
$HAVE_SHA = 1;
};

if ($@) {
::logGlobal("SHA1 passwords disabled: $@");
::logGlobal("SHA passwords disabled: $@");
}

# The object encryption methods take three arguments: object, password, and
Expand Down Expand Up @@ -100,11 +100,11 @@ sub enc_md5_salted {

sub enc_sha1 {
my $obj = shift;
unless ($HAVE_SHA1) {
$obj->log_either('SHA1 passwords unavailable. Is Digest::SHA1 installed?');
unless ($HAVE_SHA) {
$obj->log_either('SHA passwords unavailable. Is Digest::SHA installed?');
return;
}
return Digest::SHA1::sha1_hex(shift);
return Digest::SHA::sha1_hex(shift);
}

# Maps the length of the encrypted data to the algorithm that
Expand Down

0 comments on commit 430afc2

Please sign in to comment.