| 1 | package Mail::DKIM::ARC::MessageSignature; | ||||||||||||||||||||||||||||
| 2 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 6 | our $VERSION = '1.20261116'; # VERSION | |||||||||||||||||||||||||||
| 5 | # ABSTRACT: Subclass of Mail::DKIM::Signature which represents a ARC-Message-Signature header | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | # Copyright 2017 FastMail Pty Ltd. All Rights Reserved. | ||||||||||||||||||||||||||||
| 8 | # Bron Gondwana <brong@fastmailteam.com> | ||||||||||||||||||||||||||||
| 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 | 6 | ▶ | use base 'Mail::DKIM::Signature'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 6 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 579 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||
| 18 | 579 | my $class = shift; | |||||||||||||||||||||||||||
| 19 | 579 | my %prms = @_; | |||||||||||||||||||||||||||
| 20 | 579 | my $self = {}; | |||||||||||||||||||||||||||
| 21 | 579 | bless $self, $class; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 579 | ▶ | $self->instance( $prms{'Instance'} ) if exists $prms{'Instance'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 579 | ▶ | $self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' ); | ||||||||||||||||||||||||||
|
Condition100%2/2
$prms{'Algorithm'} || 'rsa-sha256'
MC/DC100%1/1
$prms{'Algorithm'} || 'rsa-sha256'
$prms{'Algorithm'}
Truth table100%2/2
A
A= $prms{'Algorithm'}
| |||||||||||||||||||||||||||||
| 25 | 579 | $self->signature( $prms{'Signature'} ); | |||||||||||||||||||||||||||
| 26 | 579 | ▶ | $self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 579 | $self->domain( $prms{'Domain'} ); | |||||||||||||||||||||||||||
| 28 | 579 | $self->headerlist( $prms{'Headers'} ); | |||||||||||||||||||||||||||
| 29 | 579 | ▶ | $self->protocol( $prms{'Query'} ) if exists $prms{'Query'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | 579 | $self->selector( $prms{'Selector'} ); | |||||||||||||||||||||||||||
| 31 | 579 | ▶ | $self->timestamp( $prms{'Timestamp'} ) if defined $prms{'Timestamp'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 579 | ▶ | $self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 33 | 579 | ▶ | $self->tags( $prms{'Tags'} ) if defined $prms{'Tags'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 579 | ▶ | $self->key( $prms{'Key'} ) if defined $prms{'Key'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 579 | return $self; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 642 | ▶ | sub DEFAULT_PREFIX { | ||||||||||||||||||||||||||
|
Subroutine
DEFAULT_PREFIX: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 40 | 642 | return 'ARC-Message-Signature:'; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 1033 | ▶ | sub instance { | ||||||||||||||||||||||||||
|
Subroutine
instance: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||
| 45 | 1033 | my $self = shift; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | # ARC identities must be a number | ||||||||||||||||||||||||||||
| 48 | 1033 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | 42 | my $val = int(shift); | |||||||||||||||||||||||||||
| 50 | 42 | ▶ | die "INVALID instance $val" unless ( $val > 0 and $val < 1025 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$val > 0 and $val < 1025
MC/DC0%0/2
$val > 0 and $val < 1025
$val > 0
$val < 1025
Truth table33%1/3
A and B
A= $val > 0B= $val < 1025
| |||||||||||||||||||||||||||||
| 51 | 42 | $self->set_tag( 'i', $val ); | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 1033 | my $i = $self->get_tag('i'); | |||||||||||||||||||||||||||
| 55 | 1033 | return $i; | |||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 6 | 1; | |||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||