Branch Coverage

src/x509/x509_minimal.c
Criterion Covered Total %
branch 67 194 34.5


line true false branch
23 5089 0 if (y < 0x80) {
42 5184 952 if (y < 0x80) {
43 346 4838 if (neg) {
239 0 1 for (u = 0; u < cc->num_name_elts; u ++) {
249 1 0 if (server_name == NULL || *server_name == 0) {
0 1 if (server_name == NULL || *server_name == 0) {
262 0 1 if (cc->err != 0) {
265 0 1 if (length == 0) {
278 1 3 if (cc->err != 0) {
292 0 1 if (cc->err == 0 && cc->cert_length != 0) {
0 0 if (cc->err == 0 && cc->cert_length != 0) {
304 0 1 if (cc->err == 0) {
305 0 0 if (cc->num_certs == 0) {
310 1 0 } else if (cc->err == BR_ERR_X509_OK) {
322 0 3 if (cc->err == BR_ERR_X509_OK
323 0 0 || cc->err == BR_ERR_X509_NOT_TRUSTED)
325 1 2 if (usages != NULL) {
372 2 0 while (len1 > 0 && *b1 == 0) {
0 2 while (len1 > 0 && *b1 == 0) {
376 2 0 while (len2 > 0 && *b2 == 0) {
0 2 while (len2 > 0 && *b2 == 0) {
380 0 2 if (len1 != len2) {
397 6 1 while (len -- > 0) {
402 6 0 if (x1 >= 'A' && x1 <= 'Z') {
0 6 if (x1 >= 'A' && x1 <= 'Z') {
405 6 0 if (x2 >= 'A' && x2 <= 'Z') {
0 6 if (x2 >= 'A' && x2 <= 'Z') {
408 0 6 if (x1 != x2) {
934 16787 2736 if (t0x < T0_INTERPRETED) {
942 0 2735 if (t0x == 0) {
963 870 0 if (T0_POP()) {
969 421 884 if (!T0_POP()) {
1119 1 0 for (u = 0; u < CTX->trust_anchors_num; u ++) {
1125 0 1 if (ta->flags & BR_X509_TA_CA) {
1129 0 1 if (memcmp(hashed_DN, CTX->current_dn_hash, DNHASH_LEN)) {
1133 0 1 if ((ta->pkey.key_type & 0x0F) != kt) {
1139 1 0 if (!eqbigint(CTX->pkey.key.rsa.n,
1143 0 1 || !eqbigint(CTX->pkey.key.rsa.e,
1153 0 0 if (CTX->pkey.key.ec.curve != ta->pkey.key.ec.curve
1154 0 0 || CTX->pkey.key.ec.qlen != ta->pkey.key.ec.qlen
1157 0 0 ta->pkey.key.ec.qlen) != 0)
1181 0 0 for (u = 0; u < CTX->trust_anchors_num; u ++) {
1186 0 0 if (!(ta->flags & BR_X509_TA_CA)) {
1190 0 0 if (memcmp(hashed_DN, CTX->saved_dn_hash, DNHASH_LEN)) {
1193 0 0 if (verify_signature(CTX, &ta->pkey) == 0) {
1209 0 1 if (CTX->itime != 0) {
1211 0 0 if (r < -1 || r > 1) {
0 0 if (r < -1 || r > 1) {
1218 1 0 if (vd == 0 && vs == 0) {
1 0 if (vd == 0 && vs == 0) {
1239 1 0 if (vd < nbd || (vd == nbd && vs < nbs)) {
0 1 if (vd < nbd || (vd == nbd && vs < nbs)) {
0 0 if (vd < nbd || (vd == nbd && vs < nbs)) {
1241 1 0 } else if (vd > nad || (vd == nad && vs > nas)) {
0 1 } else if (vd > nad || (vd == nad && vs > nas)) {
0 0 } else if (vd > nad || (vd == nad && vs > nas)) {
1309 0 0 for (u = 0; u < CTX->num_name_elts; u ++) {
1313 0 0 if (ne->status == 0 && ne->oid[0] == 0 && ne->oid[1] == tag) {
0 0 if (ne->status == 0 && ne->oid[0] == 0 && ne->oid[1] == tag) {
0 0 if (ne->status == 0 && ne->oid[0] == 0 && ne->oid[1] == tag) {
1314 0 0 if (ok && ne->len > len) {
0 0 if (ok && ne->len > len) {
1334 0 4 if (off >= 0) {
1337 0 0 if (ok) {
1339 0 0 if (len < ne->len) {
1416 11 0 if (len == a2[0]) {
1464 0 1 if (CTX->server_name == NULL) {
1470 1 0 if (n1 == n2 && eqnocase(&CTX->pad[1], CTX->server_name, n1)) {
1 0 if (n1 == n2 && eqnocase(&CTX->pad[1], CTX->server_name, n1)) {
1474 0 0 if (n2 >= 2 && CTX->pad[1] == '*' && CTX->pad[2] == '.') {
0 0 if (n2 >= 2 && CTX->pad[1] == '*' && CTX->pad[2] == '.') {
0 0 if (n2 >= 2 && CTX->pad[1] == '*' && CTX->pad[2] == '.') {
1478 0 0 while (u < n1 && CTX->server_name[u] != '.') {
0 0 while (u < n1 && CTX->server_name[u] != '.') {
1483 0 0 if ((n2 - 2) == n1
1484 0 0 && eqnocase(&CTX->pad[3], CTX->server_name + u, n1))
1508 0 4 for (u = 0; u < CTX->num_name_elts; u ++) {
1509 0 0 if (CTX->name_elts[u].status == 0) {
1514 0 0 if (san) {
1515 0 0 if (oid[0] != 0 || oid[1] != 0) {
0 0 if (oid[0] != 0 || oid[1] != 0) {
1523 0 0 if (len != 0 && len == CTX->pad[0]
0 0 if (len != 0 && len == CTX->pad[0]
1525 0 0 CTX->pad + 1, len) == 0)
1556 11 0 if (clen > len) {
1559 6 5 if (addr != 0) {
1562 11 0 if (CTX->do_mhash) {
1565 5 6 if (CTX->do_dn_hash) {
1579 2 420 if (CTX->hlen == 0) {
1583 416 4 if (CTX->do_mhash) {
1586 78 342 if (CTX->do_dn_hash) {
1684 0 0 if ((pk->key_type & 0x0F) != kt) {
1691 0 0 if (ctx->irsa == 0) {
1694 0 0 if (!ctx->irsa(ctx->cert_sig, ctx->cert_sig_len,
1700 0 0 if (memcmp(ctx->tbs_hash, tmp, ctx->cert_sig_hash_len) != 0) {
1706 0 0 if (ctx->iecdsa == 0) {
1709 0 0 if (!ctx->iecdsa(ctx->iec, ctx->tbs_hash,