asn1_get_next:
  172|   295k|{
  173|   295k|	const u8 *pos, *end;
  174|   295k|	u8 tmp;
  175|       |
  176|   295k|	os_memset(hdr, 0, sizeof(*hdr));
  ------------------
  |  |  529|   295k|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  177|   295k|	pos = buf;
  178|   295k|	end = buf + len;
  179|       |
  180|   295k|	if (pos >= end) {
  ------------------
  |  Branch (180:6): [True: 0, False: 295k]
  ------------------
  181|      0|		wpa_printf(MSG_DEBUG, "ASN.1: No room for Identifier");
  182|      0|		return -1;
  183|      0|	}
  184|   295k|	hdr->identifier = *pos++;
  185|   295k|	hdr->class = hdr->identifier >> 6;
  186|   295k|	hdr->constructed = !!(hdr->identifier & (1 << 5));
  187|       |
  188|   295k|	if ((hdr->identifier & 0x1f) == 0x1f) {
  ------------------
  |  Branch (188:6): [True: 283k, False: 12.2k]
  ------------------
  189|   283k|		size_t ext_len = 0;
  190|       |
  191|   283k|		hdr->tag = 0;
  192|   283k|		if (pos == end || (*pos & 0x7f) == 0) {
  ------------------
  |  Branch (192:7): [True: 4, False: 283k]
  |  Branch (192:21): [True: 1, False: 283k]
  ------------------
  193|      5|			wpa_printf(MSG_DEBUG,
  194|      5|				   "ASN.1: Invalid extended tag (first octet has to be included with at least one nonzero bit for the tag value)");
  195|      5|			return -1;
  196|      5|		}
  197|  1.64M|		do {
  198|  1.64M|			if (pos >= end) {
  ------------------
  |  Branch (198:8): [True: 9, False: 1.64M]
  ------------------
  199|      9|				wpa_printf(MSG_DEBUG, "ASN.1: Identifier "
  200|      9|					   "underflow");
  201|      9|				return -1;
  202|      9|			}
  203|  1.64M|			ext_len++;
  204|  1.64M|			tmp = *pos++;
  205|  1.64M|			wpa_printf(MSG_MSGDUMP, "ASN.1: Extended tag data: "
  206|  1.64M|				   "0x%02x", tmp);
  207|  1.64M|			hdr->tag = (hdr->tag << 7) | (tmp & 0x7f);
  208|  1.64M|		} while (tmp & 0x80);
  ------------------
  |  Branch (208:12): [True: 1.35M, False: 283k]
  ------------------
  209|   283k|		wpa_printf(MSG_MSGDUMP, "ASN.1: Extended Tag: 0x%x (len=%zu)",
  210|   283k|			   hdr->tag, ext_len);
  211|   283k|		if ((hdr->class != ASN1_CLASS_PRIVATE && hdr->tag < 31) ||
  ------------------
  |  |   46|   566k|#define ASN1_CLASS_PRIVATE		3
  ------------------
  |  Branch (211:8): [True: 452, False: 282k]
  |  Branch (211:44): [True: 6, False: 446]
  ------------------
  212|   283k|		    ext_len * 7 > sizeof(hdr->tag) * 8) {
  ------------------
  |  Branch (212:7): [True: 51, False: 283k]
  ------------------
  213|     57|			wpa_printf(MSG_DEBUG,
  214|     57|				   "ASN.1: Invalid or unsupported (too large) extended Tag: 0x%x (len=%zu)",
  215|     57|				   hdr->tag, ext_len);
  216|     57|			return -1;
  217|     57|		}
  218|   283k|	} else
  219|  12.2k|		hdr->tag = hdr->identifier & 0x1f;
  220|       |
  221|   295k|	if (pos >= end) {
  ------------------
  |  Branch (221:6): [True: 81, False: 295k]
  ------------------
  222|     81|		wpa_printf(MSG_DEBUG, "ASN.1: No room for Length");
  223|     81|		return -1;
  224|     81|	}
  225|   295k|	tmp = *pos++;
  226|   295k|	if (tmp & 0x80) {
  ------------------
  |  Branch (226:6): [True: 809, False: 294k]
  ------------------
  227|    809|		if (tmp == 0xff) {
  ------------------
  |  Branch (227:7): [True: 5, False: 804]
  ------------------
  228|      5|			wpa_printf(MSG_DEBUG, "ASN.1: Reserved length "
  229|      5|				   "value 0xff used");
  230|      5|			return -1;
  231|      5|		}
  232|    804|		tmp &= 0x7f; /* number of subsequent octets */
  233|    804|		hdr->length = 0;
  234|    804|		if (tmp == 0 || pos == end || *pos == 0) {
  ------------------
  |  Branch (234:7): [True: 2, False: 802]
  |  Branch (234:19): [True: 9, False: 793]
  |  Branch (234:33): [True: 1, False: 792]
  ------------------
  235|     12|			wpa_printf(MSG_DEBUG,
  236|     12|				   "ASN.1: Definite long form of the length does not start with a nonzero value");
  237|     12|			return -1;
  238|     12|		}
  239|    792|		if (tmp > 4) {
  ------------------
  |  Branch (239:7): [True: 7, False: 785]
  ------------------
  240|      7|			wpa_printf(MSG_DEBUG, "ASN.1: Too long length field");
  241|      7|			return -1;
  242|      7|		}
  243|  1.98k|		while (tmp--) {
  ------------------
  |  Branch (243:10): [True: 1.20k, False: 781]
  ------------------
  244|  1.20k|			if (pos >= end) {
  ------------------
  |  Branch (244:8): [True: 4, False: 1.19k]
  ------------------
  245|      4|				wpa_printf(MSG_DEBUG, "ASN.1: Length "
  246|      4|					   "underflow");
  247|      4|				return -1;
  248|      4|			}
  249|  1.19k|			hdr->length = (hdr->length << 8) | *pos++;
  250|  1.19k|		}
  251|    781|		if (hdr->length < 128) {
  ------------------
  |  Branch (251:7): [True: 9, False: 772]
  ------------------
  252|      9|			wpa_printf(MSG_DEBUG,
  253|      9|				   "ASN.1: Definite long form of the length used with too short length");
  254|      9|			return -1;
  255|      9|		}
  256|   294k|	} else {
  257|       |		/* Short form - length 0..127 in one octet */
  258|   294k|		hdr->length = tmp;
  259|   294k|	}
  260|       |
  261|   295k|	if (end < pos || hdr->length > (unsigned int) (end - pos)) {
  ------------------
  |  Branch (261:6): [True: 0, False: 295k]
  |  Branch (261:19): [True: 100, False: 295k]
  ------------------
  262|    100|		wpa_printf(MSG_DEBUG, "ASN.1: Contents underflow");
  263|    100|		return -1;
  264|    100|	}
  265|       |
  266|   295k|	hdr->payload = pos;
  267|       |
  268|   295k|	if (!asn1_valid_der(hdr)) {
  ------------------
  |  Branch (268:6): [True: 95, False: 295k]
  ------------------
  269|     95|		asn1_print_hdr(hdr, "ASN.1: Invalid DER encoding: ");
  270|     95|		return -1;
  271|     95|	}
  272|   295k|	return 0;
  273|   295k|}
asn1_print_hdr:
  277|     95|{
  278|     95|	wpa_printf(MSG_DEBUG, "%sclass %d constructed %d tag 0x%x",
  279|     95|		   title, hdr->class, hdr->constructed, hdr->tag);
  280|     95|}
asn1_unexpected:
  284|     11|{
  285|     11|	wpa_printf(MSG_DEBUG, "%s - found class %d constructed %d tag 0x%x",
  286|     11|		   title, hdr->class, hdr->constructed, hdr->tag);
  287|     11|}
asn1_parse_oid:
  291|  1.41k|{
  292|  1.41k|	const u8 *pos, *end;
  293|  1.41k|	unsigned long val;
  294|  1.41k|	u8 tmp;
  295|       |
  296|  1.41k|	os_memset(oid, 0, sizeof(*oid));
  ------------------
  |  |  529|  1.41k|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  297|       |
  298|  1.41k|	pos = buf;
  299|  1.41k|	end = buf + len;
  300|       |
  301|  10.4k|	while (pos < end) {
  ------------------
  |  Branch (301:9): [True: 9.04k, False: 1.38k]
  ------------------
  302|  9.04k|		val = 0;
  303|       |
  304|  24.4k|		do {
  305|  24.4k|			if (pos >= end)
  ------------------
  |  Branch (305:8): [True: 15, False: 24.4k]
  ------------------
  306|     15|				return -1;
  307|  24.4k|			tmp = *pos++;
  308|  24.4k|			val = (val << 7) | (tmp & 0x7f);
  309|  24.4k|		} while (tmp & 0x80);
  ------------------
  |  Branch (309:12): [True: 15.4k, False: 9.03k]
  ------------------
  310|       |
  311|  9.03k|		if (oid->len >= ASN1_MAX_OID_LEN) {
  ------------------
  |  |   55|  9.03k|#define ASN1_MAX_OID_LEN 20
  ------------------
  |  Branch (311:7): [True: 15, False: 9.01k]
  ------------------
  312|     15|			wpa_printf(MSG_DEBUG, "ASN.1: Too long OID value");
  313|     15|			return -1;
  314|     15|		}
  315|  9.01k|		if (oid->len == 0) {
  ------------------
  |  Branch (315:7): [True: 1.40k, False: 7.61k]
  ------------------
  316|       |			/*
  317|       |			 * The first octet encodes the first two object
  318|       |			 * identifier components in (X*40) + Y formula.
  319|       |			 * X = 0..2.
  320|       |			 */
  321|  1.40k|			oid->oid[0] = val / 40;
  322|  1.40k|			if (oid->oid[0] > 2)
  ------------------
  |  Branch (322:8): [True: 525, False: 879]
  ------------------
  323|    525|				oid->oid[0] = 2;
  324|  1.40k|			oid->oid[1] = val - oid->oid[0] * 40;
  325|  1.40k|			oid->len = 2;
  326|  1.40k|		} else
  327|  7.61k|			oid->oid[oid->len++] = val;
  328|  9.01k|	}
  329|       |
  330|  1.38k|	return 0;
  331|  1.41k|}
asn1_get_oid:
  336|  1.42k|{
  337|  1.42k|	struct asn1_hdr hdr;
  338|       |
  339|  1.42k|	if (asn1_get_next(buf, len, &hdr) < 0 || hdr.length == 0 ||
  ------------------
  |  Branch (339:6): [True: 0, False: 1.42k]
  |  Branch (339:43): [True: 11, False: 1.41k]
  ------------------
  340|  1.41k|	    !asn1_is_oid(&hdr)) {
  ------------------
  |  Branch (340:6): [True: 0, False: 1.41k]
  ------------------
  341|     11|		asn1_unexpected(&hdr, "ASN.1: Expected OID");
  342|     11|		return -1;
  343|     11|	}
  344|       |
  345|  1.41k|	*next = hdr.payload + hdr.length;
  346|       |
  347|  1.41k|	return asn1_parse_oid(hdr.payload, hdr.length, oid);
  348|  1.42k|}
asn1_oid_to_str:
  352|  1.38k|{
  353|  1.38k|	char *pos = buf;
  354|  1.38k|	size_t i;
  355|  1.38k|	int ret;
  356|       |
  357|  1.38k|	if (len == 0)
  ------------------
  |  Branch (357:6): [True: 0, False: 1.38k]
  ------------------
  358|      0|		return;
  359|       |
  360|  1.38k|	buf[0] = '\0';
  361|       |
  362|  11.3k|	for (i = 0; i < oid->len; i++) {
  ------------------
  |  Branch (362:14): [True: 10.1k, False: 1.19k]
  ------------------
  363|  10.1k|		ret = os_snprintf(pos, buf + len - pos,
  ------------------
  |  |  572|  10.1k|#define os_snprintf snprintf
  ------------------
  364|  10.1k|				  "%s%lu",
  365|  10.1k|				  i == 0 ? "" : ".", oid->oid[i]);
  ------------------
  |  Branch (365:7): [True: 1.38k, False: 8.72k]
  ------------------
  366|  10.1k|		if (os_snprintf_error(buf + len - pos, ret))
  ------------------
  |  Branch (366:7): [True: 196, False: 9.91k]
  ------------------
  367|    196|			break;
  368|  9.91k|		pos += ret;
  369|  9.91k|	}
  370|  1.38k|	buf[len - 1] = '\0';
  371|  1.38k|}
