[interchange] Use Digest::SHA instead of deprecated module Digest::SHA1 (#625904).
Stefan Hornburg
interchange-cvs at icdevgroup.org
Mon Aug 22 09:59:33 UTC 2011
commit 430afc2de8e3cc88525628d5b0f8c1753967a2dd
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Mon Aug 22 10:34:13 2011 +0200
Use Digest::SHA instead of deprecated module Digest::SHA1 (#625904).
code/Filter/sha1.filter | 6 +++---
lib/Vend/UserDB.pm | 16 ++++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/code/Filter/sha1.filter b/code/Filter/sha1.filter
index 640f0f4..acb5df6 100644
--- a/code/Filter/sha1.filter
+++ b/code/Filter/sha1.filter
@@ -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
diff --git a/lib/Vend/UserDB.pm b/lib/Vend/UserDB.pm
index 37c895b..e2ae946 100644
--- a/lib/Vend/UserDB.pm
+++ b/lib/Vend/UserDB.pm
@@ -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
@@ -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
More information about the interchange-cvs
mailing list