From f1923f8e85501143d0be63d872c726159440f6c1 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Wed, 13 Jul 2005 10:56:58 +0000 Subject: Bug 300336: Bugzilla::Auth should not contain any exported subroutines Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- Bugzilla/Auth.pm | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'Bugzilla/Auth.pm') diff --git a/Bugzilla/Auth.pm b/Bugzilla/Auth.pm index 91a0abf83..887caf049 100644 --- a/Bugzilla/Auth.pm +++ b/Bugzilla/Auth.pm @@ -23,8 +23,6 @@ package Bugzilla::Auth; use strict; -use base qw(Exporter); -@Bugzilla::Auth::EXPORT = qw(bz_crypt); use Bugzilla::Config; use Bugzilla::Constants; @@ -44,31 +42,6 @@ BEGIN { } } -sub bz_crypt ($) { - my ($password) = @_; - - # The list of characters that can appear in a salt. Salts and hashes - # are both encoded as a sequence of characters from a set containing - # 64 characters, each one of which represents 6 bits of the salt/hash. - # The encoding is similar to BASE64, the difference being that the - # BASE64 plus sign (+) is replaced with a forward slash (/). - my @saltchars = (0..9, 'A'..'Z', 'a'..'z', '.', '/'); - - # Generate the salt. We use an 8 character (48 bit) salt for maximum - # security on systems whose crypt uses MD5. Systems with older - # versions of crypt will just use the first two characters of the salt. - my $salt = ''; - for ( my $i=0 ; $i < 8 ; ++$i ) { - $salt .= $saltchars[rand(64)]; - } - - # Crypt the password. - my $cryptedpassword = crypt($password, $salt); - - # Return the crypted password. - return $cryptedpassword; -} - # PRIVATE # A number of features, like password change requests, require the DB @@ -160,11 +133,6 @@ __END__ Bugzilla::Auth - Authentication handling for Bugzilla users -=head1 SYNOPSIS - - # Class Functions - $crypted = bz_crypt($password); - =head1 DESCRIPTION Handles authentication for Bugzilla users. @@ -184,23 +152,6 @@ authentication or login modules. =over 4 -=item C - -Takes a string and returns a Ced value for it, using a random salt. - -Please always use this function instead of the built-in perl "crypt" -when initially encrypting a password. - -=begin undocumented - -Random salts are generated because the alternative is usually -to use the first two characters of the password itself, and since -the salt appears in plaintext at the beginning of the encrypted -password string this has the effect of revealing the first two -characters of the password to anyone who views the encrypted version. - -=end undocumented - =item C Given an ip address, this returns the associated network address, using -- cgit v1.2.3-24-g4f1b