asn1.c:asn1_valid_der:
  127|   295k|{
  128|   295k|	if (hdr->class != ASN1_CLASS_UNIVERSAL)
  ------------------
  |  |   43|   295k|#define ASN1_CLASS_UNIVERSAL		0
  ------------------
  |  Branch (128:6): [True: 285k, False: 10.0k]
  ------------------
  129|   285k|		return 1;
  130|  10.0k|	if (hdr->tag == ASN1_TAG_BOOLEAN && !asn1_valid_der_boolean(hdr))
  ------------------
  |  |   13|  20.1k|#define ASN1_TAG_BOOLEAN	0x01
  ------------------
  |  Branch (130:6): [True: 1.26k, False: 8.79k]
  |  Branch (130:38): [True: 30, False: 1.23k]
  ------------------
  131|     30|		return 0;
  132|  10.0k|	if (hdr->tag == ASN1_TAG_NULL && hdr->length != 0)
  ------------------
  |  |   17|  20.0k|#define ASN1_TAG_NULL		0x05
  ------------------
  |  Branch (132:6): [True: 384, False: 9.64k]
  |  Branch (132:35): [True: 19, False: 365]
  ------------------
  133|     19|		return 0;
  134|       |
  135|       |	/* Check for allowed primitive/constructed values */
  136|  10.0k|	if (hdr->constructed &&
  ------------------
  |  Branch (136:6): [True: 1.81k, False: 8.20k]
  ------------------
  137|  1.81k|	    (hdr->tag == ASN1_TAG_BOOLEAN ||
  ------------------
  |  |   13|  3.62k|#define ASN1_TAG_BOOLEAN	0x01
  ------------------
  |  Branch (137:7): [True: 1, False: 1.81k]
  ------------------
  138|  1.81k|	     hdr->tag == ASN1_TAG_INTEGER ||
  ------------------
  |  |   14|  3.62k|#define ASN1_TAG_INTEGER	0x02
  ------------------
  |  Branch (138:7): [True: 1, False: 1.80k]
  ------------------
  139|  1.80k|	     hdr->tag == ASN1_TAG_NULL ||
  ------------------
  |  |   17|  3.62k|#define ASN1_TAG_NULL		0x05
  ------------------
  |  Branch (139:7): [True: 1, False: 1.80k]
  ------------------
  140|  1.80k|	     hdr->tag == ASN1_TAG_OID ||
  ------------------
  |  |   18|  3.61k|#define ASN1_TAG_OID		0x06
  ------------------
  |  Branch (140:7): [True: 3, False: 1.80k]
  ------------------
  141|  1.80k|	     hdr->tag == ANS1_TAG_RELATIVE_OID ||
  ------------------
  |  |   25|  3.61k|#define ANS1_TAG_RELATIVE_OID	0x0D
  ------------------
  |  Branch (141:7): [True: 4, False: 1.80k]
  ------------------
  142|  1.80k|	     hdr->tag == ASN1_TAG_REAL ||
  ------------------
  |  |   21|  3.61k|#define ASN1_TAG_REAL		0x09 /* not yet parsed */
  ------------------
  |  Branch (142:7): [True: 1, False: 1.80k]
  ------------------
  143|  1.80k|	     hdr->tag == ASN1_TAG_ENUMERATED ||
  ------------------
  |  |   22|  3.61k|#define ASN1_TAG_ENUMERATED	0x0A /* not yet parsed */
  ------------------
  |  Branch (143:7): [True: 1, False: 1.79k]
  ------------------
  144|  1.79k|	     hdr->tag == ASN1_TAG_BITSTRING ||
  ------------------
  |  |   15|  3.61k|#define ASN1_TAG_BITSTRING	0x03
  ------------------
  |  Branch (144:7): [True: 1, False: 1.79k]
  ------------------
  145|  1.79k|	     hdr->tag == ASN1_TAG_OCTETSTRING ||
  ------------------
  |  |   16|  3.60k|#define ASN1_TAG_OCTETSTRING	0x04
  ------------------
  |  Branch (145:7): [True: 2, False: 1.79k]
  ------------------
  146|  1.79k|	     hdr->tag == ASN1_TAG_NUMERICSTRING ||
  ------------------
  |  |   29|  3.60k|#define ASN1_TAG_NUMERICSTRING	0x12 /* not yet parsed */
  ------------------
  |  Branch (146:7): [True: 3, False: 1.79k]
  ------------------
  147|  1.79k|	     hdr->tag == ASN1_TAG_PRINTABLESTRING ||
  ------------------
  |  |   30|  3.60k|#define ASN1_TAG_PRINTABLESTRING	0x13
  ------------------
  |  Branch (147:7): [True: 3, False: 1.79k]
  ------------------
  148|  1.79k|	     hdr->tag == ASN1_TAG_T61STRING ||
  ------------------
  |  |   31|  3.60k|#define ASN1_TAG_T61STRING	0x14 /* not yet parsed */
  ------------------
  |  Branch (148:7): [True: 1, False: 1.78k]
  ------------------
  149|  1.78k|	     hdr->tag == ASN1_TAG_VIDEOTEXSTRING ||
  ------------------
  |  |   32|  3.60k|#define ASN1_TAG_VIDEOTEXSTRING	0x15 /* not yet parsed */
  ------------------
  |  Branch (149:7): [True: 3, False: 1.78k]
  ------------------
  150|  1.78k|	     hdr->tag == ASN1_TAG_VISIBLESTRING ||
  ------------------
  |  |   37|  3.59k|#define ASN1_TAG_VISIBLESTRING	0x1A
  ------------------
  |  Branch (150:7): [True: 2, False: 1.78k]
  ------------------
  151|  1.78k|	     hdr->tag == ASN1_TAG_IA5STRING ||
  ------------------
  |  |   33|  3.59k|#define ASN1_TAG_IA5STRING	0x16
  ------------------
  |  Branch (151:7): [True: 2, False: 1.78k]
  ------------------
  152|  1.78k|	     hdr->tag == ASN1_TAG_GRAPHICSTRING ||
  ------------------
  |  |   36|  3.59k|#define ASN1_TAG_GRAPHICSTRING	0x19 /* not yet parsed */
  ------------------
  |  Branch (152:7): [True: 2, False: 1.78k]
  ------------------
  153|  1.78k|	     hdr->tag == ASN1_TAG_GENERALSTRING ||
  ------------------
  |  |   38|  3.59k|#define ASN1_TAG_GENERALSTRING	0x1B /* not yet parsed */
  ------------------
  |  Branch (153:7): [True: 1, False: 1.77k]
  ------------------
  154|  1.77k|	     hdr->tag == ASN1_TAG_UNIVERSALSTRING ||
  ------------------
  |  |   39|  3.59k|#define ASN1_TAG_UNIVERSALSTRING	0x1C /* not yet parsed */
  ------------------
  |  Branch (154:7): [True: 1, False: 1.77k]
  ------------------
  155|  1.77k|	     hdr->tag == ASN1_TAG_UTF8STRING ||
  ------------------
  |  |   24|  3.58k|#define ASN1_TAG_UTF8STRING	0x0C /* not yet parsed */
  ------------------
  |  Branch (155:7): [True: 2, False: 1.77k]
  ------------------
  156|  1.77k|	     hdr->tag == ASN1_TAG_BMPSTRING ||
  ------------------
  |  |   41|  3.58k|#define ASN1_TAG_BMPSTRING	0x1E /* not yet parsed */
  ------------------
  |  Branch (156:7): [True: 1, False: 1.77k]
  ------------------
  157|  1.77k|	     hdr->tag == ASN1_TAG_CHARACTERSTRING ||
  ------------------
  |  |   40|  3.58k|#define ASN1_TAG_CHARACTERSTRING	0x1D /* not yet parsed */
  ------------------
  |  Branch (157:7): [True: 1, False: 1.77k]
  ------------------
  158|  1.77k|	     hdr->tag == ASN1_TAG_UTCTIME ||
  ------------------
  |  |   34|  3.58k|#define ASN1_TAG_UTCTIME	0x17
  ------------------
  |  Branch (158:7): [True: 2, False: 1.77k]
  ------------------
  159|  1.77k|	     hdr->tag == ASN1_TAG_GENERALIZEDTIME ||
  ------------------
  |  |   35|  3.58k|#define ASN1_TAG_GENERALIZEDTIME	0x18 /* not yet parsed */
  ------------------
  |  Branch (159:7): [True: 1, False: 1.77k]
  ------------------
  160|  1.77k|	     hdr->tag == ASN1_TAG_TIME))
  ------------------
  |  |   26|  1.77k|#define ASN1_TAG_TIME		0x0E
  ------------------
  |  Branch (160:7): [True: 2, False: 1.76k]
  ------------------
  161|     42|		return 0;
  162|  9.96k|	if (!hdr->constructed &&
  ------------------
  |  Branch (162:6): [True: 8.20k, False: 1.76k]
  ------------------
  163|  8.20k|	    (hdr->tag == ASN1_TAG_SEQUENCE ||
  ------------------
  |  |   27|  16.4k|#define ASN1_TAG_SEQUENCE	0x10 /* shall be constructed */
  ------------------
  |  Branch (163:7): [True: 3, False: 8.19k]
  ------------------
  164|  8.19k|	     hdr->tag == ASN1_TAG_SET))
  ------------------
  |  |   28|  8.19k|#define ASN1_TAG_SET		0x11
  ------------------
  |  Branch (164:7): [True: 1, False: 8.19k]
  ------------------
  165|      4|		return 0;
  166|       |
  167|  9.96k|	return 1;
  168|  9.96k|}
asn1.c:asn1_valid_der_boolean:
  107|  1.26k|{
  108|       |	/* Enforce DER requirements for a single way of encoding a BOOLEAN */
  109|  1.26k|	if (hdr->length != 1) {
  ------------------
  |  Branch (109:6): [True: 21, False: 1.24k]
  ------------------
  110|     21|		wpa_printf(MSG_DEBUG, "ASN.1: Unexpected BOOLEAN length (%u)",
  111|     21|			   hdr->length);
  112|     21|		return 0;
  113|     21|	}
  114|       |
  115|  1.24k|	if (hdr->payload[0] != 0 && hdr->payload[0] != 0xff) {
  ------------------
  |  Branch (115:6): [True: 974, False: 270]
  |  Branch (115:30): [True: 9, False: 965]
  ------------------
  116|      9|		wpa_printf(MSG_DEBUG,
  117|      9|			   "ASN.1: Invalid BOOLEAN value 0x%x (DER requires 0 or 0xff)",
  118|      9|			   hdr->payload[0]);
  119|      9|		return 0;
  120|      9|	}
  121|       |
  122|  1.23k|	return 1;
  123|  1.24k|}

asn1.c:asn1_is_oid:
   89|  1.41k|{
   90|  1.41k|	return hdr->class == ASN1_CLASS_UNIVERSAL &&
  ------------------
  |  |   43|  2.83k|#define ASN1_CLASS_UNIVERSAL		0
  ------------------
  |  Branch (90:9): [True: 1.41k, False: 0]
  ------------------
   91|  1.41k|		hdr->tag == ASN1_TAG_OID;
  ------------------
  |  |   18|  2.83k|#define ASN1_TAG_OID		0x06
  ------------------
  |  Branch (91:3): [True: 1.41k, False: 0]
  ------------------
   92|  1.41k|}

asn1.c:os_snprintf_error:
  580|  10.1k|{
  581|  10.1k|	return res < 0 || (unsigned int) res >= size;
  ------------------
  |  Branch (581:9): [True: 0, False: 10.1k]
  |  Branch (581:20): [True: 196, False: 9.91k]
  ------------------
  582|  10.1k|}

wpa_printf:
  224|  2.22M|{
  225|  2.22M|	va_list ap;
  226|       |
  227|  2.22M|	if (level >= wpa_debug_level) {
  ------------------
  |  Branch (227:6): [True: 0, False: 2.22M]
  ------------------
  228|       |#ifdef CONFIG_ANDROID_LOG
  229|       |		va_start(ap, fmt);
  230|       |		__android_log_vprint(wpa_to_android_level(level),
  231|       |				     ANDROID_LOG_NAME, fmt, ap);
  232|       |		va_end(ap);
  233|       |#else /* CONFIG_ANDROID_LOG */
  234|       |#ifdef CONFIG_DEBUG_SYSLOG
  235|       |		if (wpa_debug_syslog) {
  236|       |			va_start(ap, fmt);
  237|       |			vsyslog(syslog_priority(level), fmt, ap);
  238|       |			va_end(ap);
  239|       |		}
  240|       |#endif /* CONFIG_DEBUG_SYSLOG */
  241|      0|		wpa_debug_print_timestamp();
  242|       |#ifdef CONFIG_DEBUG_FILE
  243|       |		if (out_file) {
  244|       |			va_start(ap, fmt);
  245|       |			vfprintf(out_file, fmt, ap);
  246|       |			fprintf(out_file, "\n");
  247|       |			va_end(ap);
  248|       |		}
  249|       |#endif /* CONFIG_DEBUG_FILE */
  250|      0|		if (!wpa_debug_syslog && !out_file) {
  ------------------
  |  Branch (250:7): [True: 0, False: 0]
  |  Branch (250:28): [True: 0, False: 0]
  ------------------
  251|      0|			va_start(ap, fmt);
  252|      0|			vprintf(fmt, ap);
  253|      0|			printf("\n");
  254|      0|			va_end(ap);
  255|      0|		}
  256|      0|#endif /* CONFIG_ANDROID_LOG */
  257|      0|	}
  258|       |
  259|       |#ifdef CONFIG_DEBUG_LINUX_TRACING
  260|       |	if (wpa_debug_tracing_file != NULL) {
  261|       |		va_start(ap, fmt);
  262|       |		fprintf(wpa_debug_tracing_file, WPAS_TRACE_PFX, level);
  263|       |		vfprintf(wpa_debug_tracing_file, fmt, ap);
  264|       |		fprintf(wpa_debug_tracing_file, "\n");
  265|       |		fflush(wpa_debug_tracing_file);
  266|       |		va_end(ap);
  267|       |	}
  268|       |#endif /* CONFIG_DEBUG_LINUX_TRACING */
  269|  2.22M|}
wpa_hexdump:
  400|  1.86k|{
  401|  1.86k|	_wpa_hexdump(level, title, buf, len, 1, 0);
  402|  1.86k|}
wpa_hexdump_ascii:
  526|  1.20k|{
  527|  1.20k|	_wpa_hexdump_ascii(level, title, buf, len, 1);
  528|  1.20k|}
wpa_debug.c:_wpa_hexdump:
  274|  1.86k|{
  275|  1.86k|	size_t i;
  276|       |
  277|       |#ifdef CONFIG_DEBUG_LINUX_TRACING
  278|       |	if (wpa_debug_tracing_file != NULL) {
  279|       |		fprintf(wpa_debug_tracing_file,
  280|       |			WPAS_TRACE_PFX "%s - hexdump(len=%lu):",
  281|       |			level, title, (unsigned long) len);
  282|       |		if (buf == NULL) {
  283|       |			fprintf(wpa_debug_tracing_file, " [NULL]\n");
  284|       |		} else if (!show) {
  285|       |			fprintf(wpa_debug_tracing_file, " [REMOVED]\n");
  286|       |		} else {
  287|       |			for (i = 0; i < len; i++)
  288|       |				fprintf(wpa_debug_tracing_file,
  289|       |					" %02x", buf[i]);
  290|       |		}
  291|       |		fflush(wpa_debug_tracing_file);
  292|       |	}
  293|       |#endif /* CONFIG_DEBUG_LINUX_TRACING */
  294|       |
  295|  1.86k|	if (level < wpa_debug_level)
  ------------------
  |  Branch (295:6): [True: 1.86k, False: 0]
  ------------------
  296|  1.86k|		return;
  297|       |#ifdef CONFIG_ANDROID_LOG
  298|       |	{
  299|       |		const char *display;
  300|       |		char *strbuf = NULL;
  301|       |		size_t slen = len;
  302|       |		if (buf == NULL) {
  303|       |			display = " [NULL]";
  304|       |		} else if (len == 0) {
  305|       |			display = "";
  306|       |		} else if (show && len) {
  307|       |			/* Limit debug message length for Android log */
  308|       |			if (slen > 32)
  309|       |				slen = 32;
  310|       |			strbuf = os_malloc(1 + 3 * slen);
  311|       |			if (strbuf == NULL) {
  312|       |				wpa_printf(MSG_ERROR, "wpa_hexdump: Failed to "
  313|       |					   "allocate message buffer");
  314|       |				return;
  315|       |			}
  316|       |
  317|       |			for (i = 0; i < slen; i++)
  318|       |				os_snprintf(&strbuf[i * 3], 4, " %02x",
  319|       |					    buf[i]);
  320|       |
  321|       |			display = strbuf;
  322|       |		} else {
  323|       |			display = " [REMOVED]";
  324|       |		}
  325|       |
  326|       |		__android_log_print(wpa_to_android_level(level),
  327|       |				    ANDROID_LOG_NAME,
  328|       |				    "%s - hexdump(len=%lu):%s%s",
  329|       |				    title, (long unsigned int) len, display,
  330|       |				    len > slen ? " ..." : "");
  331|       |		bin_clear_free(strbuf, 1 + 3 * slen);
  332|       |		return;
  333|       |	}
  334|       |#else /* CONFIG_ANDROID_LOG */
  335|       |#ifdef CONFIG_DEBUG_SYSLOG
  336|       |	if (wpa_debug_syslog) {
  337|       |		const char *display;
  338|       |		char *strbuf = NULL;
  339|       |
  340|       |		if (buf == NULL) {
  341|       |			display = " [NULL]";
  342|       |		} else if (len == 0) {
  343|       |			display = "";
  344|       |		} else if (show && len) {
  345|       |			strbuf = os_malloc(1 + 3 * len);
  346|       |			if (strbuf == NULL) {
  347|       |				wpa_printf(MSG_ERROR, "wpa_hexdump: Failed to "
  348|       |					   "allocate message buffer");
  349|       |				return;
  350|       |			}
  351|       |
  352|       |			for (i = 0; i < len; i++)
  353|       |				os_snprintf(&strbuf[i * 3], 4, " %02x",
  354|       |					    buf[i]);
  355|       |
  356|       |			display = strbuf;
  357|       |		} else {
  358|       |			display = " [REMOVED]";
  359|       |		}
  360|       |
  361|       |		syslog(syslog_priority(level), "%s - hexdump(len=%lu):%s",
  362|       |		       title, (unsigned long) len, display);
  363|       |		bin_clear_free(strbuf, 1 + 3 * len);
  364|       |		if (only_syslog)
  365|       |			return;
  366|       |	}
  367|       |#endif /* CONFIG_DEBUG_SYSLOG */
  368|      0|	wpa_debug_print_timestamp();
  369|       |#ifdef CONFIG_DEBUG_FILE
  370|       |	if (out_file) {
  371|       |		fprintf(out_file, "%s - hexdump(len=%lu):",
  372|       |			title, (unsigned long) len);
  373|       |		if (buf == NULL) {
  374|       |			fprintf(out_file, " [NULL]");
  375|       |		} else if (show) {
  376|       |			for (i = 0; i < len; i++)
  377|       |				fprintf(out_file, " %02x", buf[i]);
  378|       |		} else {
  379|       |			fprintf(out_file, " [REMOVED]");
  380|       |		}
  381|       |		fprintf(out_file, "\n");
  382|       |	}
  383|       |#endif /* CONFIG_DEBUG_FILE */
  384|      0|	if (!wpa_debug_syslog && !out_file) {
  ------------------
  |  Branch (384:6): [True: 0, False: 0]
  |  Branch (384:27): [True: 0, False: 0]
  ------------------
  385|      0|		printf("%s - hexdump(len=%lu):", title, (unsigned long) len);
  386|      0|		if (buf == NULL) {
  ------------------
  |  Branch (386:7): [True: 0, False: 0]
  ------------------
  387|      0|			printf(" [NULL]");
  388|      0|		} else if (show) {
  ------------------
  |  Branch (388:14): [True: 0, False: 0]
  ------------------
  389|      0|			for (i = 0; i < len; i++)
  ------------------
  |  Branch (389:16): [True: 0, False: 0]
  ------------------
  390|      0|				printf(" %02x", buf[i]);
  391|      0|		} else {
  392|      0|			printf(" [REMOVED]");
  393|      0|		}
  394|      0|		printf("\n");
  395|      0|	}
  396|      0|#endif /* CONFIG_ANDROID_LOG */
  397|      0|}
