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++) {
344 0 0 if ((RETVAL = X509_new()) == NULL) {
348 0 0 if (!X509_set_version(RETVAL, 2)) {
350 0 0 croak ("%s - can't X509_set_version()", SvPV_nolen(class));
374 17 0 cert = SvPV(string, len);
376 16 1 if (ix == 1) {
382 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));
385 1 16 if (format == FORMAT_ASN1) {
396 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));
407 17 0 if (x509) X509_free(x509); x509 = 0;
447 15 4 if (ix == 1 || ix == 2) {
2 13 if (ix == 1 || ix == 2) {
449 4 2 if (ix == 1) {
461 3 10 } else if (ix == 3) {
465 2 8 } else if (ix == 4) {
469 0 8 } else if (ix == 5) {
476 0 8 } else if (ix == 6) {
482 2 6 } else if (ix == 7) {
487 4 2 for (j = 0; j < sk_OPENSSL_STRING_num(emlst); j++) {
488 2 2 BIO_printf(bio, "%s%s", (j ? " " : ""), sk_OPENSSL_STRING_value(emlst, j));
493 1 5 } else if (ix == 8) {
497 2 3 } else if (ix == 9) {
505 2 1 } else if ( ix == 10 ) {
513 1 0 } else if ( ix == 11 ) {
531 12 2 if (ix == 1) {
557 0 0 for (i=0; i
579 0 1 if (format == FORMAT_PEM) {
583 1 0 } else if (format == FORMAT_ASN1) {
609 0 2 if (pkey == NULL) {
631 0 1 if ( !ec_order ) {
636 0 1 if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) {
641 0 1 if (!EC_GROUP_get_order(group, ec_order, NULL)) {
676 0 1 if (pkey == NULL) {
680 1 0 if ( EVP_PKEY_base_id(pkey) == EVP_PKEY_EC ) {
685 0 1 if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) {
690 0 1 if ( nid == 0 ) {
720 0 0 if (pkey == NULL) {
728 0 0 if (pkey_id == EVP_PKEY_RSA) {
737 0 0 } else if (pkey_id == EVP_PKEY_DSA) {
745 0 0 } else if ( pkey_id == EVP_PKEY_EC ) {
752 0 0 if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) {
758 0 0 if ((pub_key = EC_POINT_point2bn(group, public_key, EC_KEY_get_conv_form(ec_pkey), NULL, NULL)) == NULL) {
795 1 1 if (ix)
797 0 1 if (pkey == NULL) {
803 2 0 if (EVP_PKEY_base_id(pkey) == EVP_PKEY_RSA) {
847 0 7 if (!X509_digest(x509, mds[ix], md, &n)) {
854 217 7 for (i = 1; i < n; i++) {
877 0 0 if (ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(x509), now + (int)checkoffset) == -1) {
903 0 0 if (pkey == NULL) {
911 0 0 if (pkey_id == EVP_PKEY_RSA) {
917 0 0 } else if (pkey_id == EVP_PKEY_DSA) {
927 0 0 } else if (pkey_id == EVP_PKEY_EC ) {
961 0 1 if(!pkey)
965 0 1 if (pkey_id == EVP_PKEY_DSA) {
968 0 1 } else if (pkey_id == EVP_PKEY_RSA) {
971 1 0 } else if (pkey_id == EVP_PKEY_EC ) {
1003 0 0 if (!(c > 0)) {
1005 0 0 } else if (i >= c || i < 0) {
0 0 } else if (i >= c || i < 0) {
1011 0 0 if (ext == NULL) {
1044 0 3 if (ext == NULL) {
1059 0 1 if (ext == NULL) {
1078 0 3 if (ext == NULL) {
1103 0 2 if (ext == NULL) {
1129 1 0 if (strcmp(value, "ca") == 0) {
1132 0 0 } else if (strcmp(value, "pathlen") == 0) {
1182 1 0 if (nid == NID_key_usage) {
1184 9 1 for (i = 0; i < 9; i++) {
1189 0 0 } else if (nid == NID_netscape_cert_type) {
1191 0 0 for (i = 0; i < 8; i++) {
1217 0 0 while(sk_ASN1_OBJECT_num(extku) > 0) {
1261 0 1 if (nid == NID_authority_key_identifier) {
1266 1 0 } else if (nid == NID_subject_key_identifier) {
1287 0 1 if (obj == NULL) {
1307 0 0 if (obj == NULL) {
1353 7 1 for (i = 0; i < c; i++) {
1379 5 1 if (ix == 1 || ix == 3) {
1 4 if (ix == 1 || ix == 3) {
1381 2 2 } else if (ix == 4 || ix == 5) {
0 2 } else if (ix == 4 || ix == 5) {
1387 0 6 if (!nid) {
1393 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 */
1416 0 3 if (ix == 1) {
1422 0 3 if (!nid) {
1452 1 1 if (ix == 1 || ln) {
0 1 if (ix == 1 || ln) {
1486 1 1 if (ix == 1 || ln) {
0 1 if (ix == 1 || ln) {
1525 1 1 RETVAL = (X509_NAME_ENTRY_get_data(name_entry)->type == (ix == 1 ? asn1_type : ix));
1537 0 0 if (X509_NAME_ENTRY_get_data(name_entry)->type == V_ASN1_PRINTABLESTRING) {
1540 0 0 } else if(X509_NAME_ENTRY_get_data(name_entry)->type == V_ASN1_IA5STRING) {
1543 0 0 } else if(X509_NAME_ENTRY_get_data(name_entry)->type == V_ASN1_UTF8STRING) {
1568 0 0 crl = SvPV(string, len);
1570 0 0 if (ix == 1) {
1576 0 0 if (!bio) {
1577 0 0 croak("%s: Failed to create BIO", SvPV_nolen(class));
1580 0 0 if (format == FORMAT_ASN1) {
1586 0 0 if (!RETVAL) {
1587 0 0 croak("%s: failed to read X509 certificate.", SvPV_nolen(class));
1610 0 0 if (ix == 1) {
1615 0 0 } else if (ix == 2) {