| 1 | package CGI::Application::Plugin::Authentication::Driver::Filter::crypt; | ||||||||||
| 2 | 3 | $CGI::Application::Plugin::Authentication::Driver::Filter::crypt::VERSION = '0.21'; | |||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | sub check { | ||||||||||
| 7 | 2 | ▶ | my $class = shift; | ||||||||
|
Subroutine
check: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 8 | 2 | my $param = shift; | |||||||||
| 9 | 2 | my $plain = shift; | |||||||||
| 10 | 2 | my $filtered = shift; | |||||||||
| 11 | |||||||||||
| 12 | 2 | ▶ | return ( $class->filter( $param, $plain, $filtered ) eq $filtered ) ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | sub filter { | ||||||||||
| 16 | 20 | ▶ | my ($class, undef, $plain, $salt) = @_; | ||||||||
|
Subroutine
filter: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 17 | 20 | ▶ | if (!$salt) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 13 | my @alphabet = ( '.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z' ); | |||||||||
| 19 | 13 | $salt = join '', @alphabet[ rand 64, rand 64 ]; | |||||||||
| 20 | } | ||||||||||
| 21 | 20 | return crypt( $plain, $salt ); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 3 | 1; | |||||||||
| 25 | __END__ | ||||||||||