wpa_debug.c:_wpa_hexdump_ascii:
  413|  1.20k|{
  414|  1.20k|	size_t i, llen;
  415|  1.20k|	const u8 *pos = buf;
  416|  1.20k|	const size_t line_len = 16;
  417|       |
  418|       |#ifdef CONFIG_DEBUG_LINUX_TRACING
  419|       |	if (wpa_debug_tracing_file != NULL) {
  420|       |		fprintf(wpa_debug_tracing_file,
  421|       |			WPAS_TRACE_PFX "%s - hexdump_ascii(len=%lu):",
  422|       |			level, title, (unsigned long) len);
  423|       |		if (buf == NULL) {
  424|       |			fprintf(wpa_debug_tracing_file, " [NULL]\n");
  425|       |		} else if (!show) {
  426|       |			fprintf(wpa_debug_tracing_file, " [REMOVED]\n");
  427|       |		} else {
  428|       |			/* can do ascii processing in userspace */
  429|       |			for (i = 0; i < len; i++)
  430|       |				fprintf(wpa_debug_tracing_file,
  431|       |					" %02x", pos[i]);
  432|       |		}
  433|       |		fflush(wpa_debug_tracing_file);
  434|       |	}
  435|       |#endif /* CONFIG_DEBUG_LINUX_TRACING */
  436|       |
  437|  1.20k|	if (level < wpa_debug_level)
  ------------------
  |  Branch (437:6): [True: 1.20k, False: 0]
  ------------------
  438|  1.20k|		return;
  439|       |#ifdef CONFIG_ANDROID_LOG
  440|       |	_wpa_hexdump(level, title, buf, len, show, 0);
  441|       |#else /* CONFIG_ANDROID_LOG */
  442|       |#ifdef CONFIG_DEBUG_SYSLOG
  443|       |	if (wpa_debug_syslog)
  444|       |		_wpa_hexdump(level, title, buf, len, show, 1);
  445|       |#endif /* CONFIG_DEBUG_SYSLOG */
  446|      0|	wpa_debug_print_timestamp();
  447|       |#ifdef CONFIG_DEBUG_FILE
  448|       |	if (out_file) {
  449|       |		if (!show) {
  450|       |			fprintf(out_file,
  451|       |				"%s - hexdump_ascii(len=%lu): [REMOVED]\n",
  452|       |				title, (unsigned long) len);
  453|       |			goto file_done;
  454|       |		}
  455|       |		if (buf == NULL) {
  456|       |			fprintf(out_file,
  457|       |				"%s - hexdump_ascii(len=%lu): [NULL]\n",
  458|       |				title, (unsigned long) len);
  459|       |			goto file_done;
  460|       |		}
  461|       |		fprintf(out_file, "%s - hexdump_ascii(len=%lu):\n",
  462|       |			title, (unsigned long) len);
  463|       |		while (len) {
  464|       |			llen = len > line_len ? line_len : len;
  465|       |			fprintf(out_file, "    ");
  466|       |			for (i = 0; i < llen; i++)
  467|       |				fprintf(out_file, " %02x", pos[i]);
  468|       |			for (i = llen; i < line_len; i++)
  469|       |				fprintf(out_file, "   ");
  470|       |			fprintf(out_file, "   ");
  471|       |			for (i = 0; i < llen; i++) {
  472|       |				if (isprint(pos[i]))
  473|       |					fprintf(out_file, "%c", pos[i]);
  474|       |				else
  475|       |					fprintf(out_file, "_");
  476|       |			}
  477|       |			for (i = llen; i < line_len; i++)
  478|       |				fprintf(out_file, " ");
  479|       |			fprintf(out_file, "\n");
  480|       |			pos += llen;
  481|       |			len -= llen;
  482|       |		}
  483|       |	}
  484|       |file_done:
  485|       |#endif /* CONFIG_DEBUG_FILE */
  486|      0|	if (!wpa_debug_syslog && !out_file) {
  ------------------
  |  Branch (486:6): [True: 0, False: 0]
  |  Branch (486:27): [True: 0, False: 0]
  ------------------
  487|      0|		if (!show) {
  ------------------
  |  Branch (487:7): [True: 0, False: 0]
  ------------------
  488|      0|			printf("%s - hexdump_ascii(len=%lu): [REMOVED]\n",
  489|      0|			       title, (unsigned long) len);
  490|      0|			return;
  491|      0|		}
  492|      0|		if (buf == NULL) {
  ------------------
  |  Branch (492:7): [True: 0, False: 0]
  ------------------
  493|      0|			printf("%s - hexdump_ascii(len=%lu): [NULL]\n",
  494|      0|			       title, (unsigned long) len);
  495|      0|			return;
  496|      0|		}
  497|      0|		printf("%s - hexdump_ascii(len=%lu):\n", title,
  498|      0|		       (unsigned long) len);
  499|      0|		while (len) {
  ------------------
  |  Branch (499:10): [True: 0, False: 0]
  ------------------
  500|      0|			llen = len > line_len ? line_len : len;
  ------------------
  |  Branch (500:11): [True: 0, False: 0]
  ------------------
  501|      0|			printf("    ");
  502|      0|			for (i = 0; i < llen; i++)
  ------------------
  |  Branch (502:16): [True: 0, False: 0]
  ------------------
  503|      0|				printf(" %02x", pos[i]);
  504|      0|			for (i = llen; i < line_len; i++)
  ------------------
  |  Branch (504:19): [True: 0, False: 0]
  ------------------
  505|      0|				printf("   ");
  506|      0|			printf("   ");
  507|      0|			for (i = 0; i < llen; i++) {
  ------------------
  |  Branch (507:16): [True: 0, False: 0]
  ------------------
  508|      0|				if (isprint(pos[i]))
  ------------------
  |  Branch (508:9): [True: 0, False: 0]
  ------------------
  509|      0|					printf("%c", pos[i]);
  510|      0|				else
  511|      0|					printf("_");
  512|      0|			}
  513|      0|			for (i = llen; i < line_len; i++)
  ------------------
  |  Branch (513:19): [True: 0, False: 0]
  ------------------
  514|      0|				printf(" ");
  515|      0|			printf("\n");
  516|      0|			pos += llen;
  517|      0|			len -= llen;
  518|      0|		}
  519|      0|	}
  520|      0|#endif /* CONFIG_ANDROID_LOG */
  521|      0|}

LLVMFuzzerTestOneInput:
  177|    927|{
  178|    927|	wpa_fuzzer_set_debug_level();
  179|       |
  180|    927|	if (asn1_parse(data, size, 0) < 0)
  ------------------
  |  Branch (180:6): [True: 589, False: 338]
  ------------------
  181|    589|		wpa_printf(MSG_DEBUG, "Failed to parse DER ASN.1");
  182|       |
  183|    927|	return 0;
  184|    927|}
