crypto/evp/e_aes.c:2558: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [0, 15]):unsigned64.
Showing all 5 steps of the trace


crypto/evp/e_aes.c:2471:1: <LHS trace>
2469.   	}
2470.   
2471. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2472.   		const unsigned char *in, size_t len)
2473.   	{

crypto/evp/e_aes.c:2471:1: Parameter `len`
2469.   	}
2470.   
2471. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2472.   		const unsigned char *in, size_t len)
2473.   	{

crypto/evp/e_aes.c:2471:1: <RHS trace>
2469.   	}
2470.   
2471. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2472.   		const unsigned char *in, size_t len)
2473.   	{

crypto/evp/e_aes.c:2471:1: Parameter `len`
2469.   	}
2470.   
2471. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2472.   		const unsigned char *in, size_t len)
2473.   	{

crypto/evp/e_aes.c:2558:9: Binary operation: ([0, +oo] - [0, 15]):unsigned64
2556.   			else if (ctx->encrypt)
2557.   				{
2558.   				if(!CRYPTO_ocb128_encrypt(&octx->ocb, in, out, len-trailing_len))
                ^
2559.   					return -1;
2560.   				}

static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
		const unsigned char *in, size_t len)
	{
	unsigned char *buf;
	int *buf_len;
	int written_len = 0;
	size_t trailing_len;
	EVP_AES_OCB_CTX *octx = ctx->cipher_data;
	if (!octx->iv_set)
		return -1;
	if (!octx->key_set)
		return -1;
	if (in)
		{
		if (out == NULL)
			{
			buf = octx->aad_buf;
			buf_len = &(octx->aad_buf_len);
			}
		else
			{
			buf = octx->data_buf;
			buf_len = &(octx->data_buf_len);
			}
		if(*buf_len)
			{
			unsigned int remaining;
			remaining = 16 - (*buf_len);
			if(remaining > len)
				{
				memcpy(buf+(*buf_len), in, len);
				*(buf_len)+=len;
				return 0;
				}
			memcpy(buf+(*buf_len), in, remaining);
			len -= remaining;
			in += remaining;
			if (out == NULL)
				{
				if(!CRYPTO_ocb128_aad(&octx->ocb, buf, 16))
					return -1;
				}
			else if (ctx->encrypt)
				{
				if(!CRYPTO_ocb128_encrypt(&octx->ocb, buf, out, 16))
					return -1;
				}
			else
				{
				if(!CRYPTO_ocb128_decrypt(&octx->ocb, buf, out, 16))
					return -1;
				}
			written_len = 16;
			*buf_len = 0;
			}
		trailing_len = len % 16;
		if(len != trailing_len)
			{
			if (out == NULL)
				{
				if(!CRYPTO_ocb128_aad(&octx->ocb, in, len-trailing_len))
					return -1;
				}
			else if (ctx->encrypt)
				{
				if(!CRYPTO_ocb128_encrypt(&octx->ocb, in, out, len-trailing_len))
					return -1;
				}
			else
				{
				if(!CRYPTO_ocb128_decrypt(&octx->ocb, in, out, len-trailing_len))
					return -1;
				}
			written_len += len-trailing_len;
			in += len-trailing_len;
			}
		if(trailing_len)
			{
			memcpy(buf, in, trailing_len);
			*buf_len = trailing_len;
			}
		return written_len;
		}
	else
		{
		if(octx->data_buf_len)
			{
			if (ctx->encrypt)
				{
				if(!CRYPTO_ocb128_encrypt(&octx->ocb, octx->data_buf, out,
						octx->data_buf_len))
					return -1;
				}
			else
				{
				if(!CRYPTO_ocb128_decrypt(&octx->ocb, octx->data_buf, out,
						octx->data_buf_len))
					return -1;
				}
			written_len = octx->data_buf_len;
			octx->data_buf_len = 0;
			}
		if(octx->aad_buf_len)
			{
			if(!CRYPTO_ocb128_aad(&octx->ocb, octx->aad_buf, octx->aad_buf_len))
				return -1;
			octx->aad_buf_len = 0;
			}
		if (!ctx->encrypt)
			{
			if (octx->taglen < 0)
				return -1;
			if (CRYPTO_ocb128_finish(&octx->ocb,
					octx->tag, octx->taglen) != 0)
				return -1;
			octx->iv_set = 0;
			return written_len;
			}
		if(CRYPTO_ocb128_tag(&octx->ocb, octx->tag, 16) != 1)
			return -1;
		octx->iv_set = 0;
		return written_len;
		}
	}
