sha1_to_sha.patch

Ales Zabala Alava, 2012-02-15 12:10

Download (1.1 KB)

View differences:

Redmine.pm (working copy)
99 99
use warnings FATAL => 'all', NONFATAL => 'redefine';
100 100

  
101 101
use DBI;
102
use Digest::SHA1;
102
use Digest::SHA;
103 103
# optional module for LDAP authentication
104 104
my $CanUseLDAPAuth = eval("use Authen::Simple::LDAP; 1");
105 105

  
......
327 327
  my $dbh         = connect_database($r);
328 328
  my $project_id  = get_project_identifier($r);
329 329

  
330
  my $pass_digest = Digest::SHA1::sha1_hex($redmine_pass);
330
  my $pass_digest = Digest::SHA::sha1_hex($redmine_pass);
331 331

  
332 332
  my $access_mode = defined $read_only_methods{$r->method} ? "R" : "W";
333 333

  
......
346 346

  
347 347
      unless ($auth_source_id) {
348 348
	  			my $method = $r->method;
349
          my $salted_password = Digest::SHA1::sha1_hex($salt.$pass_digest);
349
          my $salted_password = Digest::SHA::sha1_hex($salt.$pass_digest);
350 350
					if ($hashed_password eq $salted_password && (($access_mode eq "R" && $permissions =~ /:browse_repository/) || $permissions =~ /:commit_access/) ) {
351 351
              $ret = 1;
352 352
              last;