asn1.c:asn1_parse:
   34|  3.74k|{
   35|  3.74k|	const u8 *pos, *prev, *end;
   36|  3.74k|	char prefix[10], str[100];
   37|  3.74k|	int _level;
   38|  3.74k|	struct asn1_hdr hdr;
   39|  3.74k|	struct asn1_oid oid;
   40|  3.74k|	u8 tmp;
   41|       |
   42|  3.74k|	_level = level;
   43|  3.74k|	if ((size_t) _level > sizeof(prefix) - 1)
  ------------------
  |  Branch (43:6): [True: 738, False: 3.00k]
  ------------------
   44|    738|		_level = sizeof(prefix) - 1;
   45|  3.74k|	memset(prefix, ' ', _level);
   46|  3.74k|	prefix[_level] = '\0';
   47|       |
   48|  3.74k|	pos = buf;
   49|  3.74k|	end = buf + len;
   50|       |
   51|   296k|	while (pos < end) {
  ------------------
  |  Branch (51:9): [True: 294k, False: 2.52k]
  ------------------
   52|   294k|		if (asn1_get_next(pos, end - pos, &hdr) < 0)
  ------------------
  |  Branch (52:7): [True: 384, False: 293k]
  ------------------
   53|    384|			return -1;
   54|       |
   55|   293k|		prev = pos;
   56|   293k|		pos = hdr.payload;
   57|       |
   58|   293k|		wpa_printf(MSG_MSGDUMP, "ASN.1:%s Class %d(%s) P/C %d(%s) "
   59|   293k|			   "Tag %u Length %u",
   60|   293k|			   prefix, hdr.class, asn1_class_str(hdr.class),
   61|   293k|			   hdr.constructed,
   62|   293k|			   hdr.constructed ? "Constructed" : "Primitive",
  ------------------
  |  Branch (62:7): [True: 286k, False: 7.63k]
  ------------------
   63|   293k|			   hdr.tag, hdr.length);
   64|       |
   65|   293k|		if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC &&
  ------------------
  |  |   45|   587k|#define ASN1_CLASS_CONTEXT_SPECIFIC	2
  ------------------
  |  Branch (65:7): [True: 1.57k, False: 292k]
  ------------------
   66|  1.57k|		    hdr.constructed) {
  ------------------
  |  Branch (66:7): [True: 1.18k, False: 393]
  ------------------
   67|  1.18k|			if (asn1_parse(pos, hdr.length, level + 1) < 0)
  ------------------
  |  Branch (67:8): [True: 403, False: 781]
  ------------------
   68|    403|				return -1;
   69|    781|			pos += hdr.length;
   70|    781|		}
   71|       |
   72|   293k|		if (hdr.class != ASN1_CLASS_UNIVERSAL)
  ------------------
  |  |   43|   293k|#define ASN1_CLASS_UNIVERSAL		0
  ------------------
  |  Branch (72:7): [True: 284k, False: 8.53k]
  ------------------
   73|   284k|			continue;
   74|       |
   75|  8.53k|		switch (hdr.tag) {
   76|    643|		case ASN1_TAG_EOC:
  ------------------
  |  |   12|    643|#define ASN1_TAG_EOC		0x00 /* not used with DER */
  ------------------
  |  Branch (76:3): [True: 643, False: 7.89k]
  ------------------
   77|    643|			if (hdr.length) {
  ------------------
  |  Branch (77:8): [True: 4, False: 639]
  ------------------
   78|      4|				wpa_printf(MSG_DEBUG, "ASN.1: Non-zero "
   79|      4|					   "end-of-contents length (%u)",
   80|      4|					   hdr.length);
   81|      4|				return -1;
   82|      4|			}
   83|    639|			wpa_printf(MSG_MSGDUMP, "ASN.1:%s EOC", prefix);
   84|    639|			break;
   85|  1.23k|		case ASN1_TAG_BOOLEAN:
  ------------------
  |  |   13|  1.23k|#define ASN1_TAG_BOOLEAN	0x01
  ------------------
  |  Branch (85:3): [True: 1.23k, False: 7.30k]
  ------------------
   86|  1.23k|			if (hdr.length != 1) {
  ------------------
  |  Branch (86:8): [True: 0, False: 1.23k]
  ------------------
   87|      0|				wpa_printf(MSG_DEBUG, "ASN.1: Unexpected "
   88|      0|					   "Boolean length (%u)", hdr.length);
   89|      0|				return -1;
   90|      0|			}
   91|  1.23k|			tmp = *pos++;
   92|  1.23k|			wpa_printf(MSG_MSGDUMP, "ASN.1:%s Boolean %s",
   93|  1.23k|				   prefix, tmp ? "TRUE" : "FALSE");
  ------------------
  |  Branch (93:16): [True: 964, False: 270]
  ------------------
   94|  1.23k|			break;
   95|    521|		case ASN1_TAG_INTEGER:
  ------------------
  |  |   14|    521|#define ASN1_TAG_INTEGER	0x02
  ------------------
  |  Branch (95:3): [True: 521, False: 8.01k]
  ------------------
   96|    521|			wpa_hexdump(MSG_MSGDUMP, "ASN.1: INTEGER",
   97|    521|				    pos, hdr.length);
   98|    521|			pos += hdr.length;
   99|    521|			break;
  100|    622|		case ASN1_TAG_BITSTRING:
  ------------------
  |  |   15|    622|#define ASN1_TAG_BITSTRING	0x03
  ------------------
  |  Branch (100:3): [True: 622, False: 7.91k]
  ------------------
  101|    622|			wpa_hexdump(MSG_MSGDUMP, "ASN.1: BitString",
  102|    622|				    pos, hdr.length);
  103|    622|			pos += hdr.length;
  104|    622|			break;
  105|    510|		case ASN1_TAG_OCTETSTRING:
  ------------------
  |  |   16|    510|#define ASN1_TAG_OCTETSTRING	0x04
  ------------------
  |  Branch (105:3): [True: 510, False: 8.02k]
  ------------------
  106|    510|			wpa_hexdump(MSG_MSGDUMP, "ASN.1: OctetString",
  107|    510|				    pos, hdr.length);
  108|    510|			pos += hdr.length;
  109|    510|			break;
  110|    364|		case ASN1_TAG_NULL:
  ------------------
  |  |   17|    364|#define ASN1_TAG_NULL		0x05
  ------------------
  |  Branch (110:3): [True: 364, False: 8.17k]
  ------------------
  111|    364|			if (hdr.length) {
  ------------------
  |  Branch (111:8): [True: 0, False: 364]
  ------------------
  112|      0|				wpa_printf(MSG_DEBUG, "ASN.1: Non-zero Null "
  113|      0|					   "length (%u)", hdr.length);
  114|      0|				return -1;
  115|      0|			}
  116|    364|			wpa_printf(MSG_MSGDUMP, "ASN.1:%s Null", prefix);
  117|    364|			break;
  118|  1.42k|		case ASN1_TAG_OID:
  ------------------
  |  |   18|  1.42k|#define ASN1_TAG_OID		0x06
  ------------------
  |  Branch (118:3): [True: 1.42k, False: 7.10k]
  ------------------
  119|  1.42k|			if (asn1_get_oid(prev, end - prev, &oid, &prev) < 0) {
  ------------------
  |  Branch (119:8): [True: 41, False: 1.38k]
  ------------------
  120|     41|				wpa_printf(MSG_DEBUG, "ASN.1: Invalid OID");
  121|     41|				return -1;
  122|     41|			}
  123|  1.38k|			asn1_oid_to_str(&oid, str, sizeof(str));
  124|  1.38k|			wpa_printf(MSG_DEBUG, "ASN.1:%s OID %s", prefix, str);
  125|  1.38k|			pos += hdr.length;
  126|  1.38k|			break;
  127|    211|		case ANS1_TAG_RELATIVE_OID:
  ------------------
  |  |   25|    211|#define ANS1_TAG_RELATIVE_OID	0x0D
  ------------------
  |  Branch (127:3): [True: 211, False: 8.32k]
  ------------------
  128|    211|			wpa_hexdump(MSG_MSGDUMP, "ASN.1: Relative OID",
  129|    211|				    pos, hdr.length);
  130|    211|			pos += hdr.length;
  131|    211|			break;
  132|  1.24k|		case ASN1_TAG_SEQUENCE:
  ------------------
  |  |   27|  1.24k|#define ASN1_TAG_SEQUENCE	0x10 /* shall be constructed */
  ------------------
  |  Branch (132:3): [True: 1.24k, False: 7.28k]
  ------------------
  133|  1.24k|			wpa_printf(MSG_MSGDUMP, "ASN.1:%s SEQUENCE", prefix);
  134|  1.24k|			if (asn1_parse(pos, hdr.length, level + 1) < 0)
  ------------------
  |  Branch (134:8): [True: 142, False: 1.10k]
  ------------------
  135|    142|				return -1;
  136|  1.10k|			pos += hdr.length;
  137|  1.10k|			break;
  138|    389|		case ASN1_TAG_SET:
  ------------------
  |  |   28|    389|#define ASN1_TAG_SET		0x11
  ------------------
  |  Branch (138:3): [True: 389, False: 8.14k]
  ------------------
  139|    389|			wpa_printf(MSG_MSGDUMP, "ASN.1:%s SET", prefix);
  140|    389|			if (asn1_parse(pos, hdr.length, level + 1) < 0)
  ------------------
  |  Branch (140:8): [True: 85, False: 304]
  ------------------
  141|     85|				return -1;
  142|    304|			pos += hdr.length;
  143|    304|			break;
  144|    492|		case ASN1_TAG_PRINTABLESTRING:
  ------------------
  |  |   30|    492|#define ASN1_TAG_PRINTABLESTRING	0x13
  ------------------
  |  Branch (144:3): [True: 492, False: 8.04k]
  ------------------
  145|    492|			wpa_hexdump_ascii(MSG_MSGDUMP,
  146|    492|					  "ASN.1: PrintableString",
  147|    492|					  pos, hdr.length);
  148|    492|			pos += hdr.length;
  149|    492|			break;
  150|    266|		case ASN1_TAG_IA5STRING:
  ------------------
  |  |   33|    266|#define ASN1_TAG_IA5STRING	0x16
  ------------------
  |  Branch (150:3): [True: 266, False: 8.27k]
  ------------------
  151|    266|			wpa_hexdump_ascii(MSG_MSGDUMP, "ASN.1: IA5String",
  152|    266|					  pos, hdr.length);
  153|    266|			pos += hdr.length;
  154|    266|			break;
  155|    200|		case ASN1_TAG_UTCTIME:
  ------------------
  |  |   34|    200|#define ASN1_TAG_UTCTIME	0x17
  ------------------
  |  Branch (155:3): [True: 200, False: 8.33k]
  ------------------
  156|    200|			wpa_hexdump_ascii(MSG_MSGDUMP, "ASN.1: UTCTIME",
  157|    200|					  pos, hdr.length);
  158|    200|			pos += hdr.length;
  159|    200|			break;
  160|    248|		case ASN1_TAG_VISIBLESTRING:
  ------------------
  |  |   37|    248|#define ASN1_TAG_VISIBLESTRING	0x1A
  ------------------
  |  Branch (160:3): [True: 248, False: 8.28k]
  ------------------
  161|    248|			wpa_hexdump_ascii(MSG_MSGDUMP, "ASN.1: VisibleString",
  162|    248|					  pos, hdr.length);
  163|    248|			pos += hdr.length;
  164|    248|			break;
  165|    160|		default:
  ------------------
  |  Branch (165:3): [True: 160, False: 8.37k]
  ------------------
  166|    160|			wpa_printf(MSG_DEBUG, "ASN.1: Unknown tag %d",
  167|    160|				   hdr.tag);
  168|    160|			return -1;
  169|  8.53k|		}
  170|  8.53k|	}
  171|       |
  172|  2.52k|	return 0;
  173|  3.74k|}