['static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,\n\t\tconst unsigned char *in, size_t len)\n\t{\n\tunsigned char *buf;\n\tint *buf_len;\n\tint written_len = 0;\n\tsize_t trailing_len;\n\tEVP_AES_OCB_CTX *octx = ctx->cipher_data;\n\tif (!octx->iv_set)\n\t\treturn -1;\n\tif (!octx->key_set)\n\t\treturn -1;\n\tif (in)\n\t\t{\n\t\tif (out == NULL)\n\t\t\t{\n\t\t\tbuf = octx->aad_buf;\n\t\t\tbuf_len = &(octx->aad_buf_len);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tbuf = octx->data_buf;\n\t\t\tbuf_len = &(octx->data_buf_len);\n\t\t\t}\n\t\tif(*buf_len)\n\t\t\t{\n\t\t\tunsigned int remaining;\n\t\t\tremaining = 16 - (*buf_len);\n\t\t\tif(remaining > len)\n\t\t\t\t{\n\t\t\t\tmemcpy(buf+(*buf_len), in, len);\n\t\t\t\t*(buf_len)+=len;\n\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\tmemcpy(buf+(*buf_len), in, remaining);\n\t\t\tlen -= remaining;\n\t\t\tin += remaining;\n\t\t\tif (out == NULL)\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_aad(&octx->ocb, buf, 16))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\telse if (ctx->encrypt)\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_encrypt(&octx->ocb, buf, out, 16))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_decrypt(&octx->ocb, buf, out, 16))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\twritten_len = 16;\n\t\t\t*buf_len = 0;\n\t\t\t}\n\t\ttrailing_len = len % 16;\n\t\tif(len != trailing_len)\n\t\t\t{\n\t\t\tif (out == NULL)\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_aad(&octx->ocb, in, len-trailing_len))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\telse if (ctx->encrypt)\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_encrypt(&octx->ocb, in, out, len-trailing_len))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_decrypt(&octx->ocb, in, out, len-trailing_len))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\twritten_len += len-trailing_len;\n\t\t\tin += len-trailing_len;\n\t\t\t}\n\t\tif(trailing_len)\n\t\t\t{\n\t\t\tmemcpy(buf, in, trailing_len);\n\t\t\t*buf_len = trailing_len;\n\t\t\t}\n\t\treturn written_len;\n\t\t}\n\telse\n\t\t{\n\t\tif(octx->data_buf_len)\n\t\t\t{\n\t\t\tif (ctx->encrypt)\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_encrypt(&octx->ocb, octx->data_buf, out,\n\t\t\t\t\t\toctx->data_buf_len))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tif(!CRYPTO_ocb128_decrypt(&octx->ocb, octx->data_buf, out,\n\t\t\t\t\t\toctx->data_buf_len))\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\twritten_len = octx->data_buf_len;\n\t\t\toctx->data_buf_len = 0;\n\t\t\t}\n\t\tif(octx->aad_buf_len)\n\t\t\t{\n\t\t\tif(!CRYPTO_ocb128_aad(&octx->ocb, octx->aad_buf, octx->aad_buf_len))\n\t\t\t\treturn -1;\n\t\t\toctx->aad_buf_len = 0;\n\t\t\t}\n\t\tif (!ctx->encrypt)\n\t\t\t{\n\t\t\tif (octx->taglen < 0)\n\t\t\t\treturn -1;\n\t\t\tif (CRYPTO_ocb128_finish(&octx->ocb,\n\t\t\t\t\toctx->tag, octx->taglen) != 0)\n\t\t\t\treturn -1;\n\t\t\toctx->iv_set = 0;\n\t\t\treturn written_len;\n\t\t\t}\n\t\tif(CRYPTO_ocb128_tag(&octx->ocb, octx->tag, 16) != 1)\n\t\t\treturn -1;\n\t\toctx->iv_set = 0;\n\t\treturn written_len;\n\t\t}\n\t}']