| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Authen::SASL::Perl::CRAM_MD5; |
|
6
|
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
27
|
use strict; |
|
|
2
|
|
|
|
|
19
|
|
|
|
2
|
|
|
|
|
31
|
|
|
8
|
2
|
|
|
2
|
|
31
|
use vars qw($VERSION @ISA); |
|
|
2
|
|
|
|
|
17
|
|
|
|
2
|
|
|
|
|
59
|
|
|
9
|
2
|
|
|
2
|
|
48
|
use Digest::HMAC_MD5 qw(hmac_md5_hex); |
|
|
2
|
|
|
|
|
20
|
|
|
|
2
|
|
|
|
|
33
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$VERSION = "1.03"; |
|
12
|
|
|
|
|
|
|
@ISA = qw(Authen::SASL::Perl); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my %secflags = ( |
|
15
|
|
|
|
|
|
|
noplaintext => 1, |
|
16
|
|
|
|
|
|
|
noanonymous => 1, |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
37
|
|
|
37
|
|
471
|
sub _order { 2 } |
|
20
|
|
|
|
|
|
|
sub _secflags { |
|
21
|
12
|
|
|
12
|
|
105
|
shift; |
|
22
|
12
|
|
|
|
|
157
|
scalar grep { $secflags{$_} } @_; |
|
|
2
|
|
|
|
|
30
|
|
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
5
|
|
|
5
|
0
|
55
|
sub mechanism { 'CRAM-MD5' } |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub client_start { |
|
28
|
1
|
|
|
1
|
0
|
40
|
''; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub client_step { |
|
32
|
1
|
|
|
1
|
0
|
12
|
my ($self, $string) = @_; |
|
33
|
2
|
|
|
|
|
30
|
my ($user, $pass) = map { |
|
34
|
1
|
|
|
|
|
9
|
my $v = $self->_call($_); |
|
35
|
2
|
50
|
|
|
|
665
|
defined($v) ? $v : '' |
|
36
|
|
|
|
|
|
|
} qw(user pass); |
|
37
|
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
36
|
$user . " " . hmac_md5_hex($string,$pass); |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Authen::SASL::Perl::CRAM_MD5 - CRAM MD5 Authentication class |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
use Authen::SASL qw(Perl); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$sasl = Authen::SASL->new( |
|
54
|
|
|
|
|
|
|
mechanism => 'CRAM-MD5', |
|
55
|
|
|
|
|
|
|
callback => { |
|
56
|
|
|
|
|
|
|
user => $user, |
|
57
|
|
|
|
|
|
|
pass => $pass |
|
58
|
|
|
|
|
|
|
}, |
|
59
|
|
|
|
|
|
|
); |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This method implements the client part of the CRAM-MD5 SASL algorithm, |
|
64
|
|
|
|
|
|
|
as described in RFC 2195 resp. in IETF Draft draft-ietf-sasl-crammd5-02.txt |
|
65
|
|
|
|
|
|
|
from January 2004. |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 CALLBACK |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
The callbacks used are: |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=over 4 |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item user |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
The username to be used for authentication |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item pass |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
The user's password to be used for authentication |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=back |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L<Authen::SASL>, |
|
86
|
|
|
|
|
|
|
L<Authen::SASL::Perl> |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHORS |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Software written by Graham Barr <gbarr@pobox.com>, |
|
91
|
|
|
|
|
|
|
documentation written by Peter Marschall <peter@adpm.de>. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Please report any bugs, or post any suggestions, to the perl-ldap mailing list |
|
94
|
|
|
|
|
|
|
<perl-ldap@perl.org> |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Copyright (c) 2002-2004 Graham Barr. |
|
99
|
|
|
|
|
|
|
All rights reserved. This program is free software; you can redistribute |
|
100
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Documentation Copyright (c) 2004 Peter Marschall. |
|
103
|
|
|
|
|
|
|
All rights reserved. This documentation is distributed, |
|
104
|
|
|
|
|
|
|
and may be redistributed, under the same terms as Perl itself. |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
|
107
|
|
|
|
|
|
|
|