line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ACME::Challenge::Pending; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Net::ACME::Challenge::Pending - base class for an unhandled challenge |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This base class encapsulates behavior to respond to unhandled challenges. |
12
|
|
|
|
|
|
|
To work with challenges that have been handled (successfully or not), |
13
|
|
|
|
|
|
|
see C. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Note that HTTP requests have some “helper” logic in the subclass |
16
|
|
|
|
|
|
|
C. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 METHODS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head2 $OBJ->make_key_authz( JWK_HR ) |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
JWK_HR is a hashref representation of the ACME registration key’s public JWK. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Returns a string to use as key authorization for the challenge. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
10
|
|
|
10
|
|
4190
|
use strict; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
283
|
|
29
|
10
|
|
|
10
|
|
47
|
use warnings; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
264
|
|
30
|
|
|
|
|
|
|
|
31
|
10
|
|
|
10
|
|
1281
|
use Net::ACME::Crypt (); |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
172
|
|
32
|
10
|
|
|
10
|
|
1236
|
use Net::ACME::Utils (); |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
2539
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
7
|
|
|
7
|
0
|
18491
|
my ( $class, %opts ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
7
|
|
|
|
|
100
|
Net::ACME::Utils::verify_token( $opts{'token'} ); |
38
|
|
|
|
|
|
|
|
39
|
7
|
|
|
|
|
21
|
return bless { map { ( "_$_" => $opts{$_} ) } qw(type token uri) }, $class; |
|
21
|
|
|
|
|
125
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub token { |
43
|
7
|
|
|
7
|
0
|
35
|
my ($self) = @_; |
44
|
7
|
|
|
|
|
98
|
return $self->{'_token'}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub uri { |
48
|
4
|
|
|
4
|
0
|
13
|
my ($self) = @_; |
49
|
4
|
|
|
|
|
21
|
return $self->{'_uri'}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub type { |
53
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
54
|
0
|
|
|
|
|
0
|
return $self->{'_type'}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub make_key_authz { |
58
|
4
|
|
|
4
|
1
|
18
|
my ( $self, $pub_jwk_hr ) = @_; |
59
|
|
|
|
|
|
|
|
60
|
4
|
|
|
|
|
12
|
my $eval_err = $@; |
61
|
|
|
|
|
|
|
|
62
|
4
|
|
|
|
|
24
|
my $jwk_thumbprint = Net::ACME::Crypt::get_jwk_thumbprint( $pub_jwk_hr ); |
63
|
|
|
|
|
|
|
|
64
|
4
|
|
|
|
|
103468
|
return "$self->{'_token'}.$jwk_thumbprint"; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |