line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenID::Lite::SessionHandler::NoEncryption; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use Any::Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
extends 'OpenID::Lite::SessionHandler'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
533
|
use MIME::Base64 (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use OpenID::Lite::Constants::AssocType qw(HMAC_SHA1 HMAC_SHA256); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
63
|
|
9
|
1
|
|
|
1
|
|
5
|
use OpenID::Lite::Constants::SessionType qw(NO_ENCRYPTION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
334
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has '+_session_type' => ( |
12
|
|
|
|
|
|
|
default => NO_ENCRYPTION, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has '+_allowed_assoc_types' => ( |
16
|
|
|
|
|
|
|
default => sub { [ HMAC_SHA1, HMAC_SHA256 ] }, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
override 'set_request_params' => sub { |
20
|
|
|
|
|
|
|
my ( $self, $service, $params ) = @_; |
21
|
|
|
|
|
|
|
unless ( $service->requires_compatibility_mode ) { |
22
|
|
|
|
|
|
|
$params->set( session_type => $self->_session_type ); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
return $params; |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
override 'set_response_params' => sub { |
28
|
|
|
|
|
|
|
my ( $self, $req_params, $res_params, $association ) = @_; |
29
|
|
|
|
|
|
|
my $secret = MIME::Base64::encode_base64( $association->secret ); |
30
|
|
|
|
|
|
|
$secret =~ s/\s+//g; |
31
|
|
|
|
|
|
|
$res_params->set( mac_key => $secret ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
unless ( $res_params->is_openid1 ) { |
34
|
|
|
|
|
|
|
$res_params->set( session_type => $self->_session_type ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
override 'extract_secret' => sub { |
39
|
|
|
|
|
|
|
my ( $self, $params ) = @_; |
40
|
|
|
|
|
|
|
my $mac_key = $params->get('mac_key') |
41
|
|
|
|
|
|
|
or return $self->ERROR(q{Missing parameter, "mac_key".}); |
42
|
|
|
|
|
|
|
return MIME::Base64::decode_base64( $mac_key ); |
43
|
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
1
|
|
5
|
no Any::Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
46
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|