Branch Coverage

blib/lib/VOMS/Lite/X509.pm
Criterion Covered Total %
branch 161 326 49.3


line true false branch
24 0 10 if @ASN1Index == 0
34 2 8 if (defined $Values{'X509TBSCert'})
42 515 100 if ($HEADSTART < $ignoreuntil) { }
44 10 90 if ($index == 0 and $CLASS == 2 and $TAG == 0) { }
10 80 elsif ($index == 1 and $TAG == 2) { }
10 70 elsif ($index == 2 and $TAG == 16) { }
10 60 elsif ($index == 3 and $TAG == 16) { }
10 50 elsif ($index == 4 and $TAG == 16) { }
10 40 elsif ($index == 5 and $TAG == 16) { }
10 30 elsif ($index == 6 and $TAG == 16) { }
0 30 elsif ($index == 7 and $CLASS == 2 and $TAG == 1) { }
0 30 elsif ($index == 7 and $CLASS == 2 and $TAG == 2) { }
10 20 elsif ($index == 7 and $CLASS == 2 and $TAG == 3) { }
10 10 elsif ($index == 7 and $TAG == 16) { }
10 0 elsif ($index == 8 and $TAG == 3) { }
59 0 10 if ($index != 8)
62 0 10 if (defined $Values{'X509version'})
63 4 6 if (defined $Values{'X509serial'})
64 0 10 if (defined $Values{'X509signature'})
65 4 6 if (defined $Values{'X509issuer'})
66 0 10 if (defined $Values{'X509validity'})
67 5 5 if (defined $Values{'X509subject'})
68 0 10 if (defined $Values{'X509subjectPublicKeyInfo'})
69 0 10 if (defined $Values{'X509issuerUniqueID'})
70 0 10 if (defined $Values{'X509subjectUniqueID'})
71 0 10 if (defined $Values{'X509extensions'})
72 0 10 if (defined $Values{'X509SignatureValue'})
78 5 5 if (defined $Values{'Start'} or defined $Values{'End'})
82 5 0 if ($st[4] eq '23' and $st[5] =~ /^(..)(..)(..)(..)(..)(..)Z$/) { }
0 0 elsif ($st[4] eq '24' and $st[5] =~ /^(....)(..)(..)(..)(..)(..)Z$/) { }
84 5 0 if ($et[4] eq '23' and $et[5] =~ /^(..)(..)(..)(..)(..)(..)Z$/) { }
0 0 elsif ($et[4] eq '24' and $et[5] =~ /^(....)(..)(..)(..)(..)(..)Z$/) { }
89 5 5 if (defined $Values{'SubjectDN'} or defined $Values{'Proxy'})
102 5 5 if (defined $Values{'IssuerDN'} or defined $Values{'Proxy'})
117 2 8 if (defined $Values{'KeypublicExponent'} or defined $Values{'Keymodulus'})
122 6 4 unless ($CONSTRUCTED)
123 2 4 if $TAG == 6
124 2 4 if $TAG == 3
127 2 0 if ($OID eq '2a864886f70d010101')
139 3 7 if (defined $Values{'Hash'})
143 3 7 if (defined $Values{'IHash'})
164 20 25 if ($TAG == 1)
171 0 45 if (defined $Values{"Extension:$OIDstr"})
176 0 9 if (defined $Values{'ProxyInfo'} and $OIDstr eq '1.3.6.1.5.5.7.1.14' || $OIDstr eq '1.3.6.1.4.1.3536.1.222')
178 0 0 unless $CRITICAL
181 0 0 $OIDstr eq '1.3.6.1.5.5.7.1.14' ? :
182 0 0 $Values{'ProxyInfo'} eq '' ? :
190 0 0 if ($Tag == 16) { }
0 0 elsif ($Tag == 2 and $PType eq 'RFC') { }
0 0 elsif ($Tag == 1) { }
197 0 0 if ($Tag == 6) { }
0 0 elsif ($Tag == 4) { }
204 0 45 if (defined $Values{'subjectAltName'} and $OIDstr eq '2.5.29.17')
211 0 0 if ($Tag == 0) { }
0 0 elsif ($Tag == 1) { }
0 0 elsif ($Tag == 2) { }
0 0 elsif ($Tag == 3) { }
0 0 elsif ($Tag == 4) { }
0 0 elsif ($Tag == 5) { }
0 0 elsif ($Tag == 6) { }
0 0 elsif ($Tag == 7) { }
0 0 elsif ($Tag == 8) { }
226 0 45 if (defined $Values{'issuerAltName'} and $OIDstr eq '2.5.29.18')
233 0 0 if ($Tag == 0) { }
0 0 elsif ($Tag == 1) { }
0 0 elsif ($Tag == 2) { }
0 0 elsif ($Tag == 3) { }
0 0 elsif ($Tag == 4) { }
0 0 elsif ($Tag == 5) { }
0 0 elsif ($Tag == 6) { }
0 0 elsif ($Tag == 7) { }
0 0 elsif ($Tag == 8) { }
248 8 37 if (defined $Values{'subjectKeyIdentifier'} and $OIDstr eq '2.5.29.14') { }
5 32 elsif (defined $Values{'authorityKeyIdentifier'} and $OIDstr eq '2.5.29.35') { }
5 27 elsif (defined $Values{'keyUsage'} and $OIDstr eq '2.5.29.15') { }
5 42 elsif (defined $Values{'basicConstraints'} and $OIDstr eq '2.5.29.19') { }
263 5 10 if ($Tag == 0) { }
5 5 elsif ($Tag == 1) { }
5 0 elsif ($Tag == 2) { }
273 5 0 if ($KU =~ s/^(.)//)
278 5 0 defined $B[0] ? :
279 5 0 defined $B[1] ? :
280 5 0 defined $B[2] ? :
281 5 0 defined $B[3] ? :
282 5 0 defined $B[4] ? :
283 3 2 defined $B[5] ? :
284 3 2 defined $B[6] ? :
285 0 5 defined $B[7] ? :
286 0 5 defined $B[8] ? :
295 3 2 if ($BC =~ /\x01\x01(.)(.*)/)
297 0 3 if ($2 =~ /(.+)/)
304 2 8 if (defined $Values{'SignatureValue'} or defined $Values{'SignatureType'})
307 0 2 if ($HexX509signature eq '300d06092a864886f70d0101040500') { }
2 0 elsif ($HexX509signature eq '300d06092a864886f70d0101050500') { }
0 0 elsif ($HexX509signature eq '300d06092a864886f70d0101030500') { }
0 0 elsif ($HexX509signature eq '300d06092a864886f70d0101020500') { }
330 0 3 unless (defined $context{'DN'})
331 0 3 unless (defined $context{'Serial'})
332 0 3 if (not defined $context{'CACert'} and defined $context{'CAKey'})
333 0 3 if (not defined $context{'CAKey'} and defined $context{'CACert'})
334 1 0 unless (defined $context{'CACert'} or defined $context{'CAKey'})
335 0 1 unless (defined $context{'CACert'} or defined $context{'CA'})
336 0 3 if (not defined $context{'CA'} and defined $context{'CACert'})
339 0 3 if (@Errors > 0)
342 0 3 if (ref $context{'DN'} ne 'ARRAY')
343 0 3 if (defined $context{'Extensions'} and ref $context{'Extensions'} ne 'ARRAY')
345 0 3 unless ($context{'Serial'} =~ /^([0-9]+)$/)
346 0 3 unless ($context{'CA'} =~ /^(False|True)$/)
347 0 3 if (defined $context{'Lifetime'} and not $context{'Lifetime'} =~ /^[0-9]+$/)
349 0 3 if (defined $context{'Bits'} and not $context{'Bits'} =~ /^(512|1024|2048|4096)$/)
351 0 3 if (defined $context{'SubjectAltName'} and ref $context{'SubjectAltName'} ne 'ARRAY')
355 0 3 if (@Errors > 0)
361 2 1 if (defined $context{'CACert'})
362 2 0 $context{'CACert'} =~ /^(\060.+)$/s ? :
363 2 0 $context{'CAKey'} =~ /^(\060.+)$/s ? :
364 2 0 if (defined $CertInfoRef) { }
365 0 2 if (%CI and defined $CI{'Errors'})
366 2 0 if (defined $KeyInfoRef) { }
370 0 3 if (@Errors > 0)
373 0 21 unless (/^(DN|subjectAltName|Quiet|Serial|CACert|CAKey|CA|Bits|Lifetime)$/)
376 0 3 if (@Errors > 0)
379 0 3 unless (defined $context{'Lifetime'})
380 0 3 unless (defined $context{'Bits'})
381 2 1 if (defined $context{'CACert'})
382 0 2 if ($context{'Lifetime'} > $CI{'End'} - $now)
383 2 0 if ($CI{'End'} - $now < 604800)
399 9 0 if (defined $OID) { }
401 9 0 if ($value =~ m[^[a-zA-Z0-9 \x22()+,./:?-]*$]) { }
0 0 elsif ($value =~ /^[\x00\x07-\x0f\x11-\x14\x18-\x1b\x20-\x23\x25-\x7d\x7f]*$/) { }
404 9 0 if (defined $STRtype)
408 0 3 if ($ASN1DN eq '')
419 2 1 if (defined $context{'subjectAltName'})
421 0 2 if (/^otherName=/) { }
1 1 elsif (/^rfc822Name=([\x00-\x7f]*)$/) { }
1 0 elsif (/^dNSName=([\x00-\x7f]*)$/) { }
0 0 elsif (/^x400Address=/) { }
0 0 elsif (/^directoryName=(30[0-9a-f]*)$/) { }
0 0 elsif (/^directoryName=(\060.*)$/) { }
0 0 elsif (/^ediPartyName=/) { }
0 0 elsif (/^uniformResourceIdentifier=([\x00\x07-\x0f\x11-\x14\x18-\x1b\x20-\x23\x25-\x7d\x7f]*)$/) { }
0 0 elsif (/^IPAddress=(.{4})$/) { }
0 0 elsif (/^IPAddress=([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/) { }
0 0 elsif (m[^IPAddress=([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$]) { }
0 0 elsif (/^IPAddress=(.{8})$/) { }
0 0 elsif (/^IPAddress=(.{16})$/) { }
0 0 elsif (/^registeredID=/) { }
0 0 elsif (/^(rfc822Name|dNSName|directoryName|uniformResourceIdentifier|IPAddress)=/) { }
0 0 elsif (/^([^=]+)=/) { }
455 0 3 if (defined $context{'CACert'} and $CI{'subjectAltName'} ne '') { }
0 5 elsif (not defined $context{'CACert'} and $SubjectAltName ne '') { }
461 0 0 if (/^\060/) { }
0 0 elsif (/^30[0-9a-f]*$/) { }
467 0 3 if (@Errors > 0)
470 0 3 defined $context{'Quiet'} ? :
471 0 3 unless (defined $keyref)
473 0 3 if (defined $key{'Error'})
498 1 2 unless (defined $context{'CACert'})
518 2 1 defined $CI{'X509subject'} ? :
533 1 2 $context{'CA'} eq 'True' ? :
536 1 2 $context{'CA'} eq 'True' ? :
547 1 2 unless (defined $context{'CACert'})
561 2 1 if ($SubjectAltName ne '')
562 0 3 if ($IssuerAltName ne '')