ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/login.ext
(Generate patch)

Comparing deliantra/server/ext/login.ext (file contents):
Revision 1.116 by root, Wed May 4 07:36:40 2011 UTC vs.
Revision 1.118 by root, Thu Nov 8 00:16:07 2012 UTC

3# login handling 3# login handling
4 4
5use Fcntl; 5use Fcntl;
6use Coro::AIO; 6use Coro::AIO;
7 7
8our $MAX_DISCONNECT_TIME = $cf::CFG{max_disconnect_time} || 3600; 8CONF MAX_DISCONNECT_TIME = 3600;
9 9
10# paranoia function to overwrite a string-in-place 10# paranoia function to overwrite a string-in-place
11sub nuke_str { 11sub nuke_str {
12 substr $_[0], 0, (length $_[0]), "x" x length $_[0] 12 substr $_[0], 0, (length $_[0]), "x" x length $_[0]
13} 13}
140} 140}
141 141
142sub compare_password($$) { 142sub compare_password($$) {
143 my ($pass, $token) = @_; 143 my ($pass, $token) = @_;
144 144
145 if ($token =~ /\!(.*)/) { 145 if ($token =~ /!!(.*)/) {
146 return +(substr $pass, 0, 8) eq pack "H*", $1;
147 } elsif ($token =~ /!(.*)/) {
146 return $pass eq pack "H*", $1; 148 return $pass eq pack "H*", $1;
147 } else { 149 } else {
148 return $token eq crypt $pass, $token; 150 return $token eq crypt $pass, $token;
149 } 151 }
150} 152}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines