view Lib/IMPL/Security/Auth.pm @ 54:f4e045e47770

commit
author wizard@linux-odin.local
date Tue, 02 Mar 2010 20:15:57 +0300 (2010-03-02)
parents 15d720913562
children 739f1288ca84
line wrap: on
line source
package IMPL::Security::Auth;

use Digest::MD5 qw(md5_hex);

use constant {
	AUTH_SUCCESS => 1,
	AUTH_INCOMPLETE => 2,
	AUT_FAIL => 3	
};

use base qw(Exporter);

our @EXPORT_OK = qw(&AUTH_SUCCESS &AUTH_INCOMPLETE &AUTH_FAIL &GenSSID);
our %EXPORT_TAGS = (Const => [qw(&AUTH_SUCCESS &AUTH_INCOMPLETE &AUTH_FAIL)]);

{
    my $i = 0;
    sub GenSSID() {
        return md5_hex(time,rand,$i++);
    }
}

1;

__END__

=pod

=head1 DESCRIPTION

�������� ������ ��� ����������� �������������.

������� ����������� ������� �� ��������� �����

1. ������ ���������� �� ������ ������ ��� ����������� � ���������� �����������.
2. ������ �������� ������, ������� ������ �������������� ��� �������,
���������� ��������������
3. ������ �������������� ���������� ���������, �� ������ ��������
���� ����������� �������� ������������, ���� ������������ ������� ��������������

���������� �������� ������������ �������� ������ ��� ������� � ������ ��������������,
� ������ ���������� ���������� �������� ������, �������� �������������, ��������� �����
� �.�. 

����� �������������� ������ ����� ��������� ���������

=over

=item C<CTOR($SecData)>

������� ����� ��� ����������� �� ������ ������ ������������ ��� ������������

=item C<< $obj->DoAuth($Challenge) >>

���������� �������������� ������������ � ������������� ������, ���������� ��������� ��������������, � ���� ������� ($status,$challenge).

=item C<< $obj->ValidateSession($Challenge) >>

���������� �������������� ������, ���������� ��������� ��������������, � ���� ������� ($status,$challenge).

=cut