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

hmac_md5_vector:
   28|    953|{
   29|    953|	u8 k_pad[64]; /* padding - key XORd with ipad/opad */
   30|    953|	u8 tk[16];
   31|    953|	const u8 *_addr[6];
   32|    953|	size_t i, _len[6];
   33|    953|	int res;
   34|       |
   35|    953|	if (num_elem > 5) {
  ------------------
  |  Branch (35:6): [True: 0, False: 953]
  ------------------
   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|    953|        if (key_len > 64) {
  ------------------
  |  Branch (44:13): [True: 0, False: 953]
  ------------------
   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|    953|	os_memset(k_pad, 0, sizeof(k_pad));
  ------------------
  |  |  529|    953|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   62|    953|	os_memcpy(k_pad, key, key_len);
  ------------------
  |  |  523|    953|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
   63|       |
   64|       |	/* XOR key with ipad values */
   65|  61.9k|	for (i = 0; i < 64; i++)
  ------------------
  |  Branch (65:14): [True: 60.9k, False: 953]
  ------------------
   66|  60.9k|		k_pad[i] ^= 0x36;
   67|       |
   68|       |	/* perform inner MD5 */
   69|    953|	_addr[0] = k_pad;
   70|    953|	_len[0] = 64;
   71|  1.90k|	for (i = 0; i < num_elem; i++) {
  ------------------
  |  Branch (71:14): [True: 953, False: 953]
  ------------------
   72|    953|		_addr[i + 1] = addr[i];
   73|    953|		_len[i + 1] = len[i];
   74|    953|	}
   75|    953|	if (md5_vector(1 + num_elem, _addr, _len, mac))
  ------------------
  |  Branch (75:6): [True: 0, False: 953]
  ------------------
   76|      0|		return -1;
   77|       |
   78|    953|	os_memset(k_pad, 0, sizeof(k_pad));
  ------------------
  |  |  529|    953|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   79|    953|	os_memcpy(k_pad, key, key_len);
  ------------------
  |  |  523|    953|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
   80|       |	/* XOR key with opad values */
   81|  61.9k|	for (i = 0; i < 64; i++)
  ------------------
  |  Branch (81:14): [True: 60.9k, False: 953]
  ------------------
   82|  60.9k|		k_pad[i] ^= 0x5c;
   83|       |
   84|       |	/* perform outer MD5 */
   85|    953|	_addr[0] = k_pad;
   86|    953|	_len[0] = 64;
   87|    953|	_addr[1] = mac;
   88|    953|	_len[1] = MD5_MAC_LEN;
  ------------------
  |  |   12|    953|#define MD5_MAC_LEN 16
  ------------------
   89|    953|	res = md5_vector(2, _addr, _len, mac);
   90|    953|	os_memset(k_pad, 0, sizeof(k_pad));
  ------------------
  |  |  529|    953|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   91|    953|	os_memset(tk, 0, sizeof(tk));
  ------------------
  |  |  529|    953|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
   92|    953|	return res;
   93|    953|}
hmac_md5:
  107|    953|{
  108|    953|	return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac);
  109|    953|}

radius_msg_new:
  103|    953|{
  104|    953|	struct radius_msg *msg;
  105|       |
  106|    953|	msg = os_zalloc(sizeof(*msg));
  107|    953|	if (msg == NULL)
  ------------------
  |  Branch (107:6): [True: 0, False: 953]
  ------------------
  108|      0|		return NULL;
  109|       |
  110|    953|	msg->buf = wpabuf_alloc(RADIUS_DEFAULT_MSG_SIZE);
  ------------------
  |  |  250|    953|#define RADIUS_DEFAULT_MSG_SIZE 1024
  ------------------
  111|    953|	if (msg->buf == NULL || radius_msg_initialize(msg)) {
  ------------------
  |  Branch (111:6): [True: 0, False: 953]
  |  Branch (111:26): [True: 0, False: 953]
  ------------------
  112|      0|		radius_msg_free(msg);
  113|      0|		return NULL;
  114|      0|	}
  115|    953|	msg->hdr = wpabuf_put(msg->buf, sizeof(struct radius_hdr));
  116|       |
  117|    953|	radius_msg_set_hdr(msg, code, identifier);
  118|       |
  119|    953|	return msg;
  120|    953|}
radius_msg_free:
  128|  1.87k|{
  129|  1.87k|	if (msg == NULL)
  ------------------
  |  Branch (129:6): [True: 0, False: 1.87k]
  ------------------
  130|      0|		return;
  131|       |
  132|  1.87k|	wpabuf_free(msg->buf);
  133|  1.87k|	os_free(msg->attr_pos);
  ------------------
  |  |  511|  1.87k|#define os_free(p) free((p))
  ------------------
  134|  1.87k|	os_free(msg);
  ------------------
  |  |  511|  1.87k|#define os_free(p) free((p))
  ------------------
  135|  1.87k|}
radius_msg_dump:
  412|    870|{
  413|    870|	size_t i;
  414|       |
  415|    870|	wpa_printf(MSG_INFO, "RADIUS message: code=%d (%s) identifier=%d length=%d",
  416|    870|		   msg->hdr->code, radius_code_string(msg->hdr->code),
  417|    870|		   msg->hdr->identifier, be_to_host16(msg->hdr->length));
  ------------------
  |  |  177|    870|#define be_to_host16(n) bswap_16((__force u16) (be16) (n))
  ------------------
  418|       |
  419|   172k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (419:14): [True: 171k, False: 870]
  ------------------
  420|   171k|		struct radius_attr_hdr *attr = radius_get_attr_hdr(msg, i);
  421|   171k|		radius_msg_dump_attr(attr);
  422|   171k|	}
  423|    870|}
radius_msg_add_msg_auth:
  427|    953|{
  428|    953|	u8 auth[MD5_MAC_LEN];
  429|    953|	struct radius_attr_hdr *attr;
  430|       |
  431|    953|	os_memset(auth, 0, MD5_MAC_LEN);
  ------------------
  |  |  529|    953|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
  432|    953|	attr = radius_msg_add_attr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
  433|    953|				   auth, MD5_MAC_LEN);
  ------------------
  |  |   12|    953|#define MD5_MAC_LEN 16
  ------------------
  434|    953|	if (!attr) {
  ------------------
  |  Branch (434:6): [True: 0, False: 953]
  ------------------
  435|      0|		wpa_printf(MSG_ERROR,
  436|      0|			   "WARNING: Could not add Message-Authenticator");
  437|      0|		return NULL;
  438|      0|	}
  439|       |
  440|    953|	return (u8 *) (attr + 1);
  441|    953|}
