| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 36 | ▶ | if ($index==0 && $TAG==2) {$Keyversion = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 9 branches
Condition66%2/3
$index == 0 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 4 | ▶ | elsif ($index==1 && $TAG==2) {$Keymodulus = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$index == 1 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 4 | ▶ | elsif ($index==2 && $TAG==2) {$KeypublicExponent = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$index == 2 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 4 | ▶ | elsif ($index==3 && $TAG==2) {$KeyprivateExponent = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$index == 3 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 4 | ▶ | elsif ($index==4 && $TAG==2) {$Keyprime1 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$index == 4 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 4 | ▶ | elsif ($index==5 && $TAG==2) {$Keyprime2 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$index == 5 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 4 | ▶ | elsif ($index==6 && $TAG==2) {$Keyexponent1 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$index == 6 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 4 | ▶ | elsif ($index==7 && $TAG==2) {$Keyexponent2 = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$index == 7 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 4 | ▶ | elsif ($index==8 && $TAG==2) {$Keycoefficient = substr($decoded,$HEADSTART,($HEADLEN+$CHUNKLEN));} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$index == 8 and $TAG == 2
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 4 | ▶ | if (defined $Values{Keymodulus}) {my @n=ASN1Unwrap($Keymodulus); $Values{Keymodulus} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | if (defined $Values{KeypublicExponent}) {my @n=ASN1Unwrap($KeypublicExponent); $Values{KeypublicExponent} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 4 | ▶ | if (defined $Values{KeyprivateExponent}) {my @n=ASN1Unwrap($KeyprivateExponent); $Values{KeyprivateExponent} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | if (defined $Values{Keyprime1}) {my @n=ASN1Unwrap($Keyprime1); $Values{Keyprime1} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | if (defined $Values{Keyprime2}) {my @n=ASN1Unwrap($Keyprime2); $Values{Keyprime2} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | if (defined $Values{Keyexponent1}) {my @n=ASN1Unwrap($Keyexponent1); $Values{Keyexponent1} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | if (defined $Values{Keyexponent2}) {my @n=ASN1Unwrap($Keyexponent2); $Values{Keyexponent2} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | if (defined $Values{Keycoefficient}) {my @n=ASN1Unwrap($Keycoefficient); $Values{Keycoefficient} = $n[5];} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 4 | return (\%Values); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | ################################################################ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||