Branch Coverage

blib/lib/IO/Socket/SSL/Utils.pm
Criterion Covered Total %
branch 29 118 24.5


line true false branch
22 0 10 unless my $bio = &Net::SSLeay::BIO_new_file($file, "r")
26 0 10 unless $cert
33 0 0 unless my $string = &Net::SSLeay::PEM_get_string_X509($cert)
35 0 0 unless open my $fh, ">", $file
42 0 0 unless my $bio = &Net::SSLeay::BIO_new_file($file, "r")
46 0 0 if (my $cert = &Net::SSLeay::PEM_read_bio_X509($bio)) { }
51 0 0 if ($error & 4095) == 108 and @certs
61 0 0 unless open my $fh, ">", $file
63 0 0 unless my $string = &Net::SSLeay::PEM_get_string_X509($cert)
76 0 584 unless $cert
89 0 0 unless my $bio = &Net::SSLeay::BIO_new_file($file, "r")
93 0 0 unless $key
100 0 0 unless my $string = &Net::SSLeay::PEM_get_string_PrivateKey($key)
102 0 0 unless open my $fh, ">", $file
112 0 0 unless $key
191 0 0 if (not exists $subj{$k}) { }
0 0 elsif (not ref $subj{$k}) { }
203 0 0 if (my(@names) = &Net::SSLeay::X509_get_subjectAltNames($cert))
207 0 0 if ($t eq "IP")
208 0 0 if (length $v == 4) { }
0 0 elsif (length $v == 16) { }
214 0 0 if ($v[$i] == 0) { }
215 0 0 if ($last0) { }
218 0 0 if ++$last0->[2] > $best0->[2]
227 0 0 if ($best0) { }
229 0 0 if $best0->[0] > 0
231 0 0 if $best0->[1] < $#v
246 0 0 $nid > 0 ? :
0 0 $nid > 0 ? :
256 0 0 if (defined &Net::SSLeay::P_X509_get_ocsp_uri) { }
261 0 0 unless $_->{'sn'}
262 0 0 unless $_->{'sn'} eq "authorityInfoAccess"
271 0 120 @_ % 2 ? :
310 0 116 ref $v ? :
311 0 0 unless &Net::SSLeay::X509_NAME_add_entry_by_txt($subj_e, $k, 4096, $_, -1, 0) or &Net::SSLeay::X509_NAME_add_entry_by_txt($subj_e, $k, 20, $_, -1, 0) or &Net::SSLeay::X509_NAME_add_entry_by_txt($subj_e, $k, 4, $_, -1, 0)
323 22 98 if (my $altsubj = delete $args{'subjectAltNames'})
337 2 118 if (my $p = delete $args{'purpose'})
338 0 2 if (not ref $p) { }
0 2 elsif (ref $p eq 'ARRAY') { }
339 0 0 !$1 || $1 eq '+' ? :
343 0 0 unless /^([+-]?)(\w+)$/
344 0 0 !$1 || $1 eq '+' ? :
348 2 0 $v && $v ne '-' ? :
352 10 110 if (delete $args{'CA'})
359 108 12 unless (%purpose)
396 2382 258 unless exists $purpose{lc $_->[0]}
397 258 0 if (delete $purpose{lc $_->[0]}) { }
405 0 120 if %purpose
412 10 110 if (%basic_constraints) { }
418 120 0 if %key_usage
420 120 0 if %cert_type
422 110 10 if %ext_key_usage
430 120 0 unless delete $args{'ext'}
434 0 0 if $have_ext{$nid}
436 0 0 if ($nid == 177) { }
441 0 0 if $ext->{'critical'}
445 0 0 if $ext->{'critical'}
451 0 120 if not delete $args{'ignore_invalid_args'} and %args
491 0 6 unless &Net::SSLeay::EVP_get_digestbyname($digest_name)