Fix Digest::SHA1 use; it is under Digest::SHA in modern Perl.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 5 May 2013 11:11:11 +0000 (13:11 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 5 May 2013 11:11:11 +0000 (13:11 +0200)
perl/Sesse/pr0n/Common.pm
perl/Sesse/pr0n/WebDAV.pm

index 7375c3cf8f8174a0e90d5753295b1f87895977c5..715cb2fd17bd6af275455e87d0a72897a4790675 100644 (file)
@@ -19,7 +19,7 @@ use DBD::Pg;
 use Image::Magick;
 use POSIX;
 use Digest::MD5;
-use Digest::SHA1;
+use Digest::SHA;
 use Digest::HMAC_SHA1;
 use MIME::Base64;
 use MIME::Types;
@@ -367,11 +367,11 @@ sub output_401 {
                # proxies etc. are being used), and we use HMAC instead of simple
                # hashing simply because that's a better signing method.
                #
-               # NOTE: For some weird reason, Digest::HMAC_SHA1 doesn't like taking
+               # NOTE: For some weird reason, Digest::HMAC_SHA doesn't like taking
                # the output from time directly (it gives a different response), so we
                # forcefully stringify the argument.
                my $ts = time;
-               my $nonce = Digest::HMAC_SHA1->hmac_sha1_hex($ts . "", $Sesse::pr0n::Config::db_password);
+               my $nonce = Digest::HMAC_SHA->hmac_sha1_hex($ts . "", $Sesse::pr0n::Config::db_password);
                my $stale_nonce_text = "";
                $stale_nonce_text = ", stale=\"true\"" if ($options{'StaleNonce'} // 0);
 
@@ -393,7 +393,7 @@ sub check_basic_auth {
        
        my $ref = $dbh->selectrow_hashref('SELECT sha1password,digest_ha1_hex FROM users WHERE username=? AND vhost=?',
                undef, $user, $r->get_server_name);
-       if (!defined($ref) || $ref->{'sha1password'} ne Digest::SHA1::sha1_base64($pass)) {
+       if (!defined($ref) || $ref->{'sha1password'} ne Digest::SHA::sha1_base64($pass)) {
                $r->content_type('text/plain; charset=utf-8');
                $r->log->warn("Authentication failed for $user/$takenby");
                output_401($r);
index ebef01022e54788e7136dcf0961633edfa8b6ac0..71cd8ba13ea8f45763e8360d62e7ab814b67b314 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use Sesse::pr0n::Common qw(error dberror);
-use Digest::SHA1;
+use Digest::SHA;
 use MIME::Base64;
 use Apache2::Request;
 use Apache2::Upload;
@@ -666,7 +666,7 @@ EOF
 
                my ($event, $autorename, $filename) = ($1, $2, $3);
                $autorename = '' if (!defined($autorename));
-               my $sha1 = Digest::SHA1::sha1_base64("/$event/$autorename$filename");
+               my $sha1 = Digest::SHA::sha1_base64("/$event/$autorename$filename");
 
                $r->status(200);
                $r->content_type('text/xml; charset=utf-8');