line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DKIM::ARC::Seal; |
2
|
3
|
|
|
3
|
|
21
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
94
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
120
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.20230630'; # VERSION |
5
|
|
|
|
|
|
|
# ABSTRACT: represents a ARC-Seal header |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Copyright 2017 FastMail Pty Ltd. All Rights Reserved. |
8
|
|
|
|
|
|
|
# Bron Gondwana |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
11
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
18
|
use base 'Mail::DKIM::ARC::MessageSignature'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1236
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
385
|
|
|
385
|
1
|
645
|
my $class = shift; |
18
|
385
|
|
|
|
|
734
|
my %prms = @_; |
19
|
385
|
|
|
|
|
649
|
my $self = {}; |
20
|
385
|
|
|
|
|
727
|
bless $self, $class; |
21
|
|
|
|
|
|
|
|
22
|
385
|
100
|
|
|
|
852
|
$self->instance( $prms{'Instance'} ) if exists $prms{'Instance'}; |
23
|
385
|
|
100
|
|
|
1734
|
$self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' ); |
24
|
385
|
|
|
|
|
1385
|
$self->signature( $prms{'Signature'} ); |
25
|
385
|
50
|
|
|
|
1006
|
$self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'}; |
26
|
385
|
|
100
|
|
|
1661
|
$self->chain( $prms{'Chain'} || 'none' ); |
27
|
385
|
|
|
|
|
1330
|
$self->domain( $prms{'Domain'} ); |
28
|
385
|
|
|
|
|
1472
|
$self->selector( $prms{'Selector'} ); |
29
|
|
|
|
|
|
|
$self->timestamp( |
30
|
385
|
100
|
|
|
|
1574
|
defined $prms{'Timestamp'} ? $prms{'Timestamp'} : time() ); |
31
|
385
|
50
|
|
|
|
854
|
$self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'}; |
32
|
385
|
100
|
|
|
|
748
|
$self->key( $prms{'Key'} ) if defined $prms{'Key'}; |
33
|
|
|
|
|
|
|
|
34
|
385
|
|
|
|
|
1003
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub body_hash { |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Not defined for ARC-Seal |
40
|
131
|
|
|
131
|
1
|
272
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub DEFAULT_PREFIX { |
44
|
442
|
|
|
442
|
0
|
1171
|
return 'ARC-Seal:'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub chain { |
49
|
385
|
|
|
385
|
1
|
579
|
my $self = shift; |
50
|
385
|
50
|
|
|
|
772
|
if (@_) { |
51
|
385
|
|
|
|
|
628
|
my $cv = shift; |
52
|
|
|
|
|
|
|
die "INVALID chain value $cv" |
53
|
385
|
50
|
|
|
|
574
|
unless grep { $cv eq $_ } qw(none fail pass); |
|
1155
|
|
|
|
|
2480
|
|
54
|
385
|
|
|
|
|
874
|
$self->set_tag( 'cv', $cv ); |
55
|
|
|
|
|
|
|
} |
56
|
385
|
|
|
|
|
841
|
return $self->get_tag('cv'); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub canonicalization { |
61
|
382
|
|
|
382
|
1
|
971
|
return ( 'seal', 'seal' ); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |