Authen-Passphrase
view release on metacpan or search on metacpan
lib/Authen/Passphrase/LANManager.pm view on Meta::CPAN
}
=item $ppr->first_half
Returns the hash of the first half of the passphrase, as an
L<Authen::Passphrase::LANManagerHalf> passphrase recogniser.
=cut
sub first_half {
my($self) = @_;
return $self->{first_half};
}
=item $ppr->second_half
Returns the hash of the second half of the passphrase, as an
L<Authen::Passphrase::LANManagerHalf> passphrase recogniser.
=cut
sub second_half {
my($self) = @_;
return $self->{second_half};
}
=item $ppr->match(PASSPHRASE)
=item $ppr->as_rfc2307
These methods are part of the standard L<Authen::Passphrase> interface.
=cut
sub _passphrase_acceptable {
my($self, $passphrase) = @_;
return $passphrase =~ /\A[\x00-\xff]{0,14}\z/;
}
sub match {
my($self, $passphrase) = @_;
return $self->_passphrase_acceptable($passphrase) &&
$self->{first_half}->match(substr($passphrase, 0, 7)) &&
$self->{second_half}->match(
length($passphrase) > 7 ?
substr($passphrase, 7, 7) :
"");
}
sub as_rfc2307 {
my($self) = @_;
return "{LANMAN}".$self->hash_hex;
}
=back
=head1 SEE ALSO
L<Authen::Passphrase>,
L<Authen::Passphrase::LANManagerHalf>,
L<Crypt::DES>
=head1 AUTHOR
Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
Copyright (C) 2006, 2007, 2009, 2010, 2012
Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1;
( run in 2.188 seconds using v1.01-cache-2.11-cpan-5a3173703d6 )