line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::OpenPGP::Constants; |
2
|
7
|
|
|
7
|
|
36
|
use strict; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
256
|
|
3
|
|
|
|
|
|
|
|
4
|
7
|
|
|
7
|
|
36
|
use vars qw( %CONSTANTS ); |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
699
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
%CONSTANTS = ( |
7
|
|
|
|
|
|
|
'PGP_PKT_PUBKEY_ENC' => 1, |
8
|
|
|
|
|
|
|
'PGP_PKT_SIGNATURE' => 2, |
9
|
|
|
|
|
|
|
'PGP_PKT_SYMKEY_ENC' => 3, |
10
|
|
|
|
|
|
|
'PGP_PKT_ONEPASS_SIG' => 4, |
11
|
|
|
|
|
|
|
'PGP_PKT_SECRET_KEY' => 5, |
12
|
|
|
|
|
|
|
'PGP_PKT_PUBLIC_KEY' => 6, |
13
|
|
|
|
|
|
|
'PGP_PKT_SECRET_SUBKEY' => 7, |
14
|
|
|
|
|
|
|
'PGP_PKT_COMPRESSED' => 8, |
15
|
|
|
|
|
|
|
'PGP_PKT_ENCRYPTED' => 9, |
16
|
|
|
|
|
|
|
'PGP_PKT_MARKER' => 10, |
17
|
|
|
|
|
|
|
'PGP_PKT_PLAINTEXT' => 11, |
18
|
|
|
|
|
|
|
'PGP_PKT_RING_TRUST' => 12, |
19
|
|
|
|
|
|
|
'PGP_PKT_USER_ID' => 13, |
20
|
|
|
|
|
|
|
'PGP_PKT_PUBLIC_SUBKEY' => 14, |
21
|
|
|
|
|
|
|
'PGP_PKT_ENCRYPTED_MDC' => 18, |
22
|
|
|
|
|
|
|
'PGP_PKT_MDC' => 19, |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
'DEFAULT_CIPHER' => 2, |
25
|
|
|
|
|
|
|
'DEFAULT_DIGEST' => 2, |
26
|
|
|
|
|
|
|
'DEFAULT_COMPRESS' => 1, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
7
|
|
|
7
|
|
37
|
use vars qw( %TAGS ); |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
1640
|
|
30
|
|
|
|
|
|
|
my %RULES = ( |
31
|
|
|
|
|
|
|
'^PGP_PKT' => 'packet', |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
for my $re (keys %RULES) { |
35
|
|
|
|
|
|
|
$TAGS{ $RULES{$re} } = [ grep /$re/, keys %CONSTANTS ]; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub import { |
39
|
13
|
|
|
13
|
|
29
|
my $class = shift; |
40
|
|
|
|
|
|
|
|
41
|
13
|
|
|
|
|
20
|
my @to_export; |
42
|
13
|
|
|
|
|
35
|
my @args = @_; |
43
|
13
|
|
|
|
|
26
|
for my $item (@args) { |
44
|
0
|
|
|
|
|
0
|
push @to_export, |
45
|
41
|
50
|
|
|
|
130
|
$item =~ s/^:// ? @{ $TAGS{$item} } : $item; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
7
|
|
|
7
|
|
41
|
no strict 'refs'; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
1308
|
|
49
|
13
|
|
|
|
|
41
|
my $pkg = caller; |
50
|
13
|
|
|
|
|
26
|
for my $con (@to_export) { |
51
|
41
|
50
|
|
|
|
110
|
warn __PACKAGE__, " does not export the constant '$con'" |
52
|
|
|
|
|
|
|
unless exists $CONSTANTS{$con}; |
53
|
41
|
|
|
0
|
|
507
|
*{"${pkg}::$con"} = sub () { $CONSTANTS{$con} } |
|
0
|
|
|
|
|
|
|
54
|
41
|
|
|
|
|
129
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
__END__ |