radius_msg_finish:
  463|    953|{
  464|    953|	if (secret) {
  ------------------
  |  Branch (464:6): [True: 953, False: 0]
  ------------------
  465|    953|		u8 *pos;
  466|       |
  467|    953|		pos = radius_msg_auth_pos(msg);
  468|    953|		if (!pos)
  ------------------
  |  Branch (468:7): [True: 0, False: 953]
  ------------------
  469|      0|			return -1;
  470|    953|		msg->hdr->length = host_to_be16(wpabuf_len(msg->buf));
  ------------------
  |  |  178|    953|#define host_to_be16(n) ((__force be16) bswap_16((n)))
  ------------------
  471|    953|		if (hmac_md5(secret, secret_len, wpabuf_head(msg->buf),
  ------------------
  |  Branch (471:7): [True: 0, False: 953]
  ------------------
  472|    953|			     wpabuf_len(msg->buf), pos) < 0) {
  473|      0|			wpa_printf(MSG_INFO, "RADIUS: MD5 not available");
  474|      0|			return -1;
  475|      0|		}
  476|    953|	} 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|    953|	if (wpabuf_len(msg->buf) > 0xffff) {
  ------------------
  |  Branch (479:6): [True: 0, False: 953]
  ------------------
  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|    953|	return 0;
  485|    953|}
radius_msg_add_attr:
  747|    953|{
  748|    953|	size_t buf_needed, max_len;
  749|    953|	struct radius_attr_hdr *attr = NULL;
  750|    953|	struct radius_attr_hdr_ext *ext;
  751|    953|	u8 ext_type = 0;
  752|       |
  753|    953|	if (TEST_FAIL())
  ------------------
  |  |  727|    953|#define TEST_FAIL() testing_test_fail(NULL, false)
  |  |  ------------------
  |  |  |  Branch (727:21): [True: 0, False: 953]
  |  |  ------------------
  ------------------
  754|      0|		return NULL;
  755|       |
  756|    953|	if (type > 255) {
  ------------------
  |  Branch (756:6): [True: 0, False: 953]
  ------------------
  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|    953|	} else if (radius_is_ext_type(type)) {
  ------------------
  |  Branch (765:13): [True: 0, False: 953]
  ------------------
  766|      0|		wpa_printf(MSG_ERROR, "%s: Unexpected extended type use for %d",
  767|      0|			   __func__, type);
  768|      0|	}
  769|       |
  770|    953|	if (radius_is_long_ext_type(type)) {
  ------------------
  |  Branch (770:6): [True: 0, False: 953]
  ------------------
  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|    953|	} else if (radius_is_ext_type(type)) {
  ------------------
  |  Branch (780:13): [True: 0, False: 953]
  ------------------
  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|    953|	} else {
  784|    953|		max_len = RADIUS_MAX_ATTR_LEN;
  ------------------
  |  |   56|    953|#define RADIUS_MAX_ATTR_LEN (255 - sizeof(struct radius_attr_hdr))
  ------------------
  785|    953|		buf_needed = sizeof(*attr) + data_len;
  786|    953|	}
  787|    953|	if (data_len > max_len) {
  ------------------
  |  Branch (787:6): [True: 0, False: 953]
  ------------------
  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|    953|	if (wpabuf_tailroom(msg->buf) < buf_needed) {
  ------------------
  |  Branch (794:6): [True: 0, False: 953]
  ------------------
  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|    953|	if (radius_is_long_ext_type(type)) {
  ------------------
  |  Branch (801:6): [True: 0, False: 953]
  ------------------
  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|    953|	} else if (radius_is_ext_type(type)) {
  ------------------
  |  Branch (822:13): [True: 0, False: 953]
  ------------------
  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|    953|	} else {
  832|    953|		attr = wpabuf_put(msg->buf, sizeof(struct radius_attr_hdr));
  833|    953|		attr->type = type;
  834|    953|		attr->length = sizeof(*attr) + data_len;
  835|    953|		wpabuf_put_data(msg->buf, data, data_len);
  836|    953|		if (radius_msg_add_attr_to_array(msg, attr))
  ------------------
  |  Branch (836:7): [True: 0, False: 953]
  ------------------
  837|      0|			return NULL;
  838|    953|	}
  839|       |
  840|    953|	return attr;
  841|    953|}
radius_msg_parse:
  854|    953|{
  855|    953|	struct radius_msg *msg;
  856|    953|	struct radius_hdr *hdr;
  857|    953|	struct radius_attr_hdr *attr;
  858|    953|	size_t msg_len;
  859|    953|	unsigned char *pos, *end;
  860|       |
  861|    953|	if (data == NULL || len < sizeof(*hdr))
  ------------------
  |  Branch (861:6): [True: 0, False: 953]
  |  Branch (861:22): [True: 9, False: 944]
  ------------------
  862|      9|		return NULL;
  863|       |
  864|    944|	hdr = (struct radius_hdr *) data;
  865|       |
  866|    944|	msg_len = be_to_host16(hdr->length);
  ------------------
  |  |  177|    944|#define be_to_host16(n) bswap_16((__force u16) (be16) (n))
  ------------------
  867|    944|	if (msg_len < sizeof(*hdr) || msg_len > len) {
  ------------------
  |  Branch (867:6): [True: 5, False: 939]
  |  Branch (867:32): [True: 16, False: 923]
  ------------------
  868|     21|		wpa_printf(MSG_INFO, "RADIUS: Invalid message length");
  869|     21|		return NULL;
  870|     21|	}
  871|       |
  872|    923|	if (msg_len < len) {
  ------------------
  |  Branch (872:6): [True: 60, False: 863]
  ------------------
  873|     60|		wpa_printf(MSG_DEBUG, "RADIUS: Ignored %lu extra bytes after "
  874|     60|			   "RADIUS message", (unsigned long) len - msg_len);
  875|     60|	}
  876|       |
  877|    923|	msg = os_zalloc(sizeof(*msg));
  878|    923|	if (msg == NULL)
  ------------------
  |  Branch (878:6): [True: 0, False: 923]
  ------------------
  879|      0|		return NULL;
  880|       |
  881|    923|	msg->buf = wpabuf_alloc_copy(data, msg_len);
  882|    923|	if (msg->buf == NULL || radius_msg_initialize(msg)) {
  ------------------
  |  Branch (882:6): [True: 0, False: 923]
  |  Branch (882:26): [True: 0, False: 923]
  ------------------
  883|      0|		radius_msg_free(msg);
  884|      0|		return NULL;
  885|      0|	}
  886|    923|	msg->hdr = wpabuf_mhead(msg->buf);
  887|       |
  888|       |	/* parse attributes */
  889|    923|	pos = wpabuf_mhead_u8(msg->buf) + sizeof(struct radius_hdr);
  890|    923|	end = wpabuf_mhead_u8(msg->buf) + wpabuf_len(msg->buf);
  891|   210k|	while (pos < end) {
  ------------------
  |  Branch (891:9): [True: 209k, False: 870]
  ------------------
  892|   209k|		if ((size_t) (end - pos) < sizeof(*attr))
  ------------------
  |  Branch (892:7): [True: 11, False: 209k]
  ------------------
  893|     11|			goto fail;
  894|       |
  895|   209k|		attr = (struct radius_attr_hdr *) pos;
  896|       |
  897|   209k|		if (attr->length > end - pos || attr->length < sizeof(*attr))
  ------------------
  |  Branch (897:7): [True: 12, False: 209k]
  |  Branch (897:35): [True: 30, False: 209k]
  ------------------
  898|     42|			goto fail;
  899|       |
  900|       |		/* TODO: check that attr->length is suitable for attr->type */
  901|       |
  902|   209k|		if (radius_msg_add_attr_to_array(msg, attr))
  ------------------
  |  Branch (902:7): [True: 0, False: 209k]
  ------------------
  903|      0|			goto fail;
  904|       |
  905|   209k|		pos += attr->length;
  906|   209k|	}
  907|       |
  908|    870|	return msg;
  909|       |
  910|     53| fail:
  911|     53|	radius_msg_free(msg);
  912|       |	return NULL;
  913|    923|}
radius_msg_get_eap:
  941|    870|{
  942|    870|	struct wpabuf *eap;
  943|    870|	size_t len, i;
  944|    870|	struct radius_attr_hdr *attr;
  945|       |
  946|    870|	if (msg == NULL)
  ------------------
  |  Branch (946:6): [True: 0, False: 870]
  ------------------
  947|      0|		return NULL;
  948|       |
  949|    870|	len = 0;
  950|   172k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (950:14): [True: 171k, False: 870]
  ------------------
  951|   171k|		attr = radius_get_attr_hdr(msg, i);
  952|   171k|		if (attr->type == RADIUS_ATTR_EAP_MESSAGE &&
  ------------------
  |  Branch (952:7): [True: 5.25k, False: 166k]
  ------------------
  953|  5.25k|		    attr->length > sizeof(struct radius_attr_hdr))
  ------------------
  |  Branch (953:7): [True: 4.16k, False: 1.09k]
  ------------------
  954|  4.16k|			len += attr->length - sizeof(struct radius_attr_hdr);
  955|   171k|	}
  956|       |
  957|    870|	if (len == 0)
  ------------------
  |  Branch (957:6): [True: 759, False: 111]
  ------------------
  958|    759|		return NULL;
  959|       |
  960|    111|	eap = wpabuf_alloc(len);
  961|    111|	if (eap == NULL)
  ------------------
  |  Branch (961:6): [True: 0, False: 111]
  ------------------
  962|      0|		return NULL;
  963|       |
  964|   139k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (964:14): [True: 139k, False: 111]
  ------------------
  965|   139k|		attr = radius_get_attr_hdr(msg, i);
  966|   139k|		if (attr->type == RADIUS_ATTR_EAP_MESSAGE &&
  ------------------
  |  Branch (966:7): [True: 5.18k, False: 134k]
  ------------------
  967|  5.18k|		    attr->length > sizeof(struct radius_attr_hdr)) {
  ------------------
  |  Branch (967:7): [True: 4.16k, False: 1.02k]
  ------------------
  968|  4.16k|			int flen = attr->length - sizeof(*attr);
  969|  4.16k|			wpabuf_put_data(eap, attr + 1, flen);
  970|  4.16k|		}
  971|   139k|	}
  972|       |
  973|    111|	return eap;
  974|    111|}
radius_msg_get_attr:
 1595|    870|{
 1596|    870|	struct radius_attr_hdr *attr = NULL, *tmp;
 1597|    870|	size_t i, dlen;
 1598|       |
 1599|  95.7k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1599:14): [True: 94.9k, False: 795]
  ------------------
 1600|  94.9k|		tmp = radius_get_attr_hdr(msg, i);
 1601|  94.9k|		if (tmp->type == type) {
  ------------------
  |  Branch (1601:7): [True: 75, False: 94.8k]
  ------------------
 1602|     75|			attr = tmp;
 1603|     75|			break;
 1604|     75|		}
 1605|  94.9k|	}
 1606|       |
 1607|    870|	if (!attr || attr->length < sizeof(*attr))
  ------------------
  |  Branch (1607:6): [True: 795, False: 75]
  |  Branch (1607:15): [True: 0, False: 75]
  ------------------
 1608|    795|		return -1;
 1609|       |
 1610|     75|	dlen = attr->length - sizeof(*attr);
 1611|     75|	if (buf)
  ------------------
  |  Branch (1611:6): [True: 75, False: 0]
  ------------------
 1612|     75|		os_memcpy(buf, (attr + 1), dlen > len ? len : dlen);
  ------------------
  |  |  523|    150|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  |  |  ------------------
  |  |  |  Branch (523:46): [True: 27, False: 48]
  |  |  ------------------
  ------------------
 1613|     75|	return dlen;
 1614|    870|}
radius_msg_get_attr_ptr:
 1619|    953|{
 1620|    953|	size_t i;
 1621|    953|	struct radius_attr_hdr *attr = NULL, *tmp;
 1622|       |
 1623|    953|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1623:14): [True: 0, False: 953]
  ------------------
 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|    953|	if (!attr || attr->length < sizeof(*attr))
  ------------------
  |  Branch (1632:6): [True: 953, False: 0]
  |  Branch (1632:15): [True: 0, False: 0]
  ------------------
 1633|    953|		return -1;
 1634|       |
 1635|      0|	*buf = (u8 *) (attr + 1);
 1636|      0|	*len = attr->length - sizeof(*attr);
 1637|      0|	return 0;
 1638|    953|}
radius_msg_get_vlanid:
 1689|    870|{
 1690|    870|	struct radius_tunnel_attrs tunnel[RADIUS_TUNNEL_TAGS], *tun;
 1691|    870|	size_t i;
 1692|    870|	struct radius_attr_hdr *attr = NULL;
 1693|    870|	const u8 *data;
 1694|    870|	char buf[10];
 1695|    870|	size_t dlen;
 1696|    870|	int j, taggedidx = 0, vlan_id;
 1697|       |
 1698|    870|	os_memset(&tunnel, 0, sizeof(tunnel));
  ------------------
  |  |  529|    870|#define os_memset(s, c, n) memset(s, c, n)
  ------------------
 1699|  5.22k|	for (j = 0; j < numtagged; j++)
  ------------------
  |  Branch (1699:14): [True: 4.35k, False: 870]
  ------------------
 1700|  4.35k|		tagged[j] = 0;
 1701|    870|	*untagged = 0;
 1702|       |
 1703|   172k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1703:14): [True: 171k, False: 870]
  ------------------
 1704|   171k|		attr = radius_get_attr_hdr(msg, i);
 1705|   171k|		if (attr->length < sizeof(*attr))
  ------------------
  |  Branch (1705:7): [True: 0, False: 171k]
  ------------------
 1706|      0|			return -1;
 1707|   171k|		data = (const u8 *) (attr + 1);
 1708|   171k|		dlen = attr->length - sizeof(*attr);
 1709|   171k|		if (attr->length < 3)
  ------------------
  |  Branch (1709:7): [True: 120k, False: 51.7k]
  ------------------
 1710|   120k|			continue;
 1711|  51.7k|		if (data[0] >= RADIUS_TUNNEL_TAGS)
  ------------------
  |  |  182|  51.7k|#define RADIUS_TUNNEL_TAGS 32
  ------------------
  |  Branch (1711:7): [True: 35.9k, False: 15.7k]
  ------------------
 1712|  35.9k|			tun = &tunnel[0];
 1713|  15.7k|		else
 1714|  15.7k|			tun = &tunnel[data[0]];
 1715|       |
 1716|  51.7k|		switch (attr->type) {
  ------------------
  |  Branch (1716:11): [True: 30.7k, False: 20.9k]
  ------------------
 1717|  1.33k|		case RADIUS_ATTR_TUNNEL_TYPE:
  ------------------
  |  Branch (1717:3): [True: 1.33k, False: 50.3k]
  ------------------
 1718|  1.33k|			if (attr->length != 6)
  ------------------
  |  Branch (1718:8): [True: 357, False: 976]
  ------------------
 1719|    357|				break;
 1720|    976|			tun->tag_used++;
 1721|    976|			tun->type = WPA_GET_BE24(data + 1);
 1722|    976|			break;
 1723|  1.02k|		case RADIUS_ATTR_TUNNEL_MEDIUM_TYPE:
  ------------------
  |  Branch (1723:3): [True: 1.02k, False: 50.6k]
  ------------------
 1724|  1.02k|			if (attr->length != 6)
  ------------------
  |  Branch (1724:8): [True: 401, False: 621]
  ------------------
 1725|    401|				break;
 1726|    621|			tun->tag_used++;
 1727|    621|			tun->medium_type = WPA_GET_BE24(data + 1);
 1728|    621|			break;
 1729|  25.1k|		case RADIUS_ATTR_TUNNEL_PRIVATE_GROUP_ID:
  ------------------
  |  Branch (1729:3): [True: 25.1k, False: 26.5k]
  ------------------
 1730|  25.1k|			if (data[0] < RADIUS_TUNNEL_TAGS) {
  ------------------
  |  |  182|  25.1k|#define RADIUS_TUNNEL_TAGS 32
  ------------------
  |  Branch (1730:8): [True: 1.44k, False: 23.7k]
  ------------------
 1731|  1.44k|				data++;
 1732|  1.44k|				dlen--;
 1733|  1.44k|			}
 1734|  25.1k|			if (dlen >= sizeof(buf))
  ------------------
  |  Branch (1734:8): [True: 533, False: 24.6k]
  ------------------
 1735|    533|				break;
 1736|  24.6k|			os_memcpy(buf, data, dlen);
  ------------------
  |  |  523|  24.6k|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
 1737|  24.6k|			buf[dlen] = '\0';
 1738|  24.6k|			vlan_id = atoi(buf);
 1739|  24.6k|			if (vlan_id <= 0)
  ------------------
  |  Branch (1739:8): [True: 2.73k, False: 21.8k]
  ------------------
 1740|  2.73k|				break;
 1741|  21.8k|			tun->tag_used++;
 1742|  21.8k|			tun->vlanid = vlan_id;
 1743|  21.8k|			break;
 1744|  3.28k|		case RADIUS_ATTR_EGRESS_VLANID: /* RFC 4675 */
  ------------------
  |  Branch (1744:3): [True: 3.28k, False: 48.4k]
  ------------------
 1745|  3.28k|			if (attr->length != 6)
  ------------------
  |  Branch (1745:8): [True: 505, False: 2.77k]
  ------------------
 1746|    505|				break;
 1747|  2.77k|			vlan_id = WPA_GET_BE24(data + 1);
 1748|  2.77k|			if (vlan_id <= 0)
  ------------------
  |  Branch (1748:8): [True: 518, False: 2.26k]
  ------------------
 1749|    518|				break;
 1750|  2.26k|			if (data[0] == 0x32)
  ------------------
  |  Branch (1750:8): [True: 422, False: 1.83k]
  ------------------
 1751|    422|				*untagged = vlan_id;
 1752|  1.83k|			else if (data[0] == 0x31 && tagged &&
  ------------------
  |  Branch (1752:13): [True: 932, False: 907]
  |  Branch (1752:32): [True: 932, False: 0]
  ------------------
 1753|    932|				 taggedidx < numtagged)
  ------------------
  |  Branch (1753:6): [True: 118, False: 814]
  ------------------
 1754|    118|				tagged[taggedidx++] = vlan_id;
 1755|  2.26k|			break;
 1756|  51.7k|		}
 1757|  51.7k|	}
 1758|       |
 1759|       |	/* Use tunnel with the lowest tag for untagged VLAN id */
 1760|  27.6k|	for (i = 0; i < RADIUS_TUNNEL_TAGS; i++) {
  ------------------
  |  |  182|  27.6k|#define RADIUS_TUNNEL_TAGS 32
  ------------------
  |  Branch (1760:14): [True: 26.8k, False: 837]
  ------------------
 1761|  26.8k|		tun = &tunnel[i];
 1762|  26.8k|		if (tun->tag_used &&
  ------------------
  |  Branch (1762:7): [True: 304, False: 26.5k]
  ------------------
 1763|    304|		    tun->type == RADIUS_TUNNEL_TYPE_VLAN &&
  ------------------
  |  |  189|  27.1k|#define RADIUS_TUNNEL_TYPE_VLAN 13
  ------------------
  |  Branch (1763:7): [True: 89, False: 215]
  ------------------
 1764|     89|		    tun->medium_type == RADIUS_TUNNEL_MEDIUM_TYPE_802 &&
  ------------------
  |  |  194|  26.9k|#define RADIUS_TUNNEL_MEDIUM_TYPE_802 6
  ------------------
  |  Branch (1764:7): [True: 43, False: 46]
  ------------------
 1765|     43|		    tun->vlanid > 0) {
  ------------------
  |  Branch (1765:7): [True: 33, False: 10]
  ------------------
 1766|     33|			*untagged = tun->vlanid;
 1767|     33|			break;
 1768|     33|		}
 1769|  26.8k|	}
 1770|       |
 1771|    870|	if (taggedidx)
  ------------------
  |  Branch (1771:6): [True: 30, False: 840]
  ------------------
 1772|     30|		qsort(tagged, taggedidx, sizeof(int), cmp_int);
 1773|       |
 1774|    870|	if (*untagged > 0 || taggedidx)
  ------------------
  |  Branch (1774:6): [True: 81, False: 789]
  |  Branch (1774:23): [True: 17, False: 772]
  ------------------
 1775|     98|		return 1;
 1776|    772|	return 0;
 1777|    870|}
radius_msg_get_tunnel_password:
 1793|    870|{
 1794|    870|	u8 *buf = NULL;
 1795|    870|	size_t buflen;
 1796|    870|	const u8 *salt;
 1797|    870|	u8 *str;
 1798|    870|	const u8 *addr[3];
 1799|    870|	size_t len[3];
 1800|    870|	u8 hash[16];
 1801|    870|	u8 *pos;
 1802|    870|	size_t i, j = 0;
 1803|    870|	struct radius_attr_hdr *attr;
 1804|    870|	const u8 *data;
 1805|    870|	size_t dlen;
 1806|    870|	const u8 *fdata = NULL; /* points to found item */
 1807|    870|	size_t fdlen = -1;
 1808|    870|	char *ret = NULL;
 1809|       |
 1810|       |	/* find n-th valid Tunnel-Password attribute */
 1811|   150k|	for (i = 0; i < msg->attr_used; i++) {
  ------------------
  |  Branch (1811:14): [True: 149k, False: 837]
  ------------------
 1812|   149k|		attr = radius_get_attr_hdr(msg, i);
 1813|   149k|		if (attr == NULL ||
  ------------------
  |  Branch (1813:7): [True: 0, False: 149k]
  ------------------
 1814|   149k|		    attr->type != RADIUS_ATTR_TUNNEL_PASSWORD) {
  ------------------
  |  Branch (1814:7): [True: 148k, False: 1.36k]
  ------------------
 1815|   148k|			continue;
 1816|   148k|		}
 1817|  1.36k|		if (attr->length <= 5)
  ------------------
  |  Branch (1817:7): [True: 821, False: 543]
  ------------------
 1818|    821|			continue;
 1819|    543|		data = (const u8 *) (attr + 1);
 1820|    543|		dlen = attr->length - sizeof(*attr);
 1821|    543|		if (dlen <= 3 || dlen % 16 != 3)
  ------------------
  |  Branch (1821:7): [True: 0, False: 543]
  |  Branch (1821:20): [True: 476, False: 67]
  ------------------
 1822|    476|			continue;
 1823|     67|		j++;
 1824|     67|		if (j <= n)
  ------------------
  |  Branch (1824:7): [True: 34, False: 33]
  ------------------
 1825|     34|			continue;
 1826|       |
 1827|     33|		fdata = data;
 1828|     33|		fdlen = dlen;
 1829|     33|		break;
 1830|     67|	}
 1831|    870|	if (fdata == NULL)
  ------------------
  |  Branch (1831:6): [True: 837, False: 33]
  ------------------
 1832|    837|		goto out;
 1833|       |
 1834|       |	/* alloc writable memory for decryption */
 1835|     33|	buf = os_memdup(fdata, fdlen);
 1836|     33|	if (buf == NULL)
  ------------------
  |  Branch (1836:6): [True: 0, False: 33]
  ------------------
 1837|      0|		goto out;
 1838|     33|	buflen = fdlen;
 1839|       |
 1840|       |	/* init pointers */
 1841|     33|	salt = buf + 1;
 1842|     33|	str = buf + 3;
 1843|       |
 1844|       |	/* decrypt blocks */
 1845|     33|	pos = buf + buflen - 16; /* last block */
 1846|    170|	while (pos >= str + 16) { /* all but the first block */
  ------------------
  |  Branch (1846:9): [True: 137, False: 33]
  ------------------
 1847|    137|		addr[0] = secret;
 1848|    137|		len[0] = secret_len;
 1849|    137|		addr[1] = pos - 16;
 1850|    137|		len[1] = 16;
 1851|    137|		if (md5_vector(2, addr, len, hash) < 0) {
  ------------------
  |  Branch (1851:7): [True: 0, False: 137]
  ------------------
 1852|      0|			wpa_printf(MSG_INFO, "RADIUS: MD5 not available");
 1853|      0|			goto out;
 1854|      0|		}
 1855|       |
 1856|  2.32k|		for (i = 0; i < 16; i++)
  ------------------
  |  Branch (1856:15): [True: 2.19k, False: 137]
  ------------------
 1857|  2.19k|			pos[i] ^= hash[i];
 1858|       |
 1859|    137|		pos -= 16;
 1860|    137|	}
 1861|       |
 1862|       |	/* decrypt first block */
 1863|     33|	if (str != pos)
  ------------------
  |  Branch (1863:6): [True: 0, False: 33]
  ------------------
 1864|      0|		goto out;
 1865|     33|	addr[0] = secret;
 1866|     33|	len[0] = secret_len;
 1867|     33|	addr[1] = sent_msg->hdr->authenticator;
 1868|     33|	len[1] = 16;
 1869|     33|	addr[2] = salt;
 1870|     33|	len[2] = 2;
 1871|     33|	if (md5_vector(3, addr, len, hash) < 0) {
  ------------------
  |  Branch (1871:6): [True: 0, False: 33]
  ------------------
 1872|      0|		wpa_printf(MSG_INFO, "RADIUS: MD5 not available");
 1873|      0|		goto out;
 1874|      0|	}
 1875|       |
 1876|    561|	for (i = 0; i < 16; i++)
  ------------------
  |  Branch (1876:14): [True: 528, False: 33]
  ------------------
 1877|    528|		pos[i] ^= hash[i];
 1878|       |
 1879|       |	/* derive plaintext length from first subfield */
 1880|     33|	*keylen = (unsigned char) str[0];
 1881|     33|	if ((u8 *) (str + *keylen) >= (u8 *) (buf + buflen)) {
  ------------------
  |  Branch (1881:6): [True: 19, False: 14]
  ------------------
 1882|       |		/* decryption error - invalid key length */
 1883|     19|		goto out;
 1884|     19|	}
 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|    870|out:
 1896|       |	/* return new buffer */
 1897|    870|	os_free(buf);
  ------------------
  |  |  511|    870|#define os_free(p) free((p))
  ------------------
 1898|    870|	return ret;
 1899|     13|}
radius.c:radius_msg_initialize:
   80|  1.87k|{
   81|  1.87k|	msg->attr_pos = os_calloc(RADIUS_DEFAULT_ATTR_COUNT,
  ------------------
  |  |  253|  1.87k|#define RADIUS_DEFAULT_ATTR_COUNT 16
  ------------------
   82|  1.87k|				  sizeof(*msg->attr_pos));
   83|  1.87k|	if (msg->attr_pos == NULL)
  ------------------
  |  Branch (83:6): [True: 0, False: 1.87k]
  ------------------
   84|      0|		return -1;
   85|       |
   86|  1.87k|	msg->attr_size = RADIUS_DEFAULT_ATTR_COUNT;
  ------------------
  |  |  253|  1.87k|#define RADIUS_DEFAULT_ATTR_COUNT 16
  ------------------
   87|  1.87k|	msg->attr_used = 0;
   88|       |
   89|  1.87k|	return 0;
   90|  1.87k|}
radius.c:radius_msg_set_hdr:
   73|    953|{
   74|    953|	msg->hdr->code = code;
   75|    953|	msg->hdr->identifier = identifier;
   76|    953|}
radius.c:radius_code_string:
  139|    870|{
  140|    870|	switch (code) {
  141|     51|	case RADIUS_CODE_ACCESS_REQUEST: return "Access-Request";
  ------------------
  |  Branch (141:2): [True: 51, False: 819]
  ------------------
  142|     70|	case RADIUS_CODE_ACCESS_ACCEPT: return "Access-Accept";
  ------------------
  |  Branch (142:2): [True: 70, False: 800]
  ------------------
  143|     26|	case RADIUS_CODE_ACCESS_REJECT: return "Access-Reject";
  ------------------
  |  Branch (143:2): [True: 26, False: 844]
  ------------------
  144|     19|	case RADIUS_CODE_ACCOUNTING_REQUEST: return "Accounting-Request";
  ------------------
  |  Branch (144:2): [True: 19, False: 851]
  ------------------
  145|     29|	case RADIUS_CODE_ACCOUNTING_RESPONSE: return "Accounting-Response";
  ------------------
  |  Branch (145:2): [True: 29, False: 841]
  ------------------
  146|     21|	case RADIUS_CODE_ACCESS_CHALLENGE: return "Access-Challenge";
  ------------------
  |  Branch (146:2): [True: 21, False: 849]
  ------------------
  147|     25|	case RADIUS_CODE_STATUS_SERVER: return "Status-Server";
  ------------------
  |  Branch (147:2): [True: 25, False: 845]
  ------------------
  148|     36|	case RADIUS_CODE_STATUS_CLIENT: return "Status-Client";
  ------------------
  |  Branch (148:2): [True: 36, False: 834]
  ------------------
  149|     38|	case RADIUS_CODE_RESERVED: return "Reserved";
  ------------------
  |  Branch (149:2): [True: 38, False: 832]
  ------------------
  150|     14|	case RADIUS_CODE_DISCONNECT_REQUEST: return "Disconnect-Request";
  ------------------
  |  Branch (150:2): [True: 14, False: 856]
  ------------------
  151|     32|	case RADIUS_CODE_DISCONNECT_ACK: return "Disconnect-ACK";
  ------------------
  |  Branch (151:2): [True: 32, False: 838]
  ------------------
  152|     36|	case RADIUS_CODE_DISCONNECT_NAK: return "Disconnect-NAK";
  ------------------
  |  Branch (152:2): [True: 36, False: 834]
  ------------------
  153|     21|	case RADIUS_CODE_COA_REQUEST: return "CoA-Request";
  ------------------
  |  Branch (153:2): [True: 21, False: 849]
  ------------------
  154|     20|	case RADIUS_CODE_COA_ACK: return "CoA-ACK";
  ------------------
  |  Branch (154:2): [True: 20, False: 850]
  ------------------
  155|     16|	case RADIUS_CODE_COA_NAK: return "CoA-NAK";
  ------------------
  |  Branch (155:2): [True: 16, False: 854]
  ------------------
  156|    416|	default: return "?Unknown?";
  ------------------
  |  Branch (156:2): [True: 416, False: 454]
  ------------------
  157|    870|	}
  158|    870|}
radius.c:radius_get_attr_hdr:
   66|   900k|{
   67|   900k|	return (struct radius_attr_hdr *)
   68|   900k|		(wpabuf_mhead_u8(msg->buf) + msg->attr_pos[idx]);
   69|   900k|}
radius.c:radius_msg_dump_attr:
  317|   171k|{
  318|   171k|	struct radius_attr_hdr_ext *ext = NULL;
  319|   171k|	const struct radius_attr_type *attr;
  320|   171k|	int len;
  321|   171k|	unsigned char *pos;
  322|   171k|	char buf[1000];
  323|       |
  324|   171k|	if (hdr->length < sizeof(struct radius_attr_hdr))
  ------------------
  |  Branch (324:6): [True: 0, False: 171k]
  ------------------
  325|      0|		return;
  326|       |
  327|   171k|	if (radius_is_ext_type(hdr->type)) {
  ------------------
  |  Branch (327:6): [True: 1.81k, False: 169k]
  ------------------
  328|  1.81k|		if (hdr->length < 4) {
  ------------------
  |  Branch (328:7): [True: 840, False: 978]
  ------------------
  329|    840|			wpa_printf(MSG_INFO,
  330|    840|				   "   Invalid attribute %d (too short for extended type)",
  331|    840|				hdr->type);
  332|    840|			return;
  333|    840|		}
  334|       |
  335|    978|		ext = (struct radius_attr_hdr_ext *) hdr;
  336|    978|	}
  337|       |
  338|   170k|	if (ext) {
  ------------------
  |  Branch (338:6): [True: 978, False: 169k]
  ------------------
  339|    978|		attr = radius_get_attr_type((ext->type << 8) | ext->ext_type);
  340|    978|		wpa_printf(MSG_INFO, "   Attribute %d.%d (%s) length=%d",
  341|    978|			   ext->type, ext->ext_type,
  342|    978|			   attr ? attr->name : "?Unknown?", ext->length);
  ------------------
  |  Branch (342:7): [True: 602, False: 376]
  ------------------
  343|    978|		pos = (unsigned char *) (ext + 1);
  344|    978|		len = ext->length - sizeof(struct radius_attr_hdr_ext);
  345|   169k|	} else {
  346|   169k|		attr = radius_get_attr_type(hdr->type);
  347|   169k|		wpa_printf(MSG_INFO, "   Attribute %d (%s) length=%d",
  348|   169k|			   hdr->type, attr ? attr->name : "?Unknown?",
  ------------------
  |  Branch (348:18): [True: 156k, False: 13.2k]
  ------------------
  349|   169k|			   hdr->length);
  350|   169k|		pos = (unsigned char *) (hdr + 1);
  351|   169k|		len = hdr->length - sizeof(struct radius_attr_hdr);
  352|   169k|	}
  353|       |
  354|   170k|	if (!attr)
  ------------------
  |  Branch (354:6): [True: 13.6k, False: 157k]
  ------------------
  355|  13.6k|		return;
  356|       |
  357|   157k|	switch (attr->data_type) {
  358|  2.50k|	case RADIUS_ATTR_TEXT:
  ------------------
  |  Branch (358:2): [True: 2.50k, False: 154k]
  ------------------
  359|  2.50k|		printf_encode(buf, sizeof(buf), pos, len);
  360|  2.50k|		wpa_printf(MSG_INFO, "      Value: '%s'", buf);
  361|  2.50k|		break;
  362|       |
  363|  1.57k|	case RADIUS_ATTR_IP:
  ------------------
  |  Branch (363:2): [True: 1.57k, False: 155k]
  ------------------
  364|  1.57k|		if (len == 4) {
  ------------------
  |  Branch (364:7): [True: 388, False: 1.18k]
  ------------------
  365|    388|			struct in_addr addr;
  366|    388|			os_memcpy(&addr, pos, 4);
  ------------------
  |  |  523|    388|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  367|    388|			wpa_printf(MSG_INFO, "      Value: %s",
  368|    388|				   inet_ntoa(addr));
  369|  1.18k|		} else {
  370|  1.18k|			wpa_printf(MSG_INFO, "      Invalid IP address length %d",
  371|  1.18k|				   len);
  372|  1.18k|		}
  373|  1.57k|		break;
  374|       |
  375|      0|#ifdef CONFIG_IPV6
  376|  18.4k|	case RADIUS_ATTR_IPV6:
  ------------------
  |  Branch (376:2): [True: 18.4k, False: 138k]
  ------------------
  377|  18.4k|		if (len == 16) {
  ------------------
  |  Branch (377:7): [True: 395, False: 18.0k]
  ------------------
  378|    395|			const char *atxt;
  379|    395|			struct in6_addr *addr = (struct in6_addr *) pos;
  380|    395|			atxt = inet_ntop(AF_INET6, addr, buf, sizeof(buf));
  381|    395|			wpa_printf(MSG_INFO, "      Value: %s",
  382|    395|				   atxt ? atxt : "?");
  ------------------
  |  Branch (382:8): [True: 395, False: 0]
  ------------------
  383|  18.0k|		} else {
  384|  18.0k|			wpa_printf(MSG_INFO, "      Invalid IPv6 address length %d",
  385|  18.0k|				   len);
  386|  18.0k|		}
  387|  18.4k|		break;
  388|      0|#endif /* CONFIG_IPV6 */
  389|       |
  390|  31.6k|	case RADIUS_ATTR_HEXDUMP:
  ------------------
  |  Branch (390:2): [True: 31.6k, False: 125k]
  ------------------
  391|   131k|	case RADIUS_ATTR_UNDIST:
  ------------------
  |  Branch (391:2): [True: 99.6k, False: 57.6k]
  ------------------
  392|   131k|		wpa_snprintf_hex(buf, sizeof(buf), pos, len);
  393|   131k|		wpa_printf(MSG_INFO, "      Value: %s", buf);
  394|   131k|		break;
  395|       |
  396|  3.45k|	case RADIUS_ATTR_INT32:
  ------------------
  |  Branch (396:2): [True: 3.45k, False: 153k]
  ------------------
  397|  3.45k|		if (len == 4)
  ------------------
  |  Branch (397:7): [True: 901, False: 2.55k]
  ------------------
  398|    901|			wpa_printf(MSG_INFO, "      Value: %u",
  399|    901|				   WPA_GET_BE32(pos));
  400|  2.55k|		else
  401|  2.55k|			wpa_printf(MSG_INFO, "      Invalid INT32 length %d",
  402|  2.55k|				   len);
  403|  3.45k|		break;
  404|       |
  405|      0|	default:
  ------------------
  |  Branch (405:2): [True: 0, False: 157k]
  ------------------
  406|      0|		break;
  407|   157k|	}
  408|   157k|}
radius.c:radius_get_attr_type:
  290|   170k|{
  291|   170k|	size_t i;
  292|       |
  293|  3.81M|	for (i = 0; i < RADIUS_ATTRS; i++) {
  ------------------
  |  |  286|  3.81M|#define RADIUS_ATTRS ARRAY_SIZE(radius_attrs)
  |  |  ------------------
  |  |  |  |  607|  3.81M|#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
  |  |  ------------------
  ------------------
  |  Branch (293:14): [True: 3.80M, False: 13.6k]
  ------------------
  294|  3.80M|		if (type == radius_attrs[i].type)
  ------------------
  |  Branch (294:7): [True: 157k, False: 3.64M]
  ------------------
  295|   157k|			return &radius_attrs[i];
  296|  3.80M|	}
  297|       |
  298|  13.6k|	return NULL;
  299|   170k|}
radius.c:radius_msg_auth_pos:
  445|    953|{
  446|    953|	u8 *pos;
  447|    953|	size_t alen;
  448|       |
  449|    953|	if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_MESSAGE_AUTHENTICATOR,
  ------------------
  |  Branch (449:6): [True: 0, False: 953]
  ------------------
  450|    953|				    &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|    953|	return radius_msg_add_msg_auth(msg);
  458|    953|}
radius.c:radius_is_ext_type:
  310|   174k|{
  311|   174k|	return type >= RADIUS_ATTR_EXT_TYPE_1 &&
  ------------------
  |  Branch (311:9): [True: 2.26k, False: 172k]
  ------------------
  312|  2.26k|		type <= RADIUS_ATTR_LONG_EXT_TYPE_2;
  ------------------
  |  Branch (312:3): [True: 1.81k, False: 443]
  ------------------
  313|   174k|}
radius.c:radius_is_long_ext_type:
  303|  1.90k|{
  304|  1.90k|	return type == RADIUS_ATTR_LONG_EXT_TYPE_1 ||
  ------------------
  |  Branch (304:9): [True: 0, False: 1.90k]
  ------------------
  305|  1.90k|		type == RADIUS_ATTR_LONG_EXT_TYPE_2;
  ------------------
  |  Branch (305:3): [True: 0, False: 1.90k]
  ------------------
  306|  1.90k|}
radius.c:radius_msg_add_attr_to_array:
  724|   210k|{
  725|   210k|	if (msg->attr_used >= msg->attr_size) {
  ------------------
  |  Branch (725:6): [True: 652, False: 209k]
  ------------------
  726|    652|		size_t *nattr_pos;
  727|    652|		size_t nlen = msg->attr_size * 2;
  728|       |
  729|    652|		nattr_pos = os_realloc_array(msg->attr_pos, nlen,
  730|    652|					     sizeof(*msg->attr_pos));
  731|    652|		if (nattr_pos == NULL)
  ------------------
  |  Branch (731:7): [True: 0, False: 652]
  ------------------
  732|      0|			return -1;
  733|       |
  734|    652|		msg->attr_pos = nattr_pos;
  735|    652|		msg->attr_size = nlen;
  736|    652|	}
  737|       |
  738|   210k|	msg->attr_pos[msg->attr_used++] =
  739|   210k|		(unsigned char *) attr - wpabuf_head_u8(msg->buf);
  740|       |
  741|   210k|	return 0;
  742|   210k|}
radius.c:cmp_int:
 1666|    139|{
 1667|    139|	int x, y;
 1668|       |
 1669|    139|	x = *((int *) a);
 1670|    139|	y = *((int *) b);
 1671|    139|	return (x - y);
 1672|    139|}

wpa_snprintf_hex:
  347|   131k|{
  348|   131k|	return _wpa_snprintf_hex(buf, buf_size, data, len, 0);
  349|   131k|}
printf_encode:
  478|  2.50k|{
  479|  2.50k|	char *end = txt + maxlen;
  480|  2.50k|	size_t i;
  481|       |
  482|  81.4k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (482:14): [True: 79.1k, False: 2.30k]
  ------------------
  483|  79.1k|		if (txt + 4 >= end)
  ------------------
  |  Branch (483:7): [True: 203, False: 78.9k]
  ------------------
  484|    203|			break;
  485|       |
  486|  78.9k|		switch (data[i]) {
  487|  1.36k|		case '\"':
  ------------------
  |  Branch (487:3): [True: 1.36k, False: 77.6k]
  ------------------
  488|  1.36k|			*txt++ = '\\';
  489|  1.36k|			*txt++ = '\"';
  490|  1.36k|			break;
  491|    201|		case '\\':
  ------------------
  |  Branch (491:3): [True: 201, False: 78.7k]
  ------------------
  492|    201|			*txt++ = '\\';
  493|    201|			*txt++ = '\\';
  494|    201|			break;
  495|    502|		case '\033':
  ------------------
  |  Branch (495:3): [True: 502, False: 78.4k]
  ------------------
  496|    502|			*txt++ = '\\';
  497|    502|			*txt++ = 'e';
  498|    502|			break;
  499|    514|		case '\n':
  ------------------
  |  Branch (499:3): [True: 514, False: 78.4k]
  ------------------
  500|    514|			*txt++ = '\\';
  501|    514|			*txt++ = 'n';
  502|    514|			break;
  503|    678|		case '\r':
  ------------------
  |  Branch (503:3): [True: 678, False: 78.3k]
  ------------------
  504|    678|			*txt++ = '\\';
  505|    678|			*txt++ = 'r';
  506|    678|			break;
  507|    236|		case '\t':
  ------------------
  |  Branch (507:3): [True: 236, False: 78.7k]
  ------------------
  508|    236|			*txt++ = '\\';
  509|    236|			*txt++ = 't';
  510|    236|			break;
  511|  75.4k|		default:
  ------------------
  |  Branch (511:3): [True: 75.4k, False: 3.49k]
  ------------------
  512|  75.4k|			if (data[i] >= 32 && data[i] <= 126) {
  ------------------
  |  Branch (512:8): [True: 9.52k, False: 65.9k]
  |  Branch (512:25): [True: 4.84k, False: 4.68k]
  ------------------
  513|  4.84k|				*txt++ = data[i];
  514|  70.6k|			} else {
  515|  70.6k|				txt += os_snprintf(txt, end - txt, "\\x%02x",
  ------------------
  |  |  572|  70.6k|#define os_snprintf snprintf
  ------------------
  516|  70.6k|						   data[i]);
  517|  70.6k|			}
  518|  75.4k|			break;
  519|  78.9k|		}
  520|  78.9k|	}
  521|       |
  522|  2.50k|	*txt = '\0';
  523|  2.50k|}
__hide_aliasing_typecast:
  637|  4.15k|{
  638|  4.15k|	return foo;
  639|  4.15k|}
common.c:_wpa_snprintf_hex:
  319|   131k|{
  320|   131k|	size_t i;
  321|   131k|	char *pos = buf, *end = buf + buf_size;
  322|   131k|	int ret;
  323|   131k|	if (buf_size == 0)
  ------------------
  |  Branch (323:6): [True: 0, False: 131k]
  ------------------
  324|      0|		return 0;
  325|   459k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (325:14): [True: 328k, False: 131k]
  ------------------
  326|   328k|		ret = os_snprintf(pos, end - pos, uppercase ? "%02X" : "%02x",
  ------------------
  |  |  572|   328k|#define os_snprintf snprintf
  ------------------
  |  Branch (326:37): [True: 0, False: 328k]
  ------------------
  327|   328k|				  data[i]);
  328|   328k|		if (os_snprintf_error(end - pos, ret)) {
  ------------------
  |  Branch (328:7): [True: 0, False: 328k]
  ------------------
  329|      0|			end[-1] = '\0';
  330|      0|			return pos - buf;
  331|      0|		}
  332|   328k|		pos += ret;
  333|   328k|	}
  334|   131k|	end[-1] = '\0';
  335|   131k|	return pos - buf;
  336|   131k|}

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

radius.c:testing_test_fail:
  736|    953|{
  737|    953|	return 0;
  738|    953|}
radius.c:os_realloc_array:
  625|    652|{
  626|    652|	if (size && nmemb > (~(size_t) 0) / size)
  ------------------
  |  Branch (626:6): [True: 652, False: 0]
  |  Branch (626:14): [True: 0, False: 652]
  ------------------
  627|      0|		return NULL;
  628|    652|	return os_realloc(ptr, nmemb * size);
  ------------------
  |  |  508|    652|#define os_realloc(p, s) realloc((p), (s))
  ------------------
  629|    652|}
radius.c:os_calloc:
  298|  1.87k|{
  299|  1.87k|	if (size && nmemb > (~(size_t) 0) / size)
  ------------------
  |  Branch (299:6): [True: 1.87k, False: 0]
  |  Branch (299:14): [True: 0, False: 1.87k]
  ------------------
  300|      0|		return NULL;
  301|  1.87k|	return os_zalloc(nmemb * size);
  302|  1.87k|}
md5-internal.c:testing_test_fail:
  736|  2.07k|{
  737|  2.07k|	return 0;
  738|  2.07k|}
common.c:os_snprintf_error:
  580|   328k|{
  581|   328k|	return res < 0 || (unsigned int) res >= size;
  ------------------
  |  Branch (581:9): [True: 0, False: 328k]
  |  Branch (581:20): [True: 0, False: 328k]
  ------------------
  582|   328k|}

os_get_random:
  280|    953|{
  281|    953|#ifdef TEST_FUZZ
  282|    953|	size_t i;
  283|       |
  284|  4.76k|	for (i = 0; i < len; i++)
  ------------------
  |  Branch (284:14): [True: 3.81k, False: 953]
  ------------------
  285|  3.81k|		buf[i] = i & 0xff;
  286|    953|	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|    953|}
os_program_init:
  361|    953|{
  362|    953|	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|    953|	if (os_get_random((unsigned char *) &seed, sizeof(seed)) == 0)
  ------------------
  |  Branch (392:6): [True: 953, False: 0]
  ------------------
  393|    953|		srandom(seed);
  394|       |
  395|    953|	return 0;
  396|    953|}
os_program_deinit:
  400|    953|{
  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|    953|}
os_zalloc:
  507|  5.73k|{
  508|  5.73k|	return calloc(1, size);
  509|  5.73k|}
os_memdup:
  553|     33|{
  554|     33|	void *r = os_malloc(len);
  ------------------
  |  |  505|     33|#define os_malloc(s) malloc((s))
  ------------------
  555|       |
  556|     33|	if (r && src)
  ------------------
  |  Branch (556:6): [True: 33, False: 0]
  |  Branch (556:11): [True: 33, False: 0]
  ------------------
  557|     33|		os_memcpy(r, src, len);
  ------------------
  |  |  523|     33|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  558|     33|	return r;
  559|     33|}

wpa_printf:
  224|   329k|{
  225|   329k|	va_list ap;
  226|       |
  227|   329k|	if (level >= wpa_debug_level) {
  ------------------
  |  Branch (227:6): [True: 0, False: 329k]
  ------------------
  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|   329k|}
wpa_hexdump:
  400|    870|{
  401|    870|	_wpa_hexdump(level, title, buf, len, 1, 0);
  402|    870|}
wpa_debug.c:_wpa_hexdump:
  274|    870|{
  275|    870|	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|    870|	if (level < wpa_debug_level)
  ------------------
  |  Branch (295:6): [True: 870, False: 0]
  ------------------
  296|    870|		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|    870|{
  123|    870|	wpa_hexdump(level, title, buf ? wpabuf_head(buf) : NULL,
  ------------------
  |  Branch (123:28): [True: 111, False: 759]
  ------------------
  124|    870|		    buf ? wpabuf_len(buf) : 0);
  ------------------
  |  Branch (124:7): [True: 111, False: 759]
  ------------------
  125|    870|}

wpabuf_alloc:
  114|  1.98k|{
  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|  1.98k|	struct wpabuf *buf = os_zalloc(sizeof(struct wpabuf) + len);
  125|  1.98k|	if (buf == NULL)
  ------------------
  |  Branch (125:6): [True: 0, False: 1.98k]
  ------------------
  126|      0|		return NULL;
  127|  1.98k|#endif /* WPA_TRACE */
  128|       |
  129|  1.98k|	buf->size = len;
  130|  1.98k|	buf->buf = (u8 *) (buf + 1);
  131|  1.98k|	return buf;
  132|  1.98k|}
wpabuf_alloc_copy:
  161|    923|{
  162|    923|	struct wpabuf *buf = wpabuf_alloc(len);
  163|    923|	if (buf)
  ------------------
  |  Branch (163:6): [True: 923, False: 0]
  ------------------
  164|    923|		wpabuf_put_data(buf, data, len);
  165|    923|	return buf;
  166|    923|}
wpabuf_free:
  187|  2.74k|{
  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.74k|	if (buf == NULL)
  ------------------
  |  Branch (203:6): [True: 759, False: 1.98k]
  ------------------
  204|    759|		return;
  205|  1.98k|	if (buf->flags & WPABUF_FLAG_EXT_DATA)
  ------------------
  |  |   13|  1.98k|#define WPABUF_FLAG_EXT_DATA BIT(0)
  |  |  ------------------
  |  |  |  |  458|  1.98k|#define BIT(x) (1U << (x))
  |  |  ------------------
  ------------------
  |  Branch (205:6): [True: 0, False: 1.98k]
  ------------------
  206|      0|		os_free(buf->buf);
  ------------------
  |  |  511|      0|#define os_free(p) free((p))
  ------------------
  207|  1.98k|	os_free(buf);
  ------------------
  |  |  511|  1.98k|#define os_free(p) free((p))
  ------------------
  208|  1.98k|#endif /* WPA_TRACE */
  209|  1.98k|}
wpabuf_put:
  222|  7.94k|{
  223|  7.94k|	void *tmp = wpabuf_mhead_u8(buf) + wpabuf_len(buf);
  224|  7.94k|	buf->used += len;
  225|  7.94k|	if (buf->used > buf->size) {
  ------------------
  |  Branch (225:6): [True: 0, False: 7.94k]
  ------------------
  226|      0|		wpabuf_overflow(buf, len);
  227|      0|	}
  228|  7.94k|	return tmp;
  229|  7.94k|}

radius.c:wpabuf_len:
   59|  3.89k|{
   60|  3.89k|	return buf->used;
   61|  3.89k|}
radius.c:wpabuf_head:
   94|   211k|{
   95|   211k|	return buf->buf;
   96|   211k|}
radius.c:wpabuf_head_u8:
   99|   210k|{
  100|   210k|	return (const u8 *) wpabuf_head(buf);
  101|   210k|}
radius.c:wpabuf_tailroom:
   69|    953|{
   70|    953|	return buf->size - buf->used;
   71|    953|}
radius.c:wpabuf_mhead:
  109|   902k|{
  110|   902k|	return buf->buf;
  111|   902k|}
radius.c:wpabuf_put_data:
  174|  5.11k|{
  175|  5.11k|	if (data)
  ------------------
  |  Branch (175:6): [True: 5.11k, False: 0]
  ------------------
  176|  5.11k|		os_memcpy(wpabuf_put(buf, len), data, len);
  ------------------
  |  |  523|  5.11k|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  177|  5.11k|}
radius.c:wpabuf_mhead_u8:
  114|   901k|{
  115|   901k|	return (u8 *) wpabuf_mhead(buf);
  116|   901k|}
wpabuf.c:wpabuf_put_data:
  174|    923|{
  175|    923|	if (data)
  ------------------
  |  Branch (175:6): [True: 923, False: 0]
  ------------------
  176|    923|		os_memcpy(wpabuf_put(buf, len), data, len);
  ------------------
  |  |  523|    923|#define os_memcpy(d, s, n) memcpy((d), (s), (n))
  ------------------
  177|    923|}
wpabuf.c:wpabuf_len:
   59|  7.94k|{
   60|  7.94k|	return buf->used;
   61|  7.94k|}
wpabuf.c:wpabuf_mhead:
  109|  7.94k|{
  110|  7.94k|	return buf->buf;
  111|  7.94k|}
wpabuf.c:wpabuf_mhead_u8:
  114|  7.94k|{
  115|  7.94k|	return (u8 *) wpabuf_mhead(buf);
  116|  7.94k|}

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

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

