line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Passwd::XS; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.601'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
require XSLoader; |
6
|
|
|
|
|
|
|
XSLoader::load( 'Crypt::Passwd::XS', $VERSION ); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub crypt { |
9
|
25
|
|
|
25
|
0
|
17377
|
my $password = shift; |
10
|
25
|
|
|
|
|
50
|
my $salt = shift; |
11
|
25
|
100
|
|
|
|
89
|
return unless $salt; |
12
|
23
|
|
|
|
|
49
|
my $crypt_type = substr( $salt, 0, 3 ); |
13
|
23
|
100
|
|
|
|
164
|
if ( $crypt_type eq '$1$' ) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
14
|
2
|
|
|
|
|
2126
|
return unix_md5_crypt( $password, $salt ); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
elsif ( $crypt_type eq '$6$' ) { |
17
|
7
|
|
|
|
|
844063
|
return unix_sha512_crypt( $password, $salt ); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
elsif ( $crypt_type eq '$5$' ) { |
20
|
7
|
|
|
|
|
982869
|
return unix_sha256_crypt( $password, $salt ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
elsif ( substr( $salt, 0, 1 ) ne '$' ) { |
23
|
6
|
|
|
|
|
1023
|
return unix_des_crypt( $password, $salt ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
elsif ( substr( $salt, 0, 6 ) eq '$apr1$' ) { |
26
|
1
|
|
|
|
|
1165
|
return apache_md5_crypt( $password, $salt ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else { |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Unimplemented hashing scheme |
31
|
0
|
|
|
|
|
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |