Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use Digest::SHA instead of deprecated module Digest::SHA1 (#625904).

  • Loading branch information...
commit 430afc2de8e3cc88525628d5b0f8c1753967a2dd 1 parent a3f2836
@racke racke authored
Showing with 11 additions and 11 deletions.
  1. +3 −3 code/Filter/sha1.filter
  2. +8 −8 lib/Vend/UserDB.pm
View
6 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
View
16 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
Please sign in to comment.
Something went wrong with that request. Please try again.