line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::X509::Extension::cRLDistributionPoints; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
627
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
15
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Crypt::Perl::X509::Extension::cRLDistributionPoints |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SEE ALSO |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
L |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
5
|
use parent qw( Crypt::Perl::X509::Extension ); |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
5
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
56
|
use Crypt::Perl::ASN1::BitString (); |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
38
|
|
21
|
1
|
|
|
1
|
|
16
|
use Crypt::Perl::X509::GeneralNames (); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
26
|
|
22
|
1
|
|
|
1
|
|
5
|
use Crypt::Perl::X509::RelativeDistinguishedName (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use constant { |
25
|
1
|
|
|
|
|
110
|
OID => '2.5.29.31', |
26
|
|
|
|
|
|
|
CRITICAL => 0, |
27
|
1
|
|
|
1
|
|
6
|
}; |
|
1
|
|
|
|
|
3
|
|
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
1
|
|
22
|
use constant ASN1 => Crypt::Perl::X509::GeneralNames::ASN1() . <
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
538
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
DistributionPointName ::= CHOICE { |
32
|
|
|
|
|
|
|
fullName ANY, -- [0] GeneralNames |
33
|
|
|
|
|
|
|
nameRelativeToCRLIssuer ANY -- [1] RelativeDistinguishedName |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
DistributionPoint ::= SEQUENCE { |
37
|
|
|
|
|
|
|
distributionPoint [0] DistributionPointName OPTIONAL, |
38
|
|
|
|
|
|
|
reasons [1] BIT STRING OPTIONAL, |
39
|
|
|
|
|
|
|
cRLIssuer ANY OPTIONAL -- [2] GeneralNames OPTIONAL |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
cRLDistributionPoints ::= SEQUENCE OF DistributionPoint |
43
|
|
|
|
|
|
|
END |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my @_ReasonFlags = qw( |
46
|
|
|
|
|
|
|
unused |
47
|
|
|
|
|
|
|
keyCompromise |
48
|
|
|
|
|
|
|
cACompromise |
49
|
|
|
|
|
|
|
affiliationChanged |
50
|
|
|
|
|
|
|
superseded |
51
|
|
|
|
|
|
|
cessationOfOperation |
52
|
|
|
|
|
|
|
certificateHold |
53
|
|
|
|
|
|
|
privilegeWithdrawn |
54
|
|
|
|
|
|
|
aACompromise |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub new { |
58
|
12
|
|
|
12
|
0
|
78
|
my ($class, @points) = @_; |
59
|
|
|
|
|
|
|
|
60
|
12
|
|
|
|
|
44
|
my @self; |
61
|
|
|
|
|
|
|
|
62
|
12
|
|
|
|
|
58
|
for my $p (@points) { |
63
|
24
|
|
|
|
|
140
|
my %pp = %$p; |
64
|
24
|
|
|
|
|
71
|
push @self, \%pp; |
65
|
|
|
|
|
|
|
|
66
|
24
|
50
|
|
|
|
85
|
if ( $pp{'distributionPoint'} ) { |
67
|
24
|
|
|
|
|
59
|
my $dp = $pp{'distributionPoint'}; |
68
|
|
|
|
|
|
|
|
69
|
24
|
100
|
|
|
|
98
|
if ($dp->{'fullName'}) { |
|
|
50
|
|
|
|
|
|
70
|
12
|
|
|
|
|
28
|
my $gns = Crypt::Perl::X509::GeneralNames->new( @{ $pp{'distributionPoint'}{'fullName'} } ); |
|
12
|
|
|
|
|
85
|
|
71
|
|
|
|
|
|
|
|
72
|
12
|
|
|
|
|
58
|
$pp{'distributionPoint'} = { |
73
|
|
|
|
|
|
|
fullName => $gns->encode(), |
74
|
|
|
|
|
|
|
}; |
75
|
|
|
|
|
|
|
|
76
|
12
|
|
|
|
|
1278
|
substr( $pp{'distributionPoint'}{'fullName'}, 0, 1, "\xa0" ); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
elsif ($dp->{'nameRelativeToCRLIssuer'}) { |
79
|
12
|
|
|
|
|
27
|
my $rdn = Crypt::Perl::X509::RelativeDistinguishedName->new( @{ $dp->{'nameRelativeToCRLIssuer'} } ); |
|
12
|
|
|
|
|
108
|
|
80
|
|
|
|
|
|
|
|
81
|
12
|
|
|
|
|
57
|
$pp{'distributionPoint'} = { |
82
|
|
|
|
|
|
|
nameRelativeToCRLIssuer => $rdn->encode(), |
83
|
|
|
|
|
|
|
}; |
84
|
|
|
|
|
|
|
|
85
|
12
|
|
|
|
|
4132
|
substr( $pp{'distributionPoint'}{'nameRelativeToCRLIssuer'}, 0, 1, "\xa1" ); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
else { |
88
|
0
|
|
|
|
|
0
|
my @keys = keys %$dp; |
89
|
0
|
|
|
|
|
0
|
die Crypt::Perl::X::create('Generic', "Unrecognized “distributionPoint” hash! (@keys)"); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
24
|
100
|
|
|
|
99
|
if ( $pp{'reasons'} ) { |
94
|
|
|
|
|
|
|
$pp{'reasons'} = Crypt::Perl::ASN1::BitString::encode( |
95
|
|
|
|
|
|
|
\@_ReasonFlags, |
96
|
12
|
|
|
|
|
63
|
$pp{'reasons'}, |
97
|
|
|
|
|
|
|
); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
24
|
100
|
|
|
|
84
|
if ( $pp{'cRLIssuer'} ) { |
101
|
12
|
|
|
|
|
32
|
$pp{'cRLIssuer'} = Crypt::Perl::X509::GeneralNames->new( @{ $pp{'cRLIssuer'} } )->encode(); |
|
12
|
|
|
|
|
54
|
|
102
|
12
|
|
|
|
|
1096
|
substr( $pp{'cRLIssuer'}, 0, 1, "\xa2" ); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
12
|
|
|
|
|
85
|
return bless \@self, $class; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub _encode_params { |
110
|
12
|
|
|
12
|
|
60
|
my ($self) = @_; |
111
|
|
|
|
|
|
|
|
112
|
12
|
|
|
|
|
61
|
return [ @$self ]; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
1; |