asn1.c:asn1_class_str:
   17|   293k|{
   18|   293k|	switch (class) {
   19|  8.53k|	case ASN1_CLASS_UNIVERSAL:
  ------------------
  |  |   43|  8.53k|#define ASN1_CLASS_UNIVERSAL		0
  ------------------
  |  Branch (19:2): [True: 8.53k, False: 285k]
  ------------------
   20|  8.53k|		return "Universal";
   21|    726|	case ASN1_CLASS_APPLICATION:
  ------------------
  |  |   44|    726|#define ASN1_CLASS_APPLICATION		1
  ------------------
  |  Branch (21:2): [True: 726, False: 292k]
  ------------------
   22|    726|		return "Application";
   23|  1.57k|	case ASN1_CLASS_CONTEXT_SPECIFIC:
  ------------------
  |  |   45|  1.57k|#define ASN1_CLASS_CONTEXT_SPECIFIC	2
  ------------------
  |  Branch (23:2): [True: 1.57k, False: 292k]
  ------------------
   24|  1.57k|		return "Context-specific";
   25|   282k|	case ASN1_CLASS_PRIVATE:
  ------------------
  |  |   46|   282k|#define ASN1_CLASS_PRIVATE		3
  ------------------
  |  Branch (25:2): [True: 282k, False: 10.8k]
  ------------------
   26|   282k|		return "Private";
   27|      0|	default:
  ------------------
  |  Branch (27:2): [True: 0, False: 293k]
  ------------------
   28|      0|		return "?";
   29|   293k|	}
   30|   293k|}

wpa_fuzzer_set_debug_level:
   15|    927|{
   16|    927|	static int first = 1;
   17|       |
   18|    927|	if (first) {
  ------------------
  |  Branch (18:6): [True: 1, False: 926]
  ------------------
   19|      1|		char *env;
   20|       |
   21|      1|		first = 0;
   22|      1|		env = getenv("WPADEBUG");
   23|      1|		if (env)
  ------------------
  |  Branch (23:7): [True: 0, False: 1]
  ------------------
   24|      0|			wpa_debug_level = atoi(env);
   25|      1|		else
   26|      1|			wpa_debug_level = MSG_ERROR + 1;
   27|       |
   28|      1|		wpa_debug_show_keys = 1;
   29|      1|	}
   30|    927|}

