Skip to content

Commit

Permalink
Item1568: get rid of pointless import; Digest::SHA does it all
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@3823 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed May 5, 2009
1 parent 52fb633 commit fd29a66
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/lib/Foswiki/Users/HtPasswdUser.pm
Expand Up @@ -40,7 +40,6 @@ sub new {
require Digest::MD5;
}
elsif ( $Foswiki::cfg{Htpasswd}{Encoding} eq 'sha1' ) {
require MIME::Base64;
require Digest::SHA;
}
elsif (( $Foswiki::cfg{Htpasswd}{Encoding} eq 'crypt-md5' )
Expand Down Expand Up @@ -174,7 +173,7 @@ sub encrypt {

if ( $Foswiki::cfg{Htpasswd}{Encoding} eq 'sha1' ) {
my $encodedPassword =
'{SHA}' . MIME::Base64::encode_base64( Digest::SHA::sha1($passwd) );
'{SHA}' . Digest::SHA::sha1_base64( $passwd );

# don't use chomp, it relies on $/
$encodedPassword =~ s/\s+$//;
Expand Down

0 comments on commit fd29a66

Please sign in to comment.