line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DKIM::Canonicalization::Base; |
2
|
14
|
|
|
14
|
|
119
|
use strict; |
|
14
|
|
|
|
|
30
|
|
|
14
|
|
|
|
|
5084
|
|
3
|
14
|
|
|
14
|
|
8717
|
use warnings; |
|
14
|
|
|
|
|
4383
|
|
|
14
|
|
|
|
|
5245
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.20230630'; # 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
|
|
3834
|
use base 'Mail::DKIM::MessageParser'; |
|
14
|
|
|
|
|
44
|
|
|
14
|
|
|
|
|
10646
|
|
15
|
14
|
|
|
14
|
|
104
|
use Carp; |
|
14
|
|
|
|
|
31
|
|
|
14
|
|
|
|
|
5151
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
942
|
|
|
942
|
0
|
2500
|
my $class = shift; |
19
|
942
|
|
|
|
|
2424
|
return $class->new_object(@_); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub init { |
23
|
942
|
|
|
942
|
0
|
1417
|
my $self = shift; |
24
|
942
|
|
|
|
|
2273
|
$self->SUPER::init; |
25
|
|
|
|
|
|
|
|
26
|
942
|
50
|
33
|
|
|
5204
|
unless ( $self->{output} |
|
|
|
66
|
|
|
|
|
|
|
|
66
|
|
|
|
|
27
|
|
|
|
|
|
|
|| $self->{output_fh} |
28
|
|
|
|
|
|
|
|| $self->{output_digest} |
29
|
|
|
|
|
|
|
|| $self->{buffer} ) |
30
|
|
|
|
|
|
|
{ |
31
|
1
|
|
|
|
|
3
|
$self->{result} = ''; |
32
|
1
|
|
|
|
|
4
|
$self->{buffer} = \$self->{result}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub output { |
37
|
2777
|
|
|
2777
|
1
|
4485
|
my $self = shift; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# my ($output) = @_; # optimized away for speed |
40
|
|
|
|
|
|
|
|
41
|
2777
|
|
|
|
|
4622
|
my $out_fh = $self->{output_fh}; |
42
|
2777
|
50
|
|
|
|
5419
|
if ($out_fh) { |
43
|
0
|
|
|
|
|
0
|
print $out_fh @_; |
44
|
|
|
|
|
|
|
} |
45
|
2777
|
100
|
|
|
|
6000
|
if ( my $digest = $self->{output_digest} ) { |
46
|
2771
|
|
|
|
|
12016
|
$digest->add(@_); |
47
|
|
|
|
|
|
|
} |
48
|
2777
|
50
|
|
|
|
6350
|
if ( my $out_obj = $self->{output} ) { |
49
|
0
|
|
|
|
|
0
|
$out_obj->PRINT(@_); |
50
|
|
|
|
|
|
|
} |
51
|
2777
|
100
|
|
|
|
5546
|
if ( my $buffer = $self->{buffer} ) { |
52
|
6
|
|
|
|
|
9
|
${ $self->{buffer} } .= $_[0]; |
|
6
|
|
|
|
|
17
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# this supports Debug_Canonicalization |
56
|
2777
|
50
|
|
|
|
7780
|
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
|
447
|
my $self = shift; |
71
|
1
|
|
|
|
|
6
|
return $self->{result}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |