line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DKIM::Canonicalization::Base; |
2
|
14
|
|
|
14
|
|
4396
|
use strict; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
9502
|
|
3
|
14
|
|
|
14
|
|
75
|
use warnings; |
|
14
|
|
|
|
|
14405
|
|
|
14
|
|
|
|
|
668
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.20230911'; # VERSION |
5
|
|
|
|
|
|
|
# ABSTRACT: base class for canonicalization methods |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Copyright 2005-2007 Messiah College. All rights reserved. |
8
|
|
|
|
|
|
|
# Jason Long |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Copyright (c) 2004 Anthony D. Urso. All rights reserved. |
11
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
12
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
13
|
|
|
|
|
|
|
|
14
|
14
|
|
|
14
|
|
4489
|
use base 'Mail::DKIM::MessageParser'; |
|
14
|
|
|
|
|
30
|
|
|
14
|
|
|
|
|
10992
|
|
15
|
14
|
|
|
14
|
|
107
|
use Carp; |
|
14
|
|
|
|
|
26
|
|
|
14
|
|
|
|
|
5288
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
942
|
|
|
942
|
0
|
2244
|
my $class = shift; |
19
|
942
|
|
|
|
|
2438
|
return $class->new_object(@_); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub init { |
23
|
942
|
|
|
942
|
0
|
1444
|
my $self = shift; |
24
|
942
|
|
|
|
|
2356
|
$self->SUPER::init; |
25
|
|
|
|
|
|
|
|
26
|
942
|
50
|
33
|
|
|
5355
|
unless ( $self->{output} |
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
27
|
|
|
|
|
|
|
|| $self->{output_fh} |
28
|
|
|
|
|
|
|
|| $self->{output_digest} |
29
|
|
|
|
|
|
|
|| $self->{buffer} ) |
30
|
|
|
|
|
|
|
{ |
31
|
1
|
|
|
|
|
3
|
$self->{result} = ''; |
32
|
1
|
|
|
|
|
5
|
$self->{buffer} = \$self->{result}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub output { |
37
|
2777
|
|
|
2777
|
1
|
4488
|
my $self = shift; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# my ($output) = @_; # optimized away for speed |
40
|
|
|
|
|
|
|
|
41
|
2777
|
|
|
|
|
4809
|
my $out_fh = $self->{output_fh}; |
42
|
2777
|
50
|
|
|
|
5352
|
if ($out_fh) { |
43
|
0
|
|
|
|
|
0
|
print $out_fh @_; |
44
|
|
|
|
|
|
|
} |
45
|
2777
|
100
|
|
|
|
5988
|
if ( my $digest = $self->{output_digest} ) { |
46
|
2771
|
|
|
|
|
12384
|
$digest->add(@_); |
47
|
|
|
|
|
|
|
} |
48
|
2777
|
50
|
|
|
|
6370
|
if ( my $out_obj = $self->{output} ) { |
49
|
0
|
|
|
|
|
0
|
$out_obj->PRINT(@_); |
50
|
|
|
|
|
|
|
} |
51
|
2777
|
100
|
|
|
|
5194
|
if ( my $buffer = $self->{buffer} ) { |
52
|
6
|
|
|
|
|
8
|
${ $self->{buffer} } .= $_[0]; |
|
6
|
|
|
|
|
16
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# this supports Debug_Canonicalization |
56
|
2777
|
50
|
|
|
|
7980
|
if ( my $debug = $self->{Debug_Canonicalization} ) { |
57
|
0
|
0
|
|
|
|
0
|
if ( UNIVERSAL::isa( $debug, 'SCALAR' ) ) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
58
|
0
|
|
|
|
|
0
|
$$debug .= $_[0]; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
elsif ( UNIVERSAL::isa( $debug, 'GLOB' ) ) { |
61
|
0
|
|
|
|
|
0
|
print $debug @_; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
elsif ( UNIVERSAL::isa( $debug, 'IO::Handle' ) ) { |
64
|
0
|
|
|
|
|
0
|
$debug->print(@_); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub result { |
70
|
1
|
|
|
1
|
1
|
354
|
my $self = shift; |
71
|
1
|
|
|
|
|
4
|
return $self->{result}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |