md5_vector:
   32|  2.09k|{
   33|  2.09k|	MD5_CTX ctx;
   34|  2.09k|	size_t i;
   35|       |
   36|  2.09k|	if (TEST_FAIL())
  ------------------
  |  |  688|  2.09k|#define TEST_FAIL() testing_test_fail(NULL, false)
  |  |  ------------------
  |  |  |  Branch (688:21): [True: 0, False: 2.09k]
  |  |  ------------------
  ------------------
   37|      0|		return -1;
   38|       |
   39|  2.09k|	MD5Init(&ctx);
   40|  6.32k|	for (i = 0; i < num_elem; i++)
  ------------------
  |  Branch (40:14): [True: 4.22k, False: 2.09k]
  ------------------
   41|  4.22k|		MD5Update(&ctx, addr[i], len[i]);
   42|  2.09k|	MD5Final(mac, &ctx);
   43|  2.09k|	return 0;
   44|  2.09k|}
MD5Init:
   88|  2.09k|{
   89|  2.09k|    ctx->buf[0] = 0x67452301;
   90|  2.09k|    ctx->buf[1] = 0xefcdab89;
   91|  2.09k|    ctx->buf[2] = 0x98badcfe;
   92|  2.09k|    ctx->buf[3] = 0x10325476;
   93|       |
   94|  2.09k|    ctx->bits[0] = 0;
   95|  2.09k|    ctx->bits[1] = 0;
   96|  2.09k|}
MD5Update:
  103|  4.22k|{
  104|  4.22k|    u32 t;
  105|       |
  106|       |    /* Update bitcount */
  107|       |
  108|  4.22k|    t = ctx->bits[0];
  109|  4.22k|    if ((ctx->bits[0] = t + ((u32) len << 3)) < t)
  ------------------
  |  Branch (109:9): [True: 0, False: 4.22k]
  ------------------
  110|      0|	ctx->bits[1]++;		/* Carry from low to high */
  111|  4.22k|    ctx->bits[1] += len >> 29;
  112|       |
  113|  4.22k|    t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */
  114|       |
  115|       |    /* Handle any leading odd-sized chunks */
  116|       |
  117|  4.22k|    if (t) {
  ------------------
  |  Branch (117:9): [True: 201, False: 4.02k]
  ------------------
  118|    201|	unsigned char *p = (unsigned char *) ctx->in + t;
  119|       |
  120|    201|	t = 64 - t;
  121|    201|	if (len < t) {
  ------------------
  |  Branch (121:6): [True: 201, False: 0]
  ------------------
  122|    201|	    os_memcpy(p, buf, len);
  ------------------
  |  |  523|    201|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  123|    201|	    return;
  124|    201|	}
  125|      0|	os_memcpy(p, buf, t);
  ------------------
  |  |  523|      0|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  126|      0|	byteReverse(ctx->in, 16);
  127|      0|	MD5Transform(ctx->buf, (u32 *) ctx->in);
  128|      0|	buf += t;
  129|      0|	len -= t;
  130|      0|    }
  131|       |    /* Process data in 64-byte chunks */
  132|       |
  133|  5.95k|    while (len >= 64) {
  ------------------
  |  Branch (133:12): [True: 1.93k, False: 4.02k]
  ------------------
  134|  1.93k|	os_memcpy(ctx->in, buf, 64);
  ------------------
  |  |  523|  1.93k|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  135|  1.93k|	byteReverse(ctx->in, 16);
  136|  1.93k|	MD5Transform(ctx->buf, (u32 *) ctx->in);
  137|  1.93k|	buf += 64;
  138|  1.93k|	len -= 64;
  139|  1.93k|    }
  140|       |
  141|       |    /* Handle any remaining bytes of data. */
  142|       |
  143|  4.02k|    os_memcpy(ctx->in, buf, len);
  ------------------
  |  |  523|  4.02k|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  144|  4.02k|}
MD5Final:
  151|  2.09k|{
  152|  2.09k|    unsigned count;
  153|  2.09k|    unsigned char *p;
  154|       |
  155|       |    /* Compute number of bytes mod 64 */
  156|  2.09k|    count = (ctx->bits[0] >> 3) & 0x3F;
  157|       |
  158|       |    /* Set the first char of padding to 0x80.  This is safe since there is
  159|       |       always at least one byte free */
  160|  2.09k|    p = ctx->in + count;
  161|  2.09k|    *p++ = 0x80;
  162|       |
  163|       |    /* Bytes of padding needed to make 64 bytes */
  164|  2.09k|    count = 64 - 1 - count;
  165|       |
  166|       |    /* Pad out to 56 mod 64 */
  167|  2.09k|    if (count < 8) {
  ------------------
  |  Branch (167:9): [True: 0, False: 2.09k]
  ------------------
  168|       |	/* Two lots of padding:  Pad the first block to 64 bytes */
  169|      0|	os_memset(p, 0, count);
  ------------------
  |  |  529|      0|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  170|      0|	byteReverse(ctx->in, 16);
  171|      0|	MD5Transform(ctx->buf, (u32 *) ctx->in);
  172|       |
  173|       |	/* Now fill the next block with 56 bytes */
  174|      0|	os_memset(ctx->in, 0, 56);
  ------------------
  |  |  529|      0|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  175|  2.09k|    } else {
  176|       |	/* Pad block to 56 bytes */
  177|  2.09k|	os_memset(p, 0, count - 8);
  ------------------
  |  |  529|  2.09k|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  178|  2.09k|    }
  179|  2.09k|    byteReverse(ctx->in, 14);
  180|       |
  181|       |    /* Append length in bits and transform */
  182|  2.09k|    ((u32 *) aliasing_hide_typecast(ctx->in, u32))[14] = ctx->bits[0];
  ------------------
  |  |  652|  2.09k|#define aliasing_hide_typecast(a,t) (t *) __hide_aliasing_typecast((a))
  ------------------
  183|  2.09k|    ((u32 *) aliasing_hide_typecast(ctx->in, u32))[15] = ctx->bits[1];
  ------------------
  |  |  652|  2.09k|#define aliasing_hide_typecast(a,t) (t *) __hide_aliasing_typecast((a))
  ------------------
  184|       |
  185|  2.09k|    MD5Transform(ctx->buf, (u32 *) ctx->in);
  186|  2.09k|    byteReverse((unsigned char *) ctx->buf, 4);
  187|  2.09k|    os_memcpy(digest, ctx->buf, 16);
  ------------------
  |  |  523|  2.09k|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  188|  2.09k|    os_memset(ctx, 0, sizeof(*ctx));	/* In case it's sensitive */
  ------------------
  |  |  529|  2.09k|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  189|  2.09k|}
md5-internal.c:MD5Transform:
  209|  4.02k|{
  210|  4.02k|    register u32 a, b, c, d;
  211|       |
  212|  4.02k|    a = buf[0];
  213|  4.02k|    b = buf[1];
  214|  4.02k|    c = buf[2];
  215|  4.02k|    d = buf[3];
  216|       |
  217|  4.02k|    MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  217|  4.02k|    MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|  4.02k|    MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  218|  4.02k|    MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|  4.02k|    MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  219|  4.02k|    MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|  4.02k|    MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  220|  4.02k|    MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  221|  4.02k|    MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  221|  4.02k|    MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  4.02k|    MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  222|  4.02k|    MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|  4.02k|    MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  223|  4.02k|    MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  4.02k|    MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  224|  4.02k|    MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  4.02k|    MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  225|  4.02k|    MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  4.02k|    MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  226|  4.02k|    MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  4.02k|    MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  227|  4.02k|    MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  4.02k|    MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  228|  4.02k|    MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|  4.02k|    MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  229|  4.02k|    MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  230|  4.02k|    MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  230|  4.02k|    MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|  4.02k|    MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  231|  4.02k|    MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|  4.02k|    MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  232|  4.02k|    MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
  |  |  |  |  ------------------
  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|       |
  234|  4.02k|    MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  234|  4.02k|    MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|  4.02k|    MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  235|  4.02k|    MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  4.02k|    MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  236|  4.02k|    MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  4.02k|    MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  237|  4.02k|    MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  4.02k|    MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  238|  4.02k|    MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  4.02k|    MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  239|  4.02k|    MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  4.02k|    MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  240|  4.02k|    MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  4.02k|    MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  241|  4.02k|    MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  4.02k|    MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  242|  4.02k|    MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|  4.02k|    MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  243|  4.02k|    MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|  4.02k|    MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  244|  4.02k|    MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  4.02k|    MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  245|  4.02k|    MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|  4.02k|    MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  246|  4.02k|    MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|  4.02k|    MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  247|  4.02k|    MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|  4.02k|    MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  248|  4.02k|    MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  4.02k|    MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  249|  4.02k|    MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
  |  |  |  |  ------------------
  |  |  |  |  |  |  195|  4.02k|#define F2(x, y, z) F1(z, x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  194|  4.02k|#define F1(x, y, z) (z ^ (x & (y ^ z)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  250|       |
  251|  4.02k|    MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  251|  4.02k|    MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  4.02k|    MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  252|  4.02k|    MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  4.02k|    MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  253|  4.02k|    MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  4.02k|    MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  254|  4.02k|    MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|  4.02k|    MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  255|  4.02k|    MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  4.02k|    MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  256|  4.02k|    MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|  4.02k|    MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  257|  4.02k|    MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  258|  4.02k|    MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  258|  4.02k|    MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  259|  4.02k|    MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  259|  4.02k|    MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|  4.02k|    MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  260|  4.02k|    MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|  4.02k|    MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  261|  4.02k|    MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|  4.02k|    MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  262|  4.02k|    MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|  4.02k|    MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  263|  4.02k|    MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|  4.02k|    MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  264|  4.02k|    MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|  4.02k|    MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  265|  4.02k|    MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|  4.02k|    MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  266|  4.02k|    MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
  |  |  |  |  ------------------
  |  |  |  |  |  |  196|  4.02k|#define F3(x, y, z) (x ^ y ^ z)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|       |
  268|  4.02k|    MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  268|  4.02k|    MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|  4.02k|    MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  269|  4.02k|    MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|  4.02k|    MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  270|  4.02k|    MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|  4.02k|    MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  271|  4.02k|    MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|  4.02k|    MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  272|  4.02k|    MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  4.02k|    MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  273|  4.02k|    MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|  4.02k|    MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  274|  4.02k|    MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  275|  4.02k|    MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  275|  4.02k|    MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|  4.02k|    MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  276|  4.02k|    MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|  4.02k|    MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  277|  4.02k|    MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  278|  4.02k|    MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  278|  4.02k|    MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|  4.02k|    MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  279|  4.02k|    MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  280|  4.02k|    MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  280|  4.02k|    MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|  4.02k|    MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  281|  4.02k|    MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|  4.02k|    MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  282|  4.02k|    MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  4.02k|    MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
  ------------------
  |  |  201|  4.02k|	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
  |  |  ------------------
  |  |  |  |  283|  4.02k|    MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
  |  |  |  |  ------------------
  |  |  |  |  |  |  197|  4.02k|#define F4(x, y, z) (y ^ (x | ~z))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|       |
  285|  4.02k|    buf[0] += a;
  286|  4.02k|    buf[1] += b;
  287|  4.02k|    buf[2] += c;
  288|  4.02k|    buf[3] += d;
  289|  4.02k|}

hmac_md5_vector:
   28|    965|{
   29|    965|	u8 k_pad[64]; /* padding - key XORd with ipad/opad */
   30|    965|	u8 tk[16];
   31|    965|	const u8 *_addr[6];
   32|    965|	size_t i, _len[6];
   33|    965|	int res;
   34|       |
   35|    965|	if (num_elem > 5) {
  ------------------
  |  Branch (35:6): [True: 0, False: 965]
  ------------------
   36|       |		/*
   37|       |		 * Fixed limit on the number of fragments to avoid having to
   38|       |		 * allocate memory (which could fail).
   39|       |		 */
   40|      0|		return -1;
   41|      0|	}
   42|       |
   43|       |        /* if key is longer than 64 bytes reset it to key = MD5(key) */
   44|    965|        if (key_len > 64) {
  ------------------
  |  Branch (44:13): [True: 0, False: 965]
  ------------------
   45|      0|		if (md5_vector(1, &key, &key_len, tk))
  ------------------
  |  Branch (45:7): [True: 0, False: 0]
  ------------------
   46|      0|			return -1;
   47|      0|		key = tk;
   48|      0|		key_len = 16;
   49|      0|        }
   50|       |
   51|       |	/* the HMAC_MD5 transform looks like:
   52|       |	 *
   53|       |	 * MD5(K XOR opad, MD5(K XOR ipad, text))
   54|       |	 *
   55|       |	 * where K is an n byte key
   56|       |	 * ipad is the byte 0x36 repeated 64 times
   57|       |	 * opad is the byte 0x5c repeated 64 times
   58|       |	 * and text is the data being protected */
   59|       |
   60|       |	/* start out by storing key in ipad */
   61|    965|	os_memset(k_pad, 0, sizeof(k_pad));
  ------------------
  |  |  529|    965|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   62|    965|	os_memcpy(k_pad, key, key_len);
  ------------------
  |  |  523|    965|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
   63|       |
   64|       |	/* XOR key with ipad values */
   65|  62.7k|	for (i = 0; i < 64; i++)
  ------------------
  |  Branch (65:14): [True: 61.7k, False: 965]
  ------------------
   66|  61.7k|		k_pad[i] ^= 0x36;
   67|       |
   68|       |	/* perform inner MD5 */
   69|    965|	_addr[0] = k_pad;
   70|    965|	_len[0] = 64;
   71|  1.93k|	for (i = 0; i < num_elem; i++) {
  ------------------
  |  Branch (71:14): [True: 965, False: 965]
  ------------------
   72|    965|		_addr[i + 1] = addr[i];
   73|    965|		_len[i + 1] = len[i];
   74|    965|	}
   75|    965|	if (md5_vector(1 + num_elem, _addr, _len, mac))
  ------------------
  |  Branch (75:6): [True: 0, False: 965]
  ------------------
   76|      0|		return -1;
   77|       |
   78|    965|	os_memset(k_pad, 0, sizeof(k_pad));
  ------------------
  |  |  529|    965|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   79|    965|	os_memcpy(k_pad, key, key_len);
  ------------------
  |  |  523|    965|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
   80|       |	/* XOR key with opad values */
   81|  62.7k|	for (i = 0; i < 64; i++)
  ------------------
  |  Branch (81:14): [True: 61.7k, False: 965]
  ------------------
   82|  61.7k|		k_pad[i] ^= 0x5c;
   83|       |
   84|       |	/* perform outer MD5 */
   85|    965|	_addr[0] = k_pad;
   86|    965|	_len[0] = 64;
   87|    965|	_addr[1] = mac;
   88|    965|	_len[1] = MD5_MAC_LEN;
  ------------------
  |  |   12|    965|#define MD5_MAC_LEN 16
  ------------------
   89|    965|	res = md5_vector(2, _addr, _len, mac);
   90|    965|	os_memset(k_pad, 0, sizeof(k_pad));
  ------------------
  |  |  529|    965|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   91|    965|	os_memset(tk, 0, sizeof(tk));
  ------------------
  |  |  529|    965|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   92|    965|	return res;
   93|    965|}
hmac_md5:
  107|    965|{
  108|    965|	return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac);
  109|    965|}

radius_msg_new:
  103|    965|{
  104|    965|	struct radius_msg *msg;
  105|       |
  106|    965|	msg = os_zalloc(sizeof(*msg));
  107|    965|	if (msg == NULL)
  ------------------
  |  Branch (107:6): [True: 0, False: 965]
  ------------------
  108|      0|		return NULL;
  109|       |
  110|    965|	msg->buf = wpabuf_alloc(RADIUS_DEFAULT_MSG_SIZE);
  ------------------
  |  |  250|    965|#define RADIUS_DEFAULT_MSG_SIZE 1024
  ------------------
  111|    965|	if (msg->buf == NULL || radius_msg_initialize(msg)) {
  ------------------
  |  Branch (111:6): [True: 0, False: 965]
  |  Branch (111:26): [True: 0, False: 965]
  ------------------
  112|      0|		radius_msg_free(msg);
  113|      0|		return NULL;
  114|      0|	}
  115|    965|	msg->hdr = wpabuf_put(msg->buf, sizeof(struct radius_hdr));
  116|       |
  117|    965|	radius_msg_set_hdr(msg, code, identifier);
  118|       |
  119|    965|	return msg;
  120|    965|}
radius_msg_free:
  128|  1.89k|{
  129|  1.89k|	if (msg == NULL)
  ------------------
  |  Branch (129:6): [True: 0, False: 1.89k]
  ------------------
  130|      0|		return;
  131|       |
  132|  1.89k|	wpabuf_free(msg->buf);
  133|  1.89k|	os_free(msg->attr_pos);
  ------------------
  |  |  511|  1.89k|#define os_free(p) free((p))
  ------------------
  134|  1.89k|	os_free(msg);
  ------------------
  |  |  511|  1.89k|#define os_free(p) free((p))
  ------------------
  135|  1.89k|}
radius_msg_dump:
  412|    879|{
  413|    879|	size_t i;
  414|       |
  415|    879|	wpa_printf(MSG_INFO, "RADIUS message: code=%d (%s) identifier=%d length=%d",
  416|    879|		   msg->hdr->code, radius_code_string(msg->hdr->code),
  417|    879|		   msg->hdr->identifier, be_to_host16(msg->hdr->length));
  ------------------
  |  |  177|    879|#define be_to_host16(n) bswap_16((__force u16) (be16) (n))
  ------------------
  418|       |
  419|   169k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (419:14): [True: 168k, False: 879]
  ------------------
  420|   168k|		struct radius_attr_hdr *attr = radius_get_attr_hdr(msg, i);
  421|   168k|		radius_msg_dump_attr(attr);
  422|   168k|	}
  423|    879|}
radius_msg_add_msg_auth:
  427|    965|{
  428|    965|	u8 auth[MD5_MAC_LEN];
  429|    965|	struct radius_attr_hdr *attr;
  430|       |
  431|    965|	os_memset(auth, 0, MD5_MAC_LEN);
  ------------------
  |  |  529|    965|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  432|    965|	attr = radius_msg_add_attr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
  433|    965|				   auth, MD5_MAC_LEN);
  ------------------
  |  |   12|    965|#define MD5_MAC_LEN 16
  ------------------
  434|    965|	if (!attr) {
  ------------------
  |  Branch (434:6): [True: 0, False: 965]
  ------------------
  435|      0|		wpa_printf(MSG_ERROR,
  436|      0|			   "WARNING: Could not add Message-Authenticator");
  437|      0|		return NULL;
  438|      0|	}
  439|       |
  440|    965|	return (u8 *) (attr + 1);
  441|    965|}
radius_msg_finish:
  463|    965|{
  464|    965|	if (secret) {
  ------------------
  |  Branch (464:6): [True: 965, False: 0]
  ------------------
  465|    965|		u8 *pos;
  466|       |
  467|    965|		pos = radius_msg_auth_pos(msg);
  468|    965|		if (!pos)
  ------------------
  |  Branch (468:7): [True: 0, False: 965]
  ------------------
  469|      0|			return -1;
  470|    965|		msg->hdr->length = host_to_be16(wpabuf_len(msg->buf));
  ------------------
  |  |  178|    965|#define host_to_be16(n) ((__force be16) bswap_16((n)))
  ------------------
  471|    965|		if (hmac_md5(secret, secret_len, wpabuf_head(msg->buf),
  ------------------
  |  Branch (471:7): [True: 0, False: 965]
  ------------------
  472|    965|			     wpabuf_len(msg->buf), pos) < 0) {
  473|      0|			wpa_printf(MSG_INFO, "RADIUS: MD5 not available");
  474|      0|			return -1;
  475|      0|		}
  476|    965|	} else
  477|      0|		msg->hdr->length = host_to_be16(wpabuf_len(msg->buf));
  ------------------
  |  |  178|      0|#define host_to_be16(n) ((__force be16) bswap_16((n)))
  ------------------
  478|       |
  479|    965|	if (wpabuf_len(msg->buf) > 0xffff) {
  ------------------
  |  Branch (479:6): [True: 0, False: 965]
  ------------------
  480|      0|		wpa_printf(MSG_WARNING, "RADIUS: Too long message (%lu)",
  481|      0|			   (unsigned long) wpabuf_len(msg->buf));
  482|      0|		return -1;
  483|      0|	}
  484|    965|	return 0;
  485|    965|}
radius_msg_add_attr:
  747|    965|{
  748|    965|	size_t buf_needed, max_len;
  749|    965|	struct radius_attr_hdr *attr = NULL;
  750|    965|	struct radius_attr_hdr_ext *ext;
  751|    965|	u8 ext_type = 0;
  752|       |
  753|    965|	if (TEST_FAIL())
  ------------------
  |  |  688|    965|#define TEST_FAIL() testing_test_fail(NULL, false)
  |  |  ------------------
  |  |  |  Branch (688:21): [True: 0, False: 965]
  |  |  ------------------
  ------------------
  754|      0|		return NULL;
  755|       |
  756|    965|	if (type > 255) {
  ------------------
  |  Branch (756:6): [True: 0, False: 965]
  ------------------
  757|      0|		if (!radius_is_ext_type(type >> 8)) {
  ------------------
  |  Branch (757:7): [True: 0, False: 0]
  ------------------
  758|      0|			wpa_printf(MSG_ERROR,
  759|      0|				   "%s: Undefined extended type %d.%d",
  760|      0|				   __func__, type >> 8, type & 0xff);
  761|      0|			return NULL;
  762|      0|		}
  763|      0|		ext_type = type & 0xff;
  764|      0|		type >>= 8;
  765|    965|	} else if (radius_is_ext_type(type)) {
  ------------------
  |  Branch (765:13): [True: 0, False: 965]
  ------------------
  766|      0|		wpa_printf(MSG_ERROR, "%s: Unexpected extended type use for %d",
  767|      0|			   __func__, type);
  768|      0|	}
  769|       |
  770|    965|	if (radius_is_long_ext_type(type)) {
  ------------------
  |  Branch (770:6): [True: 0, False: 965]
  ------------------
  771|      0|		size_t hdr_len = sizeof(struct radius_attr_hdr_ext) + 1;
  772|      0|		size_t plen = 255 - hdr_len;
  773|      0|		size_t num;
  774|       |
  775|      0|		max_len = 4096;
  776|      0|		num = (data_len + plen - 1) / plen;
  777|      0|		if (num == 0)
  ------------------
  |  Branch (777:7): [True: 0, False: 0]
  ------------------
  778|      0|			num = 1;
  779|      0|		buf_needed = num * hdr_len + data_len;
  780|    965|	} else if (radius_is_ext_type(type)) {
  ------------------
  |  Branch (780:13): [True: 0, False: 965]
  ------------------
  781|      0|		max_len = RADIUS_MAX_EXT_ATTR_LEN;
  ------------------
  |  |   57|      0|#define RADIUS_MAX_EXT_ATTR_LEN (255 - sizeof(struct radius_attr_hdr_ext))
  ------------------
  782|      0|		buf_needed = sizeof(struct radius_attr_hdr_ext) + data_len;
  783|    965|	} else {
  784|    965|		max_len = RADIUS_MAX_ATTR_LEN;
  ------------------
  |  |   56|    965|#define RADIUS_MAX_ATTR_LEN (255 - sizeof(struct radius_attr_hdr))
  ------------------
  785|    965|		buf_needed = sizeof(*attr) + data_len;
  786|    965|	}
  787|    965|	if (data_len > max_len) {
  ------------------
  |  Branch (787:6): [True: 0, False: 965]
  ------------------
  788|      0|		wpa_printf(MSG_ERROR,
  789|      0|			   "%s: too long attribute (%zu > %zu bytes)",
  790|      0|			   __func__, data_len, max_len);
  791|      0|		return NULL;
  792|      0|	}
  793|       |
  794|    965|	if (wpabuf_tailroom(msg->buf) < buf_needed) {
  ------------------
  |  Branch (794:6): [True: 0, False: 965]
  ------------------
  795|       |		/* allocate more space for message buffer */
  796|      0|		if (wpabuf_resize(&msg->buf, buf_needed) < 0)
  ------------------
  |  Branch (796:7): [True: 0, False: 0]
  ------------------
  797|      0|			return NULL;
  798|      0|		msg->hdr = wpabuf_mhead(msg->buf);
  799|      0|	}
  800|       |
  801|    965|	if (radius_is_long_ext_type(type)) {
  ------------------
  |  Branch (801:6): [True: 0, False: 965]
  ------------------
  802|      0|		size_t plen = 255 - sizeof(struct radius_attr_hdr_ext) - 1;
  803|      0|		size_t alen;
  804|       |
  805|      0|		do {
  806|      0|			alen = data_len > plen ? plen : data_len;
  ------------------
  |  Branch (806:11): [True: 0, False: 0]
  ------------------
  807|      0|			ext = wpabuf_put(msg->buf,
  808|      0|					 sizeof(struct radius_attr_hdr_ext));
  809|      0|			if (!attr)
  ------------------
  |  Branch (809:8): [True: 0, False: 0]
  ------------------
  810|      0|				attr = (struct radius_attr_hdr *) ext;
  811|      0|			ext->type = type;
  812|      0|			ext->length = sizeof(*ext) + 1 + alen;
  813|      0|			ext->ext_type = ext_type;
  814|      0|			wpabuf_put_u8(msg->buf, data_len > alen ? 0x80 : 0);
  ------------------
  |  Branch (814:28): [True: 0, False: 0]
  ------------------
  815|      0|			wpabuf_put_data(msg->buf, data, alen);
  816|      0|			data += alen;
  817|      0|			data_len -= alen;
  818|      0|			if (radius_msg_add_attr_to_array(
  ------------------
  |  Branch (818:8): [True: 0, False: 0]
  ------------------
  819|      0|				    msg, (struct radius_attr_hdr *) ext))
  820|      0|				return NULL;
  821|      0|		} while (data_len > 0);
  ------------------
  |  Branch (821:12): [True: 0, False: 0]
  ------------------
  822|    965|	} else if (radius_is_ext_type(type)) {
  ------------------
  |  Branch (822:13): [True: 0, False: 965]
  ------------------
  823|      0|		ext = wpabuf_put(msg->buf, sizeof(struct radius_attr_hdr_ext));
  824|      0|		attr = (struct radius_attr_hdr *) ext;
  825|      0|		ext->type = type;
  826|      0|		ext->length = sizeof(*ext) + data_len;
  827|      0|		ext->ext_type = ext_type;
  828|      0|		wpabuf_put_data(msg->buf, data, data_len);
  829|      0|		if (radius_msg_add_attr_to_array(msg, attr))
  ------------------
  |  Branch (829:7): [True: 0, False: 0]
  ------------------
  830|      0|			return NULL;
  831|    965|	} else {
  832|    965|		attr = wpabuf_put(msg->buf, sizeof(struct radius_attr_hdr));
  833|    965|		attr->type = type;
  834|    965|		attr->length = sizeof(*attr) + data_len;
  835|    965|		wpabuf_put_data(msg->buf, data, data_len);
  836|    965|		if (radius_msg_add_attr_to_array(msg, attr))
  ------------------
  |  Branch (836:7): [True: 0, False: 965]
  ------------------
  837|      0|			return NULL;
  838|    965|	}
  839|       |
  840|    965|	return attr;
  841|    965|}
radius_msg_parse:
  854|    965|{
  855|    965|	struct radius_msg *msg;
  856|    965|	struct radius_hdr *hdr;
  857|    965|	struct radius_attr_hdr *attr;
  858|    965|	size_t msg_len;
  859|    965|	unsigned char *pos, *end;
  860|       |
  861|    965|	if (data == NULL || len < sizeof(*hdr))
  ------------------
  |  Branch (861:6): [True: 0, False: 965]
  |  Branch (861:22): [True: 9, False: 956]
  ------------------
  862|      9|		return NULL;
  863|       |
  864|    956|	hdr = (struct radius_hdr *) data;
  865|       |
  866|    956|	msg_len = be_to_host16(hdr->length);
  ------------------
  |  |  177|    956|#define be_to_host16(n) bswap_16((__force u16) (be16) (n))
  ------------------
  867|    956|	if (msg_len < sizeof(*hdr) || msg_len > len) {
  ------------------
  |  Branch (867:6): [True: 5, False: 951]
  |  Branch (867:32): [True: 17, False: 934]
  ------------------
  868|     22|		wpa_printf(MSG_INFO, "RADIUS: Invalid message length");
  869|     22|		return NULL;
  870|     22|	}
  871|       |
  872|    934|	if (msg_len < len) {
  ------------------
  |  Branch (872:6): [True: 61, False: 873]
  ------------------
  873|     61|		wpa_printf(MSG_DEBUG, "RADIUS: Ignored %lu extra bytes after "
  874|     61|			   "RADIUS message", (unsigned long) len - msg_len);
  875|     61|	}
  876|       |
  877|    934|	msg = os_zalloc(sizeof(*msg));
  878|    934|	if (msg == NULL)
  ------------------
  |  Branch (878:6): [True: 0, False: 934]
  ------------------
  879|      0|		return NULL;
  880|       |
  881|    934|	msg->buf = wpabuf_alloc_copy(data, msg_len);
  882|    934|	if (msg->buf == NULL || radius_msg_initialize(msg)) {
  ------------------
  |  Branch (882:6): [True: 0, False: 934]
  |  Branch (882:26): [True: 0, False: 934]
  ------------------
  883|      0|		radius_msg_free(msg);
  884|      0|		return NULL;
  885|      0|	}
  886|    934|	msg->hdr = wpabuf_mhead(msg->buf);
  887|       |
  888|       |	/* parse attributes */
  889|    934|	pos = wpabuf_mhead_u8(msg->buf) + sizeof(struct radius_hdr);
  890|    934|	end = wpabuf_mhead_u8(msg->buf) + wpabuf_len(msg->buf);
  891|   197k|	while (pos < end) {
  ------------------
  |  Branch (891:9): [True: 196k, False: 879]
  ------------------
  892|   196k|		if ((size_t) (end - pos) < sizeof(*attr))
  ------------------
  |  Branch (892:7): [True: 11, False: 196k]
  ------------------
  893|     11|			goto fail;
  894|       |
  895|   196k|		attr = (struct radius_attr_hdr *) pos;
  896|       |
  897|   196k|		if (attr->length > end - pos || attr->length < sizeof(*attr))
  ------------------
  |  Branch (897:7): [True: 16, False: 196k]
  |  Branch (897:35): [True: 28, False: 196k]
  ------------------
  898|     44|			goto fail;
  899|       |
  900|       |		/* TODO: check that attr->length is suitable for attr->type */
  901|       |
  902|   196k|		if (radius_msg_add_attr_to_array(msg, attr))
  ------------------
  |  Branch (902:7): [True: 0, False: 196k]
  ------------------
  903|      0|			goto fail;
  904|       |
  905|   196k|		pos += attr->length;
  906|   196k|	}
  907|       |
  908|    879|	return msg;
  909|       |
  910|     55| fail:
  911|     55|	radius_msg_free(msg);
  912|       |	return NULL;
  913|    934|}
radius_msg_get_eap:
  941|    879|{
  942|    879|	struct wpabuf *eap;
  943|    879|	size_t len, i;
  944|    879|	struct radius_attr_hdr *attr;
  945|       |
  946|    879|	if (msg == NULL)
  ------------------
  |  Branch (946:6): [True: 0, False: 879]
  ------------------
  947|      0|		return NULL;
  948|       |
  949|    879|	len = 0;
  950|   169k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (950:14): [True: 168k, False: 879]
  ------------------
  951|   168k|		attr = radius_get_attr_hdr(msg, i);
  952|   168k|		if (attr->type == RADIUS_ATTR_EAP_MESSAGE &&
  ------------------
  |  Branch (952:7): [True: 5.16k, False: 163k]
  ------------------
  953|  5.16k|		    attr->length > sizeof(struct radius_attr_hdr))
  ------------------
  |  Branch (953:7): [True: 3.94k, False: 1.22k]
  ------------------
  954|  3.94k|			len += attr->length - sizeof(struct radius_attr_hdr);
  955|   168k|	}
  956|       |
  957|    879|	if (len == 0)
  ------------------
  |  Branch (957:6): [True: 765, False: 114]
  ------------------
  958|    765|		return NULL;
  959|       |
  960|    114|	eap = wpabuf_alloc(len);
  961|    114|	if (eap == NULL)
  ------------------
  |  Branch (961:6): [True: 0, False: 114]
  ------------------
  962|      0|		return NULL;
  963|       |
  964|   136k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (964:14): [True: 136k, False: 114]
  ------------------
  965|   136k|		attr = radius_get_attr_hdr(msg, i);
  966|   136k|		if (attr->type == RADIUS_ATTR_EAP_MESSAGE &&
  ------------------
  |  Branch (966:7): [True: 5.09k, False: 131k]
  ------------------
  967|  5.09k|		    attr->length > sizeof(struct radius_attr_hdr)) {
  ------------------
  |  Branch (967:7): [True: 3.94k, False: 1.15k]
  ------------------
  968|  3.94k|			int flen = attr->length - sizeof(*attr);
  969|  3.94k|			wpabuf_put_data(eap, attr + 1, flen);
  970|  3.94k|		}
  971|   136k|	}
  972|       |
  973|    114|	return eap;
  974|    114|}
radius_msg_get_attr:
 1595|    879|{
 1596|    879|	struct radius_attr_hdr *attr = NULL, *tmp;
 1597|    879|	size_t i, dlen;
 1598|       |
 1599|  95.6k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1599:14): [True: 94.8k, False: 800]
  ------------------
 1600|  94.8k|		tmp = radius_get_attr_hdr(msg, i);
 1601|  94.8k|		if (tmp->type == type) {
  ------------------
  |  Branch (1601:7): [True: 79, False: 94.8k]
  ------------------
 1602|     79|			attr = tmp;
 1603|     79|			break;
 1604|     79|		}
 1605|  94.8k|	}
 1606|       |
 1607|    879|	if (!attr || attr->length < sizeof(*attr))
  ------------------
  |  Branch (1607:6): [True: 800, False: 79]
  |  Branch (1607:15): [True: 0, False: 79]
  ------------------
 1608|    800|		return -1;
 1609|       |
 1610|     79|	dlen = attr->length - sizeof(*attr);
 1611|     79|	if (buf)
  ------------------
  |  Branch (1611:6): [True: 79, False: 0]
  ------------------
 1612|     79|		os_memcpy(buf, (attr + 1), dlen > len ? len : dlen);
  ------------------
  |  |  523|    158|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  |  |  ------------------
  |  |  |  Branch (523:46): [True: 28, False: 51]
  |  |  ------------------
  ------------------
 1613|     79|	return dlen;
 1614|    879|}
radius_msg_get_attr_ptr:
 1619|    965|{
 1620|    965|	size_t i;
 1621|    965|	struct radius_attr_hdr *attr = NULL, *tmp;
 1622|       |
 1623|    965|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1623:14): [True: 0, False: 965]
  ------------------
 1624|      0|		tmp = radius_get_attr_hdr(msg, i);
 1625|      0|		if (tmp->type == type &&
  ------------------
  |  Branch (1625:7): [True: 0, False: 0]
  ------------------
 1626|      0|		    (start == NULL || (u8 *) tmp > start)) {
  ------------------
  |  Branch (1626:8): [True: 0, False: 0]
  |  Branch (1626:25): [True: 0, False: 0]
  ------------------
 1627|      0|			attr = tmp;
 1628|      0|			break;
 1629|      0|		}
 1630|      0|	}
 1631|       |
 1632|    965|	if (!attr || attr->length < sizeof(*attr))
  ------------------
  |  Branch (1632:6): [True: 965, False: 0]
  |  Branch (1632:15): [True: 0, False: 0]
  ------------------
 1633|    965|		return -1;
 1634|       |
 1635|      0|	*buf = (u8 *) (attr + 1);
 1636|      0|	*len = attr->length - sizeof(*attr);
 1637|      0|	return 0;
 1638|    965|}
radius_msg_get_vlanid:
 1689|    879|{
 1690|    879|	struct radius_tunnel_attrs tunnel[RADIUS_TUNNEL_TAGS], *tun;
 1691|    879|	size_t i;
 1692|    879|	struct radius_attr_hdr *attr = NULL;
 1693|    879|	const u8 *data;
 1694|    879|	char buf[10];
 1695|    879|	size_t dlen;
 1696|    879|	int j, taggedidx = 0, vlan_id;
 1697|       |
 1698|    879|	os_memset(&tunnel, 0, sizeof(tunnel));
  ------------------
  |  |  529|    879|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
 1699|  5.27k|	for (j = 0; j < numtagged; j++)
  ------------------
  |  Branch (1699:14): [True: 4.39k, False: 879]
  ------------------
 1700|  4.39k|		tagged[j] = 0;
 1701|    879|	*untagged = 0;
 1702|       |
 1703|   169k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1703:14): [True: 168k, False: 879]
  ------------------
 1704|   168k|		attr = radius_get_attr_hdr(msg, i);
 1705|   168k|		if (attr->length < sizeof(*attr))
  ------------------
  |  Branch (1705:7): [True: 0, False: 168k]
  ------------------
 1706|      0|			return -1;
 1707|   168k|		data = (const u8 *) (attr + 1);
 1708|   168k|		dlen = attr->length - sizeof(*attr);
 1709|   168k|		if (attr->length < 3)
  ------------------
  |  Branch (1709:7): [True: 113k, False: 55.9k]
  ------------------
 1710|   113k|			continue;
 1711|  55.9k|		if (data[0] >= RADIUS_TUNNEL_TAGS)
  ------------------
  |  |  182|  55.9k|#define RADIUS_TUNNEL_TAGS 32
  ------------------
  |  Branch (1711:7): [True: 39.0k, False: 16.8k]
  ------------------
 1712|  39.0k|			tun = &tunnel[0];
 1713|  16.8k|		else
 1714|  16.8k|			tun = &tunnel[data[0]];
 1715|       |
 1716|  55.9k|		switch (attr->type) {
  ------------------
  |  Branch (1716:11): [True: 33.6k, False: 22.2k]
  ------------------
 1717|  1.61k|		case RADIUS_ATTR_TUNNEL_TYPE:
  ------------------
  |  Branch (1717:3): [True: 1.61k, False: 54.3k]
  ------------------
 1718|  1.61k|			if (attr->length != 6)
  ------------------
  |  Branch (1718:8): [True: 458, False: 1.15k]
  ------------------
 1719|    458|				break;
 1720|  1.15k|			tun->tag_used++;
 1721|  1.15k|			tun->type = WPA_GET_BE24(data + 1);
 1722|  1.15k|			break;
 1723|  1.04k|		case RADIUS_ATTR_TUNNEL_MEDIUM_TYPE:
  ------------------
  |  Branch (1723:3): [True: 1.04k, False: 54.9k]
  ------------------
 1724|  1.04k|			if (attr->length != 6)
  ------------------
  |  Branch (1724:8): [True: 430, False: 618]
  ------------------
 1725|    430|				break;
 1726|    618|			tun->tag_used++;
 1727|    618|			tun->medium_type = WPA_GET_BE24(data + 1);
 1728|    618|			break;
 1729|  27.6k|		case RADIUS_ATTR_TUNNEL_PRIVATE_GROUP_ID:
  ------------------
  |  Branch (1729:3): [True: 27.6k, False: 28.3k]
  ------------------
 1730|  27.6k|			if (data[0] < RADIUS_TUNNEL_TAGS) {
  ------------------
  |  |  182|  27.6k|#define RADIUS_TUNNEL_TAGS 32
  ------------------
  |  Branch (1730:8): [True: 1.40k, False: 26.2k]
  ------------------
 1731|  1.40k|				data++;
 1732|  1.40k|				dlen--;
 1733|  1.40k|			}
 1734|  27.6k|			if (dlen >= sizeof(buf))
  ------------------
  |  Branch (1734:8): [True: 676, False: 26.9k]
  ------------------
 1735|    676|				break;
 1736|  26.9k|			os_memcpy(buf, data, dlen);
  ------------------
  |  |  523|  26.9k|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
 1737|  26.9k|			buf[dlen] = '\0';
 1738|  26.9k|			vlan_id = atoi(buf);
 1739|  26.9k|			if (vlan_id <= 0)
  ------------------
  |  Branch (1739:8): [True: 2.68k, False: 24.2k]
  ------------------
 1740|  2.68k|				break;
 1741|  24.2k|			tun->tag_used++;
 1742|  24.2k|			tun->vlanid = vlan_id;
 1743|  24.2k|			break;
 1744|  3.36k|		case RADIUS_ATTR_EGRESS_VLANID: /* RFC 4675 */
  ------------------
  |  Branch (1744:3): [True: 3.36k, False: 52.5k]
  ------------------
 1745|  3.36k|			if (attr->length != 6)
  ------------------
  |  Branch (1745:8): [True: 543, False: 2.82k]
  ------------------
 1746|    543|				break;
 1747|  2.82k|			vlan_id = WPA_GET_BE24(data + 1);
 1748|  2.82k|			if (vlan_id <= 0)
  ------------------
  |  Branch (1748:8): [True: 374, False: 2.44k]
  ------------------
 1749|    374|				break;
 1750|  2.44k|			if (data[0] == 0x32)
  ------------------
  |  Branch (1750:8): [True: 663, False: 1.78k]
  ------------------
 1751|    663|				*untagged = vlan_id;
 1752|  1.78k|			else if (data[0] == 0x31 && tagged &&
  ------------------
  |  Branch (1752:13): [True: 913, False: 873]
  |  Branch (1752:32): [True: 913, False: 0]
  ------------------
 1753|    913|				 taggedidx < numtagged)
  ------------------
  |  Branch (1753:6): [True: 124, False: 789]
  ------------------
 1754|    124|				tagged[taggedidx++] = vlan_id;
 1755|  2.44k|			break;
 1756|  55.9k|		}
 1757|  55.9k|	}
 1758|       |
 1759|       |	/* Use tunnel with the lowest tag for untagged VLAN id */
 1760|  27.9k|	for (i = 0; i < RADIUS_TUNNEL_TAGS; i++) {
  ------------------
  |  |  182|  27.9k|#define RADIUS_TUNNEL_TAGS 32
  ------------------
  |  Branch (1760:14): [True: 27.1k, False: 846]
  ------------------
 1761|  27.1k|		tun = &tunnel[i];
 1762|  27.1k|		if (tun->tag_used &&
  ------------------
  |  Branch (1762:7): [True: 308, False: 26.8k]
  ------------------
 1763|    308|		    tun->type == RADIUS_TUNNEL_TYPE_VLAN &&
  ------------------
  |  |  189|  27.4k|#define RADIUS_TUNNEL_TYPE_VLAN 13
  ------------------
  |  Branch (1763:7): [True: 91, False: 217]
  ------------------
 1764|     91|		    tun->medium_type == RADIUS_TUNNEL_MEDIUM_TYPE_802 &&
  ------------------
  |  |  194|  27.2k|#define RADIUS_TUNNEL_MEDIUM_TYPE_802 6
  ------------------
  |  Branch (1764:7): [True: 43, False: 48]
  ------------------
 1765|     43|		    tun->vlanid > 0) {
  ------------------
  |  Branch (1765:7): [True: 33, False: 10]
  ------------------
 1766|     33|			*untagged = tun->vlanid;
 1767|     33|			break;
 1768|     33|		}
 1769|  27.1k|	}
 1770|       |
 1771|    879|	if (taggedidx)
  ------------------
  |  Branch (1771:6): [True: 32, False: 847]
  ------------------
 1772|     32|		qsort(tagged, taggedidx, sizeof(int), cmp_int);
 1773|       |
 1774|    879|	if (*untagged > 0 || taggedidx)
  ------------------
  |  Branch (1774:6): [True: 82, False: 797]
  |  Branch (1774:23): [True: 17, False: 780]
  ------------------
 1775|     99|		return 1;
 1776|    780|	return 0;
 1777|    879|}
radius_msg_get_tunnel_password:
 1793|    879|{
 1794|    879|	u8 *buf = NULL;
 1795|    879|	size_t buflen;
 1796|    879|	const u8 *salt;
 1797|    879|	u8 *str;
 1798|    879|	const u8 *addr[3];
 1799|    879|	size_t len[3];
 1800|    879|	u8 hash[16];
 1801|    879|	u8 *pos;
 1802|    879|	size_t i, j = 0;
 1803|    879|	struct radius_attr_hdr *attr;
 1804|    879|	const u8 *data;
 1805|    879|	size_t dlen;
 1806|    879|	const u8 *fdata = NULL; /* points to found item */
 1807|    879|	size_t fdlen = -1;
 1808|    879|	char *ret = NULL;
 1809|       |
 1810|       |	/* find n-th valid Tunnel-Password attribute */
 1811|   149k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1811:14): [True: 148k, False: 845]
  ------------------
 1812|   148k|		attr = radius_get_attr_hdr(msg, i);
 1813|   148k|		if (attr == NULL ||
  ------------------
  |  Branch (1813:7): [True: 0, False: 148k]
  ------------------
 1814|   148k|		    attr->type != RADIUS_ATTR_TUNNEL_PASSWORD) {
  ------------------
  |  Branch (1814:7): [True: 147k, False: 1.34k]
  ------------------
 1815|   147k|			continue;
 1816|   147k|		}
 1817|  1.34k|		if (attr->length <= 5)
  ------------------
  |  Branch (1817:7): [True: 756, False: 591]
  ------------------
 1818|    756|			continue;
 1819|    591|		data = (const u8 *) (attr + 1);
 1820|    591|		dlen = attr->length - sizeof(*attr);
 1821|    591|		if (dlen <= 3 || dlen % 16 != 3)
  ------------------
  |  Branch (1821:7): [True: 0, False: 591]
  |  Branch (1821:20): [True: 521, False: 70]
  ------------------
 1822|    521|			continue;
 1823|     70|		j++;
 1824|     70|		if (j <= n)
  ------------------
  |  Branch (1824:7): [True: 36, False: 34]
  ------------------
 1825|     36|			continue;
 1826|       |
 1827|     34|		fdata = data;
 1828|     34|		fdlen = dlen;
 1829|     34|		break;
 1830|     70|	}
 1831|    879|	if (fdata == NULL)
  ------------------
  |  Branch (1831:6): [True: 845, False: 34]
  ------------------
 1832|    845|		goto out;
 1833|       |
 1834|       |	/* alloc writable memory for decryption */
 1835|     34|	buf = os_memdup(fdata, fdlen);
 1836|     34|	if (buf == NULL)
  ------------------
  |  Branch (1836:6): [True: 0, False: 34]
  ------------------
 1837|      0|		goto out;
 1838|     34|	buflen = fdlen;
 1839|       |
 1840|       |	/* init pointers */
 1841|     34|	salt = buf + 1;
 1842|     34|	str = buf + 3;
 1843|       |
 1844|       |	/* decrypt blocks */
 1845|     34|	pos = buf + buflen - 16; /* last block */
 1846|    167|	while (pos >= str + 16) { /* all but the first block */
  ------------------
  |  Branch (1846:9): [True: 133, False: 34]
  ------------------
 1847|    133|		addr[0] = secret;
 1848|    133|		len[0] = secret_len;
 1849|    133|		addr[1] = pos - 16;
 1850|    133|		len[1] = 16;
 1851|    133|		if (md5_vector(2, addr, len, hash) < 0) {
  ------------------
  |  Branch (1851:7): [True: 0, False: 133]
  ------------------
 1852|      0|			wpa_printf(MSG_INFO, "RADIUS: MD5 not available");
 1853|      0|			goto out;
 1854|      0|		}
 1855|       |
 1856|  2.26k|		for (i = 0; i < 16; i++)
  ------------------
  |  Branch (1856:15): [True: 2.12k, False: 133]
  ------------------
 1857|  2.12k|			pos[i] ^= hash[i];
 1858|       |
 1859|    133|		pos -= 16;
 1860|    133|	}
 1861|       |
 1862|       |	/* decrypt first block */
 1863|     34|	if (str != pos)
  ------------------
  |  Branch (1863:6): [True: 0, False: 34]
  ------------------
 1864|      0|		goto out;
 1865|     34|	addr[0] = secret;
 1866|     34|	len[0] = secret_len;
 1867|     34|	addr[1] = sent_msg->hdr->authenticator;
 1868|     34|	len[1] = 16;
 1869|     34|	addr[2] = salt;
 1870|     34|	len[2] = 2;
 1871|     34|	if (md5_vector(3, addr, len, hash) < 0) {
  ------------------
  |  Branch (1871:6): [True: 0, False: 34]
  ------------------
 1872|      0|		wpa_printf(MSG_INFO, "RADIUS: MD5 not available");
 1873|      0|		goto out;
 1874|      0|	}
 1875|       |
 1876|    578|	for (i = 0; i < 16; i++)
  ------------------
  |  Branch (1876:14): [True: 544, False: 34]
  ------------------
 1877|    544|		pos[i] ^= hash[i];
 1878|       |
 1879|       |	/* derive plaintext length from first subfield */
 1880|     34|	*keylen = (unsigned char) str[0];
 1881|     34|	if ((u8 *) (str + *keylen) >= (u8 *) (buf + buflen)) {
  ------------------
  |  Branch (1881:6): [True: 20, False: 14]
  ------------------
 1882|       |		/* decryption error - invalid key length */
 1883|     20|		goto out;
 1884|     20|	}
 1885|     14|	if (*keylen == 0) {
  ------------------
  |  Branch (1885:6): [True: 1, False: 13]
  ------------------
 1886|       |		/* empty password */
 1887|      1|		goto out;
 1888|      1|	}
 1889|       |
 1890|       |	/* copy passphrase into new buffer */
 1891|     13|	ret = os_malloc(*keylen);
  ------------------
  |  |  505|     13|#define os_malloc(s) malloc((s))
  ------------------
 1892|     13|	if (ret)
  ------------------
  |  Branch (1892:6): [True: 13, False: 0]
  ------------------
 1893|     13|		os_memcpy(ret, str + 1, *keylen);
  ------------------
  |  |  523|     13|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
 1894|       |
 1895|    879|out:
 1896|       |	/* return new buffer */
 1897|    879|	os_free(buf);
  ------------------
  |  |  511|    879|#define os_free(p) free((p))
  ------------------
 1898|    879|	return ret;
 1899|     13|}
radius.c:radius_msg_initialize:
   80|  1.89k|{
   81|  1.89k|	msg->attr_pos = os_calloc(RADIUS_DEFAULT_ATTR_COUNT,
  ------------------
  |  |  253|  1.89k|#define RADIUS_DEFAULT_ATTR_COUNT 16
  ------------------
   82|  1.89k|				  sizeof(*msg->attr_pos));
   83|  1.89k|	if (msg->attr_pos == NULL)
  ------------------
  |  Branch (83:6): [True: 0, False: 1.89k]
  ------------------
   84|      0|		return -1;
   85|       |
   86|  1.89k|	msg->attr_size = RADIUS_DEFAULT_ATTR_COUNT;
  ------------------
  |  |  253|  1.89k|#define RADIUS_DEFAULT_ATTR_COUNT 16
  ------------------
   87|  1.89k|	msg->attr_used = 0;
   88|       |
   89|  1.89k|	return 0;
   90|  1.89k|}
radius.c:radius_msg_set_hdr:
   73|    965|{
   74|    965|	msg->hdr->code = code;
   75|    965|	msg->hdr->identifier = identifier;
   76|    965|}
radius.c:radius_code_string:
  139|    879|{
  140|    879|	switch (code) {
  141|     53|	case RADIUS_CODE_ACCESS_REQUEST: return "Access-Request";
  ------------------
  |  Branch (141:2): [True: 53, False: 826]
  ------------------
  142|     71|	case RADIUS_CODE_ACCESS_ACCEPT: return "Access-Accept";
  ------------------
  |  Branch (142:2): [True: 71, False: 808]
  ------------------
  143|     26|	case RADIUS_CODE_ACCESS_REJECT: return "Access-Reject";
  ------------------
  |  Branch (143:2): [True: 26, False: 853]
  ------------------
  144|     22|	case RADIUS_CODE_ACCOUNTING_REQUEST: return "Accounting-Request";
  ------------------
  |  Branch (144:2): [True: 22, False: 857]
  ------------------
  145|     40|	case RADIUS_CODE_ACCOUNTING_RESPONSE: return "Accounting-Response";
  ------------------
  |  Branch (145:2): [True: 40, False: 839]
  ------------------
  146|     22|	case RADIUS_CODE_ACCESS_CHALLENGE: return "Access-Challenge";
  ------------------
  |  Branch (146:2): [True: 22, False: 857]
  ------------------
  147|     24|	case RADIUS_CODE_STATUS_SERVER: return "Status-Server";
  ------------------
  |  Branch (147:2): [True: 24, False: 855]
  ------------------
  148|     21|	case RADIUS_CODE_STATUS_CLIENT: return "Status-Client";
  ------------------
  |  Branch (148:2): [True: 21, False: 858]
  ------------------
  149|     34|	case RADIUS_CODE_RESERVED: return "Reserved";
  ------------------
  |  Branch (149:2): [True: 34, False: 845]
  ------------------
  150|     20|	case RADIUS_CODE_DISCONNECT_REQUEST: return "Disconnect-Request";
  ------------------
  |  Branch (150:2): [True: 20, False: 859]
  ------------------
  151|     35|	case RADIUS_CODE_DISCONNECT_ACK: return "Disconnect-ACK";
  ------------------
  |  Branch (151:2): [True: 35, False: 844]
  ------------------
  152|     40|	case RADIUS_CODE_DISCONNECT_NAK: return "Disconnect-NAK";
  ------------------
  |  Branch (152:2): [True: 40, False: 839]
  ------------------
  153|     19|	case RADIUS_CODE_COA_REQUEST: return "CoA-Request";
  ------------------
  |  Branch (153:2): [True: 19, False: 860]
  ------------------
  154|     29|	case RADIUS_CODE_COA_ACK: return "CoA-ACK";
  ------------------
  |  Branch (154:2): [True: 29, False: 850]
  ------------------
  155|     13|	case RADIUS_CODE_COA_NAK: return "CoA-NAK";
  ------------------
  |  Branch (155:2): [True: 13, False: 866]
  ------------------
  156|    410|	default: return "?Unknown?";
  ------------------
  |  Branch (156:2): [True: 410, False: 469]
  ------------------
  157|    879|	}
  158|    879|}
radius.c:radius_get_attr_hdr:
   66|   886k|{
   67|   886k|	return (struct radius_attr_hdr *)
   68|   886k|		(wpabuf_mhead_u8(msg->buf) + msg->attr_pos[idx]);
   69|   886k|}
radius.c:radius_msg_dump_attr:
  317|   168k|{
  318|   168k|	struct radius_attr_hdr_ext *ext = NULL;
  319|   168k|	const struct radius_attr_type *attr;
  320|   168k|	int len;
  321|   168k|	unsigned char *pos;
  322|   168k|	char buf[1000];
  323|       |
  324|   168k|	if (hdr->length < sizeof(struct radius_attr_hdr))
  ------------------
  |  Branch (324:6): [True: 0, False: 168k]
  ------------------
  325|      0|		return;
  326|       |
  327|   168k|	if (radius_is_ext_type(hdr->type)) {
  ------------------
  |  Branch (327:6): [True: 2.17k, False: 166k]
  ------------------
  328|  2.17k|		if (hdr->length < 4) {
  ------------------
  |  Branch (328:7): [True: 899, False: 1.27k]
  ------------------
  329|    899|			wpa_printf(MSG_INFO,
  330|    899|				   "   Invalid attribute %d (too short for extended type)",
  331|    899|				hdr->type);
  332|    899|			return;
  333|    899|		}
  334|       |
  335|  1.27k|		ext = (struct radius_attr_hdr_ext *) hdr;
  336|  1.27k|	}
  337|       |
  338|   168k|	if (ext) {
  ------------------
  |  Branch (338:6): [True: 1.27k, False: 166k]
  ------------------
  339|  1.27k|		attr = radius_get_attr_type((ext->type << 8) | ext->ext_type);
  340|  1.27k|		wpa_printf(MSG_INFO, "   Attribute %d.%d (%s) length=%d",
  341|  1.27k|			   ext->type, ext->ext_type,
  342|  1.27k|			   attr ? attr->name : "?Unknown?", ext->length);
  ------------------
  |  Branch (342:7): [True: 804, False: 472]
  ------------------
  343|  1.27k|		pos = (unsigned char *) (ext + 1);
  344|  1.27k|		len = ext->length - sizeof(struct radius_attr_hdr_ext);
  345|   166k|	} else {
  346|   166k|		attr = radius_get_attr_type(hdr->type);
  347|   166k|		wpa_printf(MSG_INFO, "   Attribute %d (%s) length=%d",
  348|   166k|			   hdr->type, attr ? attr->name : "?Unknown?",
  ------------------
  |  Branch (348:18): [True: 152k, False: 13.8k]
  ------------------
  349|   166k|			   hdr->length);
  350|   166k|		pos = (unsigned char *) (hdr + 1);
  351|   166k|		len = hdr->length - sizeof(struct radius_attr_hdr);
  352|   166k|	}
  353|       |
  354|   168k|	if (!attr)
  ------------------
  |  Branch (354:6): [True: 14.3k, False: 153k]
  ------------------
  355|  14.3k|		return;
  356|       |
  357|   153k|	switch (attr->data_type) {
  358|  2.67k|	case RADIUS_ATTR_TEXT:
  ------------------
  |  Branch (358:2): [True: 2.67k, False: 151k]
  ------------------
  359|  2.67k|		printf_encode(buf, sizeof(buf), pos, len);
  360|  2.67k|		wpa_printf(MSG_INFO, "      Value: '%s'", buf);
  361|  2.67k|		break;
  362|       |
  363|  1.43k|	case RADIUS_ATTR_IP:
  ------------------
  |  Branch (363:2): [True: 1.43k, False: 152k]
  ------------------
  364|  1.43k|		if (len == 4) {
  ------------------
  |  Branch (364:7): [True: 334, False: 1.10k]
  ------------------
  365|    334|			struct in_addr addr;
  366|    334|			os_memcpy(&addr, pos, 4);
  ------------------
  |  |  523|    334|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  367|    334|			wpa_printf(MSG_INFO, "      Value: %s",
  368|    334|				   inet_ntoa(addr));
  369|  1.10k|		} else {
  370|  1.10k|			wpa_printf(MSG_INFO, "      Invalid IP address length %d",
  371|  1.10k|				   len);
  372|  1.10k|		}
  373|  1.43k|		break;
  374|       |
  375|      0|#ifdef CONFIG_IPV6
  376|  9.14k|	case RADIUS_ATTR_IPV6:
  ------------------
  |  Branch (376:2): [True: 9.14k, False: 144k]
  ------------------
  377|  9.14k|		if (len == 16) {
  ------------------
  |  Branch (377:7): [True: 440, False: 8.70k]
  ------------------
  378|    440|			const char *atxt;
  379|    440|			struct in6_addr *addr = (struct in6_addr *) pos;
  380|    440|			atxt = inet_ntop(AF_INET6, addr, buf, sizeof(buf));
  381|    440|			wpa_printf(MSG_INFO, "      Value: %s",
  382|    440|				   atxt ? atxt : "?");
  ------------------
  |  Branch (382:8): [True: 440, False: 0]
  ------------------
  383|  8.70k|		} else {
  384|  8.70k|			wpa_printf(MSG_INFO, "      Invalid IPv6 address length %d",
  385|  8.70k|				   len);
  386|  8.70k|		}
  387|  9.14k|		break;
  388|      0|#endif /* CONFIG_IPV6 */
  389|       |
  390|  34.5k|	case RADIUS_ATTR_HEXDUMP:
  ------------------
  |  Branch (390:2): [True: 34.5k, False: 119k]
  ------------------
  391|   136k|	case RADIUS_ATTR_UNDIST:
  ------------------
  |  Branch (391:2): [True: 101k, False: 51.9k]
  ------------------
  392|   136k|		wpa_snprintf_hex(buf, sizeof(buf), pos, len);
  393|   136k|		wpa_printf(MSG_INFO, "      Value: %s", buf);
  394|   136k|		break;
  395|       |
  396|  4.07k|	case RADIUS_ATTR_INT32:
  ------------------
  |  Branch (396:2): [True: 4.07k, False: 149k]
  ------------------
  397|  4.07k|		if (len == 4)
  ------------------
  |  Branch (397:7): [True: 1.13k, False: 2.94k]
  ------------------
  398|  1.13k|			wpa_printf(MSG_INFO, "      Value: %u",
  399|  1.13k|				   WPA_GET_BE32(pos));
  400|  2.94k|		else
  401|  2.94k|			wpa_printf(MSG_INFO, "      Invalid INT32 length %d",
  402|  2.94k|				   len);
  403|  4.07k|		break;
  404|       |
  405|      0|	default:
  ------------------
  |  Branch (405:2): [True: 0, False: 153k]
  ------------------
  406|      0|		break;
  407|   153k|	}
  408|   153k|}
radius.c:radius_get_attr_type:
  290|   168k|{
  291|   168k|	size_t i;
  292|       |
  293|  3.59M|	for (i = 0; i < RADIUS_ATTRS; i++) {
  ------------------
  |  |  286|  3.59M|#define RADIUS_ATTRS ARRAY_SIZE(radius_attrs)
  |  |  ------------------
  |  |  |  |  607|  3.59M|#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
  |  |  ------------------
  ------------------
  |  Branch (293:14): [True: 3.57M, False: 14.3k]
  ------------------
  294|  3.57M|		if (type == radius_attrs[i].type)
  ------------------
  |  Branch (294:7): [True: 153k, False: 3.42M]
  ------------------
  295|   153k|			return &radius_attrs[i];
  296|  3.57M|	}
  297|       |
  298|  14.3k|	return NULL;
  299|   168k|}
radius.c:radius_msg_auth_pos:
  445|    965|{
  446|    965|	u8 *pos;
  447|    965|	size_t alen;
  448|       |
  449|    965|	if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
  ------------------
  |  Branch (449:6): [True: 0, False: 965]
  ------------------
  450|    965|				    &pos, &alen, NULL) == 0 &&
  451|      0|	    alen == MD5_MAC_LEN) {
  ------------------
  |  |   12|      0|#define MD5_MAC_LEN 16
  ------------------
  |  Branch (451:6): [True: 0, False: 0]
  ------------------
  452|       |		/* Use already added Message-Authenticator attribute */
  453|      0|		return pos;
  454|      0|	}
  455|       |
  456|       |	/* Add a Message-Authenticator attribute */
  457|    965|	return radius_msg_add_msg_auth(msg);
  458|    965|}
radius.c:radius_is_ext_type:
  310|   171k|{
  311|   171k|	return type >= RADIUS_ATTR_EXT_TYPE_1 &&
  ------------------
  |  Branch (311:9): [True: 2.70k, False: 169k]
  ------------------
  312|  2.70k|		type <= RADIUS_ATTR_LONG_EXT_TYPE_2;
  ------------------
  |  Branch (312:3): [True: 2.17k, False: 532]
  ------------------
  313|   171k|}
radius.c:radius_is_long_ext_type:
  303|  1.93k|{
  304|  1.93k|	return type == RADIUS_ATTR_LONG_EXT_TYPE_1 ||
  ------------------
  |  Branch (304:9): [True: 0, False: 1.93k]
  ------------------
  305|  1.93k|		type == RADIUS_ATTR_LONG_EXT_TYPE_2;
  ------------------
  |  Branch (305:3): [True: 0, False: 1.93k]
  ------------------
  306|  1.93k|}
radius.c:radius_msg_add_attr_to_array:
  724|   197k|{
  725|   197k|	if (msg->attr_used >= msg->attr_size) {
  ------------------
  |  Branch (725:6): [True: 666, False: 197k]
  ------------------
  726|    666|		size_t *nattr_pos;
  727|    666|		size_t nlen = msg->attr_size * 2;
  728|       |
  729|    666|		nattr_pos = os_realloc_array(msg->attr_pos, nlen,
  730|    666|					     sizeof(*msg->attr_pos));
  731|    666|		if (nattr_pos == NULL)
  ------------------
  |  Branch (731:7): [True: 0, False: 666]
  ------------------
  732|      0|			return -1;
  733|       |
  734|    666|		msg->attr_pos = nattr_pos;
  735|    666|		msg->attr_size = nlen;
  736|    666|	}
  737|       |
  738|   197k|	msg->attr_pos[msg->attr_used++] =
  739|   197k|		(unsigned char *) attr - wpabuf_head_u8(msg->buf);
  740|       |
  741|   197k|	return 0;
  742|   197k|}
radius.c:cmp_int:
 1666|    151|{
 1667|    151|	int x, y;
 1668|       |
 1669|    151|	x = *((int *) a);
 1670|    151|	y = *((int *) b);
 1671|    151|	return (x - y);
 1672|    151|}

wpa_snprintf_hex:
  347|   136k|{
  348|   136k|	return _wpa_snprintf_hex(buf, buf_size, data, len, 0);
  349|   136k|}
printf_encode:
  478|  2.67k|{
  479|  2.67k|	char *end = txt + maxlen;
  480|  2.67k|	size_t i;
  481|       |
  482|  83.1k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (482:14): [True: 80.6k, False: 2.46k]
  ------------------
  483|  80.6k|		if (txt + 4 >= end)
  ------------------
  |  Branch (483:7): [True: 206, False: 80.4k]
  ------------------
  484|    206|			break;
  485|       |
  486|  80.4k|		switch (data[i]) {
  487|    948|		case '\"':
  ------------------
  |  Branch (487:3): [True: 948, False: 79.5k]
  ------------------
  488|    948|			*txt++ = '\\';
  489|    948|			*txt++ = '\"';
  490|    948|			break;
  491|    211|		case '\\':
  ------------------
  |  Branch (491:3): [True: 211, False: 80.2k]
  ------------------
  492|    211|			*txt++ = '\\';
  493|    211|			*txt++ = '\\';
  494|    211|			break;
  495|    483|		case '\033':
  ------------------
  |  Branch (495:3): [True: 483, False: 79.9k]
  ------------------
  496|    483|			*txt++ = '\\';
  497|    483|			*txt++ = 'e';
  498|    483|			break;
  499|    653|		case '\n':
  ------------------
  |  Branch (499:3): [True: 653, False: 79.8k]
  ------------------
  500|    653|			*txt++ = '\\';
  501|    653|			*txt++ = 'n';
  502|    653|			break;
  503|    550|		case '\r':
  ------------------
  |  Branch (503:3): [True: 550, False: 79.9k]
  ------------------
  504|    550|			*txt++ = '\\';
  505|    550|			*txt++ = 'r';
  506|    550|			break;
  507|    239|		case '\t':
  ------------------
  |  Branch (507:3): [True: 239, False: 80.2k]
  ------------------
  508|    239|			*txt++ = '\\';
  509|    239|			*txt++ = 't';
  510|    239|			break;
  511|  77.3k|		default:
  ------------------
  |  Branch (511:3): [True: 77.3k, False: 3.08k]
  ------------------
  512|  77.3k|			if (data[i] >= 32 && data[i] <= 126) {
  ------------------
  |  Branch (512:8): [True: 10.1k, False: 67.2k]
  |  Branch (512:25): [True: 5.05k, False: 5.11k]
  ------------------
  513|  5.05k|				*txt++ = data[i];
  514|  72.3k|			} else {
  515|  72.3k|				txt += os_snprintf(txt, end - txt, "\\x%02x",
  ------------------
  |  |  572|  72.3k|#define os_snprintf snprintf
  ------------------
  516|  72.3k|						   data[i]);
  517|  72.3k|			}
  518|  77.3k|			break;
  519|  80.4k|		}
  520|  80.4k|	}
  521|       |
  522|  2.67k|	*txt = '\0';
  523|  2.67k|}
__hide_aliasing_typecast:
  637|  4.19k|{
  638|  4.19k|	return foo;
  639|  4.19k|}
common.c:_wpa_snprintf_hex:
  319|   136k|{
  320|   136k|	size_t i;
  321|   136k|	char *pos = buf, *end = buf + buf_size;
  322|   136k|	int ret;
  323|   136k|	if (buf_size == 0)
  ------------------
  |  Branch (323:6): [True: 0, False: 136k]
  ------------------
  324|      0|		return 0;
  325|   494k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (325:14): [True: 358k, False: 136k]
  ------------------
  326|   358k|		ret = os_snprintf(pos, end - pos, uppercase ? "%02X" : "%02x",
  ------------------
  |  |  572|   358k|#define os_snprintf snprintf
  ------------------
  |  Branch (326:37): [True: 0, False: 358k]
  ------------------
  327|   358k|				  data[i]);
  328|   358k|		if (os_snprintf_error(end - pos, ret)) {
  ------------------
  |  Branch (328:7): [True: 0, False: 358k]
  ------------------
  329|      0|			end[-1] = '\0';
  330|      0|			return pos - buf;
  331|      0|		}
  332|   358k|		pos += ret;
  333|   358k|	}
  334|   136k|	end[-1] = '\0';
  335|   136k|	return pos - buf;
  336|   136k|}

radius.c:WPA_GET_BE32:
  260|  1.13k|{
  261|  1.13k|	return ((u32) a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3];
  262|  1.13k|}
radius.c:WPA_GET_BE24:
  236|  4.59k|{
  237|  4.59k|	return (a[0] << 16) | (a[1] << 8) | a[2];
  238|  4.59k|}

radius.c:testing_test_fail:
  697|    965|{
  698|    965|	return 0;
  699|    965|}
radius.c:os_realloc_array:
  586|    666|{
  587|    666|	if (size && nmemb > (~(size_t) 0) / size)
  ------------------
  |  Branch (587:6): [True: 666, False: 0]
  |  Branch (587:14): [True: 0, False: 666]
  ------------------
  588|      0|		return NULL;
  589|    666|	return os_realloc(ptr, nmemb * size);
  ------------------
  |  |  508|    666|#define os_realloc(p, s) realloc((p), (s))
  ------------------
  590|    666|}
radius.c:os_calloc:
  298|  1.89k|{
  299|  1.89k|	if (size && nmemb > (~(size_t) 0) / size)
  ------------------
  |  Branch (299:6): [True: 1.89k, False: 0]
  |  Branch (299:14): [True: 0, False: 1.89k]
  ------------------
  300|      0|		return NULL;
  301|  1.89k|	return os_zalloc(nmemb * size);
  302|  1.89k|}
md5-internal.c:testing_test_fail:
  697|  2.09k|{
  698|  2.09k|	return 0;
  699|  2.09k|}
common.c:os_snprintf_error:
  580|   358k|{
  581|   358k|	return res < 0 || (unsigned int) res >= size;
  ------------------
  |  Branch (581:9): [True: 0, False: 358k]
  |  Branch (581:20): [True: 0, False: 358k]
  ------------------
  582|   358k|}

os_get_random:
  280|    965|{
  281|    965|#ifdef TEST_FUZZ
  282|    965|	size_t i;
  283|       |
  284|  4.82k|	for (i = 0; i < len; i++)
  ------------------
  |  Branch (284:14): [True: 3.86k, False: 965]
  ------------------
  285|  3.86k|		buf[i] = i & 0xff;
  286|    965|	return 0;
  287|       |#else /* TEST_FUZZ */
  288|       |	FILE *f;
  289|       |	size_t rc;
  290|       |
  291|       |	if (TEST_FAIL())
  292|       |		return -1;
  293|       |
  294|       |	f = fopen("/dev/urandom", "rb");
  295|       |	if (f == NULL) {
  296|       |		printf("Could not open /dev/urandom.\n");
  297|       |		return -1;
  298|       |	}
  299|       |
  300|       |	rc = fread(buf, 1, len, f);
  301|       |	fclose(f);
  302|       |
  303|       |	return rc != len ? -1 : 0;
  304|       |#endif /* TEST_FUZZ */
  305|    965|}
os_program_init:
  361|    965|{
  362|    965|	unsigned int seed;
  363|       |
  364|       |#ifdef ANDROID
  365|       |	/*
  366|       |	 * We ignore errors here since errors are normal if we
  367|       |	 * are already running as non-root.
  368|       |	 */
  369|       |#ifdef ANDROID_SETGROUPS_OVERRIDE
  370|       |	gid_t groups[] = { ANDROID_SETGROUPS_OVERRIDE };
  371|       |#else /* ANDROID_SETGROUPS_OVERRIDE */
  372|       |	gid_t groups[] = { AID_INET, AID_WIFI, AID_KEYSTORE };
  373|       |#endif /* ANDROID_SETGROUPS_OVERRIDE */
  374|       |	struct __user_cap_header_struct header;
  375|       |	struct __user_cap_data_struct cap;
  376|       |
  377|       |	setgroups(ARRAY_SIZE(groups), groups);
  378|       |
  379|       |	prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
  380|       |
  381|       |	setgid(AID_WIFI);
  382|       |	setuid(AID_WIFI);
  383|       |
  384|       |	header.version = _LINUX_CAPABILITY_VERSION;
  385|       |	header.pid = 0;
  386|       |	cap.effective = cap.permitted =
  387|       |		(1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW);
  388|       |	cap.inheritable = 0;
  389|       |	capset(&header, &cap);
  390|       |#endif /* ANDROID */
  391|       |
  392|    965|	if (os_get_random((unsigned char *) &seed, sizeof(seed)) == 0)
  ------------------
  |  Branch (392:6): [True: 965, False: 0]
  ------------------
  393|    965|		srandom(seed);
  394|       |
  395|    965|	return 0;
  396|    965|}
os_program_deinit:
  400|    965|{
  401|       |#ifdef WPA_TRACE
  402|       |	struct os_alloc_trace *a;
  403|       |	unsigned long total = 0;
  404|       |	dl_list_for_each(a, &alloc_list, struct os_alloc_trace, list) {
  405|       |		total += a->len;
  406|       |		if (a->magic != ALLOC_MAGIC) {
  407|       |			wpa_printf(MSG_INFO, "MEMLEAK[%p]: invalid magic 0x%x "
  408|       |				   "len %lu",
  409|       |				   a, a->magic, (unsigned long) a->len);
  410|       |			continue;
  411|       |		}
  412|       |		wpa_printf(MSG_INFO, "MEMLEAK[%p]: len %lu",
  413|       |			   a, (unsigned long) a->len);
  414|       |		wpa_trace_dump("memleak", a);
  415|       |	}
  416|       |	if (total)
  417|       |		wpa_printf(MSG_INFO, "MEMLEAK: total %lu bytes",
  418|       |			   (unsigned long) total);
  419|       |	wpa_trace_deinit();
  420|       |#endif /* WPA_TRACE */
  421|    965|}
os_zalloc:
  507|  5.81k|{
  508|  5.81k|	return calloc(1, size);
  509|  5.81k|}
os_memdup:
  553|     34|{
  554|     34|	void *r = os_malloc(len);
  ------------------
  |  |  505|     34|#define os_malloc(s) malloc((s))
  ------------------
  555|       |
  556|     34|	if (r && src)
  ------------------
  |  Branch (556:6): [True: 34, False: 0]
  |  Branch (556:11): [True: 34, False: 0]
  ------------------
  557|     34|		os_memcpy(r, src, len);
  ------------------
  |  |  523|     34|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  558|     34|	return r;
  559|     34|}

wpa_printf:
  224|   323k|{
  225|   323k|	va_list ap;
  226|       |
  227|   323k|	if (level >= wpa_debug_level) {
  ------------------
  |  Branch (227:6): [True: 0, False: 323k]
  ------------------
  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|      0|#ifdef CONFIG_DEBUG_FILE
  243|      0|		if (out_file) {
  ------------------
  |  Branch (243:7): [True: 0, False: 0]
  ------------------
  244|      0|			va_start(ap, fmt);
  245|      0|			vfprintf(out_file, fmt, ap);
  246|      0|			fprintf(out_file, "\n");
  247|      0|			va_end(ap);
  248|      0|		}
  249|      0|#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|   323k|}
wpa_hexdump:
  400|    879|{
  401|    879|	_wpa_hexdump(level, title, buf, len, 1, 0);
  402|    879|}
wpa_debug.c:_wpa_hexdump:
  274|    879|{
  275|    879|	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|    879|	if (level < wpa_debug_level)
  ------------------
  |  Branch (295:6): [True: 879, False: 0]
  ------------------
  296|    879|		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|      0|#ifdef CONFIG_DEBUG_FILE
  370|      0|	if (out_file) {
  ------------------
  |  Branch (370:6): [True: 0, False: 0]
  ------------------
  371|      0|		fprintf(out_file, "%s - hexdump(len=%lu):",
  372|      0|			title, (unsigned long) len);
  373|      0|		if (buf == NULL) {
  ------------------
  |  Branch (373:7): [True: 0, False: 0]
  ------------------
  374|      0|			fprintf(out_file, " [NULL]");
  375|      0|		} else if (show) {
  ------------------
  |  Branch (375:14): [True: 0, False: 0]
  ------------------
  376|      0|			for (i = 0; i < len; i++)
  ------------------
  |  Branch (376:16): [True: 0, False: 0]
  ------------------
  377|      0|				fprintf(out_file, " %02x", buf[i]);
  378|      0|		} else {
  379|      0|			fprintf(out_file, " [REMOVED]");
  380|      0|		}
  381|      0|		fprintf(out_file, "\n");
  382|      0|	}
  383|      0|#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|}

radius.c:wpa_hexdump_buf:
  122|    879|{
  123|    879|	wpa_hexdump(level, title, buf ? wpabuf_head(buf) : NULL,
  ------------------
  |  Branch (123:28): [True: 114, False: 765]
  ------------------
  124|    879|		    buf ? wpabuf_len(buf) : 0);
  ------------------
  |  Branch (124:7): [True: 114, False: 765]
  ------------------
  125|    879|}

wpabuf_alloc:
  114|  2.01k|{
  115|       |#ifdef WPA_TRACE
  116|       |	struct wpabuf_trace *trace = os_zalloc(sizeof(struct wpabuf_trace) +
  117|       |					       sizeof(struct wpabuf) + len);
  118|       |	struct wpabuf *buf;
  119|       |	if (trace == NULL)
  120|       |		return NULL;
  121|       |	trace->magic = WPABUF_MAGIC;
  122|       |	buf = (struct wpabuf *) (trace + 1);
  123|       |#else /* WPA_TRACE */
  124|  2.01k|	struct wpabuf *buf = os_zalloc(sizeof(struct wpabuf) + len);
  125|  2.01k|	if (buf == NULL)
  ------------------
  |  Branch (125:6): [True: 0, False: 2.01k]
  ------------------
  126|      0|		return NULL;
  127|  2.01k|#endif /* WPA_TRACE */
  128|       |
  129|  2.01k|	buf->size = len;
  130|  2.01k|	buf->buf = (u8 *) (buf + 1);
  131|  2.01k|	return buf;
  132|  2.01k|}
wpabuf_alloc_copy:
  161|    934|{
  162|    934|	struct wpabuf *buf = wpabuf_alloc(len);
  163|    934|	if (buf)
  ------------------
  |  Branch (163:6): [True: 934, False: 0]
  ------------------
  164|    934|		wpabuf_put_data(buf, data, len);
  165|    934|	return buf;
  166|    934|}
wpabuf_free:
  187|  2.77k|{
  188|       |#ifdef WPA_TRACE
  189|       |	struct wpabuf_trace *trace;
  190|       |	if (buf == NULL)
  191|       |		return;
  192|       |	trace = wpabuf_get_trace(buf);
  193|       |	if (trace->magic != WPABUF_MAGIC) {
  194|       |		wpa_printf(MSG_ERROR, "wpabuf_free: invalid magic %x",
  195|       |			   trace->magic);
  196|       |		wpa_trace_show("wpabuf_free magic mismatch");
  197|       |		abort();
  198|       |	}
  199|       |	if (buf->flags & WPABUF_FLAG_EXT_DATA)
  200|       |		os_free(buf->buf);
  201|       |	os_free(trace);
  202|       |#else /* WPA_TRACE */
  203|  2.77k|	if (buf == NULL)
  ------------------
  |  Branch (203:6): [True: 765, False: 2.01k]
  ------------------
  204|    765|		return;
  205|  2.01k|	if (buf->flags & WPABUF_FLAG_EXT_DATA)
  ------------------
  |  |   13|  2.01k|#define WPABUF_FLAG_EXT_DATA BIT(0)
  |  |  ------------------
  |  |  |  |  458|  2.01k|#define BIT(x) (1U << (x))
  |  |  ------------------
  ------------------
  |  Branch (205:6): [True: 0, False: 2.01k]
  ------------------
  206|      0|		os_free(buf->buf);
  ------------------
  |  |  511|      0|#define os_free(p) free((p))
  ------------------
  207|  2.01k|	os_free(buf);
  ------------------
  |  |  511|  2.01k|#define os_free(p) free((p))
  ------------------
  208|  2.01k|#endif /* WPA_TRACE */
  209|  2.01k|}
wpabuf_put:
  222|  7.77k|{
  223|  7.77k|	void *tmp = wpabuf_mhead_u8(buf) + wpabuf_len(buf);
  224|  7.77k|	buf->used += len;
  225|  7.77k|	if (buf->used > buf->size) {
  ------------------
  |  Branch (225:6): [True: 0, False: 7.77k]
  ------------------
  226|      0|		wpabuf_overflow(buf, len);
  227|      0|	}
  228|  7.77k|	return tmp;
  229|  7.77k|}

radius.c:wpabuf_len:
   59|  3.94k|{
   60|  3.94k|	return buf->used;
   61|  3.94k|}
radius.c:wpabuf_head:
   94|   198k|{
   95|   198k|	return buf->buf;
   96|   198k|}
radius.c:wpabuf_head_u8:
   99|   197k|{
  100|   197k|	return (const u8 *) wpabuf_head(buf);
  101|   197k|}
radius.c:wpabuf_tailroom:
   69|    965|{
   70|    965|	return buf->size - buf->used;
   71|    965|}
radius.c:wpabuf_mhead:
  109|   889k|{
  110|   889k|	return buf->buf;
  111|   889k|}
radius.c:wpabuf_put_data:
  174|  4.90k|{
  175|  4.90k|	if (data)
  ------------------
  |  Branch (175:6): [True: 4.90k, False: 0]
  ------------------
  176|  4.90k|		os_memcpy(wpabuf_put(buf, len), data, len);
  ------------------
  |  |  523|  4.90k|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  177|  4.90k|}
radius.c:wpabuf_mhead_u8:
  114|   888k|{
  115|   888k|	return (u8 *) wpabuf_mhead(buf);
  116|   888k|}
wpabuf.c:wpabuf_put_data:
  174|    934|{
  175|    934|	if (data)
  ------------------
  |  Branch (175:6): [True: 934, False: 0]
  ------------------
  176|    934|		os_memcpy(wpabuf_put(buf, len), data, len);
  ------------------
  |  |  523|    934|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  177|    934|}
wpabuf.c:wpabuf_len:
   59|  7.77k|{
   60|  7.77k|	return buf->used;
   61|  7.77k|}
wpabuf.c:wpabuf_mhead:
  109|  7.77k|{
  110|  7.77k|	return buf->buf;
  111|  7.77k|}
wpabuf.c:wpabuf_mhead_u8:
  114|  7.77k|{
  115|  7.77k|	return (u8 *) wpabuf_mhead(buf);
  116|  7.77k|}

wpa_fuzzer_set_debug_level:
   15|    965|{
   16|    965|	static int first = 1;
   17|       |
   18|    965|	if (first) {
  ------------------
  |  Branch (18:6): [True: 1, False: 964]
  ------------------
   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|    965|}

LLVMFuzzerTestOneInput:
   17|    965|{
   18|    965|	struct radius_msg *msg, *sent_msg;
   19|    965|	struct wpabuf *eap;
   20|    965|	u8 buf[10];
   21|    965|	int untagged;
   22|    965|	const unsigned int num_tagged = 5;
   23|    965|	int tagged[num_tagged];
   24|    965|	char *pw;
   25|    965|	int keylen;
   26|       |
   27|    965|	wpa_fuzzer_set_debug_level();
   28|       |
   29|    965|	if (os_program_init())
  ------------------
  |  Branch (29:6): [True: 0, False: 965]
  ------------------
   30|      0|		return 0;
   31|       |
   32|    965|	sent_msg = radius_msg_new(RADIUS_CODE_ACCESS_REQUEST, 123);
   33|    965|	if (!sent_msg)
  ------------------
  |  Branch (33:6): [True: 0, False: 965]
  ------------------
   34|      0|		return -1;
   35|    965|	radius_msg_finish(sent_msg, (const u8 *) "test", 4);
   36|       |
   37|    965|	msg = radius_msg_parse(data, size);
   38|    965|	if (msg) {
  ------------------
  |  Branch (38:6): [True: 879, False: 86]
  ------------------
   39|    879|		radius_msg_dump(msg);
   40|    879|		radius_msg_get_attr(msg, RADIUS_ATTR_NAS_IP_ADDRESS,
   41|    879|				    buf, sizeof(buf));
   42|    879|		radius_msg_get_vlanid(msg, &untagged, num_tagged, tagged);
   43|    879|		eap = radius_msg_get_eap(msg);
   44|    879|		wpa_hexdump_buf(MSG_INFO, "EAP", eap);
   45|    879|		wpabuf_free(eap);
   46|    879|		pw = radius_msg_get_tunnel_password(msg, &keylen,
   47|    879|						    (const u8 *) "test", 4,
   48|    879|						    sent_msg, 1);
   49|    879|		if (pw)
  ------------------
  |  Branch (49:7): [True: 13, False: 866]
  ------------------
   50|     13|			wpa_printf(MSG_INFO, "PW: %s", pw);
   51|    879|		os_free(pw);
  ------------------
  |  |  511|    879|#define os_free(p) free((p))
  ------------------
   52|    879|		radius_msg_free(msg);
   53|    879|	}
   54|       |
   55|    965|	radius_msg_free(sent_msg);
   56|       |
   57|    965|	os_program_deinit();
   58|       |
   59|    965|	return 0;
   60|    965|}

