Branch Coverage

X509.xs
Criterion Covered Total %
branch 118 270 43.7


line true false branch
62 1 2 if (n != NULL)
64 2 1 if (e != NULL)
66 0 3 if (d != NULL)
72 0 3 if (pkey->type != EVP_PKEY_RSA)
80 0 0 if (psig != NULL)
82 0 0 if (palg != NULL)
100 0 0 if (p != NULL)
102 0 0 if (q != NULL)
104 0 0 if (g != NULL)
111 0 0 if (pub_key != NULL)
113 0 0 if (priv_key != NULL)
119 0 0 if (pkey->type != EVP_PKEY_DSA)
126 0 2 if (pkey->type != EVP_PKEY_EC)
141 1180 1264 if (m == BIO_CB_WRITE) {
146 0 2444 if (m == BIO_CB_PUTS) {
178 0 43 if (!sv) sv = &PL_sv_undef;
189 0 8 if (!sv_utf8_decode(sv)) {
193 0 0 const U8* start = (U8 *) SvPV(sv, len);
197 0 0 while ((start < end) && !is_utf8_string_loclen(start, len, &cur, 0)) {
0 0 while ((start < end) && !is_utf8_string_loclen(start, len, &cur, 0)) {
204 0 0 if (start < end) {
235 0 0 return SvPV(sv, l);
245 0 40 if (! sv_isa(rv, class) ) {
270 1 10 if ( !(c > 0) ) {
274 33 10 for (i = 0; i < c; i++) {
279 0 33 if (ext == NULL) croak("Extension %d unavailable\n", i);
283 33 0 if (no_name == 0 || no_name == 1) {
30 3 if (no_name == 0 || no_name == 1) {
288 3 0 } else if (no_name == 2) {
294 0 33 if (! hv_store(RETVAL, key, r, rv, 0) ) croak("Error storing extension in hash\n");
327 48 4 for (i = 0; (name = Crypt__OpenSSL__X509__const[i].n); i++) {
342 0 0 if ((RETVAL = X509_new()) == NULL) {
346 0 0 if (!X509_set_version(RETVAL, 2)) {
348 0 0 croak ("%s - can't X509_set_version()", SvPV_nolen(class));
372 17 0 cert = SvPV(string, len);
374 16 1 if (ix == 1) {
380 0 17 if (!bio) croak("%s: Failed to create BIO", SvPV_nolen(class));
0 0 if (!bio) croak("%s: Failed to create BIO", SvPV_nolen(class));
383 1 16 if (format == FORMAT_ASN1) {
394 0 17 if (!RETVAL) croak("%s: failed to read X509 certificate.", SvPV_nolen(class));
0 0 if (!RETVAL) croak("%s: failed to read X509 certificate.", SvPV_nolen(class));
405 17 0 if (x509) X509_free(x509); x509 = 0;
445 15 4 if (ix == 1 || ix == 2) {
2 13 if (ix == 1 || ix == 2) {
447 4 2 if (ix == 1) {
459 3 10 } else if (ix == 3) {
463 2 8 } else if (ix == 4) {
467 0 8 } else if (ix == 5) {
474 0 8 } else if (ix == 6) {
480 2 6 } else if (ix == 7) {
485 4 2 for (j = 0; j < sk_OPENSSL_STRING_num(emlst); j++) {
486 2 2 BIO_printf(bio, "%s%s", (j ? " " : ""), sk_OPENSSL_STRING_value(emlst, j));
491 1 5 } else if (ix == 8) {
495 2 3 } else if (ix == 9) {
503 2 1 } else if ( ix == 10 ) {
511 1 0 } else if ( ix == 11 ) {
529 12 2 if (ix == 1) {
555 0 0 for (i=0; i
577 0 1 if (format == FORMAT_PEM) {
581 1 0 } else if (format == FORMAT_ASN1) {
607 0 2 if (pkey == NULL) {
629 0 1 if ( !ec_order ) {
634 0 1 if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) {
639 0 1 if (!EC_GROUP_get_order(group, ec_order, NULL)) {
674 0 1 if (pkey == NULL) {
678 1 0 if ( EVP_PKEY_base_id(pkey) == EVP_PKEY_EC ) {
683 0 1 if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) {
688 0 1 if ( nid == 0 ) {
718 0 0 if (pkey == NULL) {
726 0 0 if (pkey_id == EVP_PKEY_RSA) {
735 0 0 } else if (pkey_id == EVP_PKEY_DSA) {
743 0 0 } else if ( pkey_id == EVP_PKEY_EC ) {
750 0 0 if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) {
756 0 0 if ((pub_key = EC_POINT_point2bn(group, public_key, EC_KEY_get_conv_form(ec_pkey), NULL, NULL)) == NULL) {
793 1 1 if (ix)
795 0 1 if (pkey == NULL) {
801 2 0 if (EVP_PKEY_base_id(pkey) == EVP_PKEY_RSA) {
845 0 7 if (!X509_digest(x509, mds[ix], md, &n)) {
852 217 7 for (i = 1; i < n; i++) {
875 0 0 if (ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(x509), now + (int)checkoffset) == -1) {
901 0 0 if (pkey == NULL) {
909 0 0 if (pkey_id == EVP_PKEY_RSA) {
915 0 0 } else if (pkey_id == EVP_PKEY_DSA) {
925 0 0 } else if (pkey_id == EVP_PKEY_EC ) {
959 0 1 if(!pkey)
963 0 1 if (pkey_id == EVP_PKEY_DSA) {
966 0 1 } else if (pkey_id == EVP_PKEY_RSA) {
969 1 0 } else if (pkey_id == EVP_PKEY_EC ) {
1001 0 0 if (!(c > 0)) {
1003 0 0 } else if (i >= c || i < 0) {
0 0 } else if (i >= c || i < 0) {
1009 0 0 if (ext == NULL) {
1042 0 3 if (ext == NULL) {
1057 0 1 if (ext == NULL) {
1076 0 3 if (ext == NULL) {
1101 0 2 if (ext == NULL) {
1127 1 0 if (strcmp(value, "ca") == 0) {
1130 0 0 } else if (strcmp(value, "pathlen") == 0) {
1180 1 0 if (nid == NID_key_usage) {
1182 9 1 for (i = 0; i < 9; i++) {
1187 0 0 } else if (nid == NID_netscape_cert_type) {
1189 0 0 for (i = 0; i < 8; i++) {
1215 0 0 while(sk_ASN1_OBJECT_num(extku) > 0) {
1259 0 1 if (nid == NID_authority_key_identifier) {
1264 1 0 } else if (nid == NID_subject_key_identifier) {
1285 0 1 if (obj == NULL) {
1305 0 0 if (obj == NULL) {
1351 7 1 for (i = 0; i < c; i++) {
1377 5 1 if (ix == 1 || ix == 3) {
1 4 if (ix == 1 || ix == 3) {
1379 2 2 } else if (ix == 4 || ix == 5) {
0 2 } else if (ix == 4 || ix == 5) {
1385 0 6 if (!nid) {
1391 5 1 if (ix == 2 || ix == 3 || ix == 4) { /* has_entry */
4 1 if (ix == 2 || ix == 3 || ix == 4) { /* has_entry */
2 2 if (ix == 2 || ix == 3 || ix == 4) { /* has_entry */
1414 0 3 if (ix == 1) {
1420 0 3 if (!nid) {
1450 1 1 if (ix == 1 || ln) {
0 1 if (ix == 1 || ln) {
1484 1 1 if (ix == 1 || ln) {
0 1 if (ix == 1 || ln) {
1523 1 1 RETVAL = (X509_NAME_ENTRY_get_data(name_entry)->type == (ix == 1 ? asn1_type : ix));
1535 0 0 if (X509_NAME_ENTRY_get_data(name_entry)->type == V_ASN1_PRINTABLESTRING) {
1538 0 0 } else if(X509_NAME_ENTRY_get_data(name_entry)->type == V_ASN1_IA5STRING) {
1541 0 0 } else if(X509_NAME_ENTRY_get_data(name_entry)->type == V_ASN1_UTF8STRING) {
1566 0 0 crl = SvPV(string, len);
1568 0 0 if (ix == 1) {
1574 0 0 if (!bio) {
1575 0 0 croak("%s: Failed to create BIO", SvPV_nolen(class));
1578 0 0 if (format == FORMAT_ASN1) {
1584 0 0 if (!RETVAL) {
1585 0 0 croak("%s: failed to read X509 certificate.", SvPV_nolen(class));
1608 0 0 if (ix == 1) {
1613 0 0 } else if (ix == 2) {