line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
require 5.002; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
4
|
2
|
|
|
2
|
|
10
|
use MIME::Decoder; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package MIME::Decoder::PGP; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
10
|
use vars qw(@ISA $VERSION $passPhrases); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
919
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
@ISA = qw(MIME::Decoder); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# The package version, both in 1.23 style *and* usable by MakeMaker: |
14
|
|
|
|
|
|
|
$VERSION = substr q$Revision: 1.1.1.1 $, 10; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#------------------------------ |
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
# decode_it IN, OUT |
20
|
|
|
|
|
|
|
# |
21
|
|
|
|
|
|
|
sub decode_it { |
22
|
0
|
|
|
0
|
1
|
|
my ($self, $in, $out) = @_; |
23
|
0
|
|
|
|
|
|
my($head) = $self->head(); |
24
|
0
|
0
|
|
|
|
|
if (!$head) { |
25
|
0
|
|
|
|
|
|
die "Missing MIME header"; |
26
|
|
|
|
|
|
|
} |
27
|
0
|
|
|
|
|
|
my($uid) = $head->mime_attr('content-transfer-encoding.uid'); |
28
|
0
|
0
|
|
|
|
|
if (!$uid) { |
29
|
0
|
|
|
|
|
|
die "Missing User ID (Attribute uid of header field" |
30
|
|
|
|
|
|
|
. " content-transfer-encoding)"; |
31
|
|
|
|
|
|
|
} |
32
|
0
|
0
|
|
|
|
|
if (!exists($MIME::Decoder::PGP::passPhrases->{$uid})) { |
33
|
0
|
|
|
|
|
|
die "Unknown User ID: $uid"; |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
$ENV{'PGPPASS'} = $MIME::Decoder::PGP::passPhrases->{$uid}; |
36
|
0
|
|
|
|
|
|
$self->filter($in, $out, "pgp -f +verbose=0"); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
#------------------------------ |
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
# encode_it IN, OUT |
42
|
|
|
|
|
|
|
# |
43
|
|
|
|
|
|
|
sub encode_it { |
44
|
0
|
|
|
0
|
1
|
|
my ($self, $in, $out) = @_; |
45
|
0
|
|
|
|
|
|
my($head) = $self->head(); |
46
|
0
|
0
|
|
|
|
|
if (!$head) { |
47
|
0
|
|
|
|
|
|
die "Missing MIME header"; |
48
|
|
|
|
|
|
|
} |
49
|
0
|
|
|
|
|
|
my($uid) = $head->mime_attr('content-transfer-encoding.uid'); |
50
|
0
|
0
|
|
|
|
|
if (!$uid) { |
51
|
0
|
|
|
|
|
|
die "Missing User ID (Attribute uid of header field" |
52
|
|
|
|
|
|
|
. " content-transfer-encoding)"; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
# Make uid shell safe |
55
|
0
|
|
|
|
|
|
$uid =~ s/([^\w])/\\$1/g; |
56
|
0
|
|
|
|
|
|
$self->filter($in, $out, "pgp -fea $uid +verbose=0"); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#------------------------------ |
61
|
|
|
|
|
|
|
# |
62
|
|
|
|
|
|
|
# pass_phrases [PASS_PHRASE_HASH] |
63
|
|
|
|
|
|
|
sub pass_phrases { |
64
|
0
|
|
|
0
|
0
|
|
my($self, $passPhraseHash) = @_; |
65
|
0
|
0
|
|
|
|
|
if (@_ > 1) { |
66
|
0
|
|
|
|
|
|
$MIME::Decoder::PGP::passPhrases = $passPhraseHash; |
67
|
|
|
|
|
|
|
} |
68
|
0
|
|
|
|
|
|
$MIME::Decoder::PGP::passPhrases; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
#------------------------------ |
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |