line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::X509::Extension::ct_precert_scts; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
512
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Crypt::Perl::X509::Extension::ct_precert_scts - X.509 ct_precert_scts extension |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $extn = Crypt::Perl::X509::Extension::ct_precert_scts->new( |
15
|
|
|
|
|
|
|
{ |
16
|
|
|
|
|
|
|
log_id => .., |
17
|
|
|
|
|
|
|
timestamp => .., |
18
|
|
|
|
|
|
|
extensions => [ .. ], |
19
|
|
|
|
|
|
|
signature_algorithm => '..', |
20
|
|
|
|
|
|
|
}, |
21
|
|
|
|
|
|
|
# .. |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Instances of this class represent a C extension |
27
|
|
|
|
|
|
|
of an X.509 (SSL) certificate. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
You probably don’t need to |
30
|
|
|
|
|
|
|
instantiate this class directly; see L |
31
|
|
|
|
|
|
|
and L for the way this module is meant to be used. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SEE ALSO |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=over |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item * L |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item * L |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=back |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
6
|
use parent qw( |
46
|
|
|
|
|
|
|
Crypt::Perl::X509::Extension |
47
|
1
|
|
|
1
|
|
6
|
); |
|
1
|
|
|
|
|
3
|
|
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
1
|
|
485
|
use Crypt::Perl::X509::SCT (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
50
|
|
|
|
|
|
|
|
51
|
1
|
|
|
1
|
|
6
|
use constant OID => '1.3.6.1.4.1.11129.2.4.2'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
63
|
|
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
1
|
|
6
|
use constant ASN1 => <
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
227
|
|
54
|
|
|
|
|
|
|
ct_precert_scts ::= SignedCertificateTimestampList |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
SignedCertificateTimestampList ::= OCTET STRING |
57
|
|
|
|
|
|
|
END |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub new { |
60
|
6
|
|
|
6
|
0
|
32
|
my ($class, @sct_hrs) = @_; |
61
|
|
|
|
|
|
|
|
62
|
6
|
|
|
|
|
49
|
return bless \@sct_hrs, $class; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub _encode_params { |
66
|
6
|
|
|
6
|
|
34
|
my ($self) = @_; |
67
|
|
|
|
|
|
|
|
68
|
6
|
|
|
|
|
22
|
my @scts = map { Crypt::Perl::X509::SCT::encode(%$_) } @$self; |
|
12
|
|
|
|
|
85
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# Prefix with length. |
71
|
6
|
|
|
|
|
39
|
_tls_length_encode($_) for @scts; |
72
|
|
|
|
|
|
|
|
73
|
6
|
|
|
|
|
24
|
my $list = join( q<>, @scts ); |
74
|
|
|
|
|
|
|
|
75
|
6
|
|
|
|
|
13
|
_tls_length_encode($list); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub _tls_length_encode { |
79
|
18
|
|
|
18
|
|
61
|
substr( $_[0], 0, 0, pack('n', length $_[0]) ); |
80
|
|
|
|
|
|
|
|
81
|
18
|
|
|
|
|
51
|
return $_[0]; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |