« blib/lib/CGI/Application/Plugin/Authentication/Store/Cookie.pm
↑ Summary
blib/lib/CGI/Application/Plugin/Authentication/Store/Session.pm »
| 1 | package CGI::Application::Plugin::Authentication::Driver::Filter::crypt; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | 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 = shift; | ||||||||
|
Subroutine
filter: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||
| 17 | 20 | my $param = lc shift; | |||||||||
| 18 | 20 | ▶ | if (!defined $param) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | $param = 'hex'; | |||||||||
| 20 | } | ||||||||||
| 21 | 20 | my $plain = shift; | |||||||||
| 22 | 20 | my $salt = shift; | |||||||||
| 23 | 20 | ▶ | if (!$salt) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 13 | my @alphabet = ( '.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z' ); | |||||||||
| 25 | 13 | $salt = join '', @alphabet[ rand 64, rand 64 ]; | |||||||||
| 26 | } | ||||||||||
| 27 | 20 | return crypt( $plain, $salt ); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 4 | 1; | |||||||||
| 31 | __END__ | ||||||||||