line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::ASN1; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#Wrappers around basic methods to get exceptions thrown on errors. |
4
|
|
|
|
|
|
|
|
5
|
14
|
|
|
14
|
|
77
|
use strict; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
297
|
|
6
|
14
|
|
|
14
|
|
53
|
use warnings; |
|
14
|
|
|
|
|
21
|
|
|
14
|
|
|
|
|
321
|
|
7
|
|
|
|
|
|
|
|
8
|
14
|
|
|
14
|
|
367
|
use parent 'Convert::ASN1'; |
|
14
|
|
|
|
|
239
|
|
|
14
|
|
|
|
|
68
|
|
9
|
|
|
|
|
|
|
|
10
|
14
|
|
|
14
|
|
406457
|
use Crypt::Perl::BigInt (); |
|
14
|
|
|
|
|
41
|
|
|
14
|
|
|
|
|
225
|
|
11
|
14
|
|
|
14
|
|
62
|
use Crypt::Perl::X (); |
|
14
|
|
|
|
|
59
|
|
|
14
|
|
|
|
|
3306
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
2165
|
|
|
2165
|
1
|
6149
|
my ($class, @opts) = @_; |
15
|
|
|
|
|
|
|
|
16
|
2165
|
|
|
|
|
24632
|
return $class->SUPER::new( |
17
|
|
|
|
|
|
|
encode => { bigint => 'Crypt::Perl::BigInt' }, |
18
|
|
|
|
|
|
|
decode => { bigint => 'Crypt::Perl::BigInt' }, |
19
|
|
|
|
|
|
|
@opts, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub prepare { |
24
|
2165
|
|
|
2165
|
1
|
92885
|
my ( $self, $asn1_r ) = ( $_[0], \$_[1] ); |
25
|
|
|
|
|
|
|
|
26
|
2165
|
|
|
|
|
9681
|
my $ret = $self->SUPER::prepare($$asn1_r); |
27
|
|
|
|
|
|
|
|
28
|
2165
|
50
|
|
|
|
17902700
|
if ( !defined $ret ) { |
29
|
0
|
|
|
|
|
0
|
die Crypt::Perl::X::create('ASN1::Prepare', $$asn1_r, $self->error()); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
2165
|
|
|
|
|
12357
|
return $ret; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub find { |
36
|
1676
|
|
|
1676
|
1
|
5915
|
my ( $self, $macro ) = @_; |
37
|
|
|
|
|
|
|
|
38
|
1676
|
|
33
|
|
|
8705
|
return $self->SUPER::find($macro) || do { |
39
|
|
|
|
|
|
|
die Crypt::Perl::X::create('ASN1::Find', $macro, $self->error()); |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub encode { |
44
|
1064
|
|
|
1064
|
1
|
409980
|
my ($self) = shift; |
45
|
|
|
|
|
|
|
|
46
|
1064
|
|
33
|
|
|
6064
|
return $self->SUPER::encode(@_) || do { |
47
|
|
|
|
|
|
|
die Crypt::Perl::X::create('ASN1::Encode', \@_, $self->error()); |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub decode { |
52
|
1105
|
|
|
1105
|
1
|
2918
|
my ($self) = shift; |
53
|
|
|
|
|
|
|
|
54
|
1105
|
|
66
|
|
|
6132
|
return $self->SUPER::decode($_[0]) || do { |
55
|
|
|
|
|
|
|
die Crypt::Perl::X::create('ASN1::Decode', $_[0], $self->error()); |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
my $_asn1_null; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub NULL { |
62
|
14
|
|
66
|
14
|
0
|
486
|
return $_asn1_null ||= Crypt::Perl::ASN1->new()->prepare('n NULL')->encode( { n => 0 } ); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |