lib/VOMS/Lite/KEY.pm

filter: Statementstmt 71.2% 52 / 73 Branchbran 66.6% 28 / 42 Conditioncond 62.9% 17 / 27 MC/DCmcdc 44.4% 8 / 18 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 66.2% 110 / 166 CC 32 SCAR 42.3
CC
32
Cov
68%
Examine
77.6
BEGIN
1.0
BEGIN
1.0
CRAP 69.0
« lib/VOMS/Lite/RSAKey.pm ↑ Summary script/voms-server.pl »
1 package VOMS::Lite::KEY;
2  
3 1 ▶use 5.004;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use VOMS::Lite::ASN1Helper qw(ASN1Index ASN1Unwrap);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 require Exporter;
9 1 ▶use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 @ISA = qw(Exporter);
11  
12 1 $VERSION = '0.20';
13  
14 4 ▶sub Examine {
Subroutine Examine: called CC=32 SCAR=43.5
Pod undocumented
15  
16 4 my ($decoded,$dataref)=@_;
17 4 my %Values=%$dataref;
18 4 my @ASN1Index=ASN1Index($decoded);
19  
20 4 my $index=0;
21 4 my $ignoreuntil=0;
22 4 my ($Keyversion,$Keymodulus,$KeypublicExponent,$KeyprivateExponent,$Keyprime1,$Keyprime2,$Keyexponent1,$Keyexponent2,$Keycoefficient);
23  
24  
25 # Test for PKCS8
26 4 ▶ if ($ASN1Index[2]->[2] == 16) { # This is probably a PKCS8 key
Branch: 1 branch
BranchTrueFalseTotal
if ($ASN1Index[2][2] == 16) 0 4 4
27 0 my ($CLASS,$CONSTRUCTED,$TAG,$HEADSTART,$HEADLEN,$CHUNKLEN) = @{$ASN1Index[5]};
28 0 my $newdecoded=substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));
29 0 ▶ if ( $TAG == 4 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($TAG == 4) 0 0 0
30 0 $decoded=ASN1Unwrap($newdecoded);
31 0 @ASN1Index=ASN1Index($decoded);
32 }
33 }
34  
35 4 shift @ASN1Index; #Key Sequence
36 4 foreach (@ASN1Index) {
37 36 my ($CLASS,$CONSTRUCTED,$TAG,$HEADSTART,$HEADLEN,$CHUNKLEN) = @$_;
38 0 ▶ if ( $HEADSTART < $ignoreuntil ) { next; }
Branch: 1 branch
BranchTrueFalseTotal
if ($HEADSTART < $ignoreuntil) { } 0 36 36
39 else {
40 36 ▶ if ($index==0 && $TAG==2) {$Keyversion = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Branch: 9 branches
BranchTrueFalseTotal
if ($index == 0 and $TAG == 2) { } 4 32 36
elsif ($index == 1 and $TAG == 2) { } 4 28 32
elsif ($index == 2 and $TAG == 2) { } 4 24 28
elsif ($index == 3 and $TAG == 2) { } 4 20 24
elsif ($index == 4 and $TAG == 2) { } 4 16 20
elsif ($index == 5 and $TAG == 2) { } 4 12 16
elsif ($index == 6 and $TAG == 2) { } 4 8 12
elsif ($index == 7 and $TAG == 2) { } 4 4 8
elsif ($index == 8 and $TAG == 2) { } 4 0 4
Condition66%2/3
$index == 0 and $TAG == 2
!ll&&!rl&&r
3204
MC/DC50%1/2
$index == 0 and $TAG == 2
$index == 0 $TAG == 2
Truth table66%2/3
A and B
A= $index == 0B= $TAG == 2
ABresult
0X0
100
111
41 4 ▶ elsif ($index==1 && $TAG==2) {$Keymodulus = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition66%2/3
$index == 1 and $TAG == 2
!ll&&!rl&&r
2804
MC/DC50%1/2
$index == 1 and $TAG == 2
$index == 1 $TAG == 2
Truth table66%2/3
A and B
A= $index == 1B= $TAG == 2
ABresult
0X0
100
111
42 4 ▶ elsif ($index==2 && $TAG==2) {$KeypublicExponent = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition66%2/3
$index == 2 and $TAG == 2
!ll&&!rl&&r
2404
MC/DC50%1/2
$index == 2 and $TAG == 2
$index == 2 $TAG == 2
Truth table66%2/3
A and B
A= $index == 2B= $TAG == 2
ABresult
0X0
100
111
43 4 ▶ elsif ($index==3 && $TAG==2) {$KeyprivateExponent = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition66%2/3
$index == 3 and $TAG == 2
!ll&&!rl&&r
2004
MC/DC50%1/2
$index == 3 and $TAG == 2
$index == 3 $TAG == 2
Truth table66%2/3
A and B
A= $index == 3B= $TAG == 2
ABresult
0X0
100
111
44 4 ▶ elsif ($index==4 && $TAG==2) {$Keyprime1 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition66%2/3
$index == 4 and $TAG == 2
!ll&&!rl&&r
1604
MC/DC50%1/2
$index == 4 and $TAG == 2
$index == 4 $TAG == 2
Truth table66%2/3
A and B
A= $index == 4B= $TAG == 2
ABresult
0X0
100
111
45 4 ▶ elsif ($index==5 && $TAG==2) {$Keyprime2 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition66%2/3
$index == 5 and $TAG == 2
!ll&&!rl&&r
1204
MC/DC50%1/2
$index == 5 and $TAG == 2
$index == 5 $TAG == 2
Truth table66%2/3
A and B
A= $index == 5B= $TAG == 2
ABresult
0X0
100
111
46 4 ▶ elsif ($index==6 && $TAG==2) {$Keyexponent1 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition66%2/3
$index == 6 and $TAG == 2
!ll&&!rl&&r
804
MC/DC50%1/2
$index == 6 and $TAG == 2
$index == 6 $TAG == 2
Truth table66%2/3
A and B
A= $index == 6B= $TAG == 2
ABresult
0X0
100
111
47 4 ▶ elsif ($index==7 && $TAG==2) {$Keyexponent2 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition66%2/3
$index == 7 and $TAG == 2
!ll&&!rl&&r
404
MC/DC50%1/2
$index == 7 and $TAG == 2
$index == 7 $TAG == 2
Truth table66%2/3
A and B
A= $index == 7B= $TAG == 2
ABresult
0X0
100
111
48 4 ▶ elsif ($index==8 && $TAG==2) {$Keycoefficient = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));}
Condition33%1/3
$index == 8 and $TAG == 2
!ll&&!rl&&r
004
MC/DC0%0/2
$index == 8 and $TAG == 2
$index == 8 $TAG == 2
Truth table33%1/3
A and B
A= $index == 8B= $TAG == 2
ABresult
0X0
100
111
49 36 $index++;
50 36 $ignoreuntil=$HEADSTART+$HEADLEN+$CHUNKLEN;
51 }
52 }
53  
54 0 ▶ if (defined $Values{Keyversion}) {my @n=ASN1Unwrap($Keyversion); $Values{Keyversion} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"Keyversion"}) 0 4 4
55 4 ▶ if (defined $Values{Keymodulus}) {my @n=ASN1Unwrap($Keymodulus); $Values{Keymodulus} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"Keymodulus"}) 4 0 4
56 0 ▶ if (defined $Values{KeypublicExponent}) {my @n=ASN1Unwrap($KeypublicExponent); $Values{KeypublicExponent} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"KeypublicExponent"}) 0 4 4
57 4 ▶ if (defined $Values{KeyprivateExponent}) {my @n=ASN1Unwrap($KeyprivateExponent); $Values{KeyprivateExponent} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"KeyprivateExponent"}) 4 0 4
58 0 ▶ if (defined $Values{Keyprime1}) {my @n=ASN1Unwrap($Keyprime1); $Values{Keyprime1} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"Keyprime1"}) 0 4 4
59 0 ▶ if (defined $Values{Keyprime2}) {my @n=ASN1Unwrap($Keyprime2); $Values{Keyprime2} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"Keyprime2"}) 0 4 4
60 0 ▶ if (defined $Values{Keyexponent1}) {my @n=ASN1Unwrap($Keyexponent1); $Values{Keyexponent1} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"Keyexponent1"}) 0 4 4
61 0 ▶ if (defined $Values{Keyexponent2}) {my @n=ASN1Unwrap($Keyexponent2); $Values{Keyexponent2} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"Keyexponent2"}) 0 4 4
62 0 ▶ if (defined $Values{Keycoefficient}) {my @n=ASN1Unwrap($Keycoefficient); $Values{Keycoefficient} = $n[5];}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Values{"Keycoefficient"}) 0 4 4
63  
64 4 return (\%Values);
65 }
66  
67 ################################################################
68  
69 1 1;
70 __END__
« lib/VOMS/Lite/RSAKey.pm ↑ Summary script/voms-server.pl »