crypto/pkcs12/p12_decr.c:101: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `EVP_CipherFinal_ex`.
Showing all 14 steps of the trace


crypto/pkcs12/p12_decr.c:92:7: Call
90.   	}
91.   
92.   	if (!EVP_CipherUpdate(&ctx, out, &i, in, inlen))
            ^
93.   		{
94.   		OPENSSL_free(out);

crypto/evp/evp_enc.c:257:10: Call
  255.   	{
  256.   	if (ctx->encrypt)
  257.   		return EVP_EncryptUpdate(ctx,out,outl,in,inl);
                  ^
  258.   	else	return EVP_DecryptUpdate(ctx,out,outl,in,inl);
  259.   	}

crypto/evp/evp_enc.c:299:1: Parameter `*in`
    297.   	}
    298.   
    299. > int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
    300.   	     const unsigned char *in, int inl)
    301.   	{

crypto/pkcs12/p12_decr.c:101:6: Call
99.   
100.   	outlen = i;
101.   	if(!EVP_CipherFinal_ex(&ctx, out + i, &i)) {
            ^
102.   		OPENSSL_free(out);
103.   		out = NULL;

crypto/evp/evp_enc.c:261:1: Parameter `ctx->final[*]`
  259.   	}
  260.   
  261. > int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
  262.   	{
  263.   	if (ctx->encrypt)

crypto/evp/evp_enc.c:265:14: Call
  263.   	if (ctx->encrypt)
  264.   		return EVP_EncryptFinal_ex(ctx,out,outl);
  265.   	else	return EVP_DecryptFinal_ex(ctx,out,outl);
                      ^
  266.   	}
  267.   

crypto/evp/evp_enc.c:493:1: Parameter `ctx->final[*]`
    491.   	}
    492.   
    493. > int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
    494.   	{
    495.   	unsigned int i, b;

crypto/evp/evp_enc.c:528:3: Assignment
    526.   			}
    527.   		OPENSSL_assert(b <= sizeof ctx->final);
    528.   		pad=ctx->final[b-1];
             ^
    529.   
    530.   		padding_good = (unsigned char)(~constant_time_is_zero_8(pad));

crypto/evp/evp_enc.c:530:35: Call
    528.   		pad=ctx->final[b-1];
    529.   
    530.   		padding_good = (unsigned char)(~constant_time_is_zero_8(pad));
                                             ^
    531.   		padding_good &= constant_time_ge_8(b, pad);
    532.   

crypto/constant_time_locl.h:170:1: Parameter `a`
      168.   	}
      169.   
      170. > static inline unsigned char constant_time_is_zero_8(unsigned int a)
      171.   	{
      172.   	return (unsigned char)(constant_time_is_zero(a));

crypto/constant_time_locl.h:172:25: Call
      170.   static inline unsigned char constant_time_is_zero_8(unsigned int a)
      171.   	{
      172.   	return (unsigned char)(constant_time_is_zero(a));
                                     ^
      173.   	}
      174.   

crypto/constant_time_locl.h:165:1: <LHS trace>
163.   	}
164.   
165. > static inline unsigned int constant_time_is_zero(unsigned int a)
166.   	{
167.   	return constant_time_msb(~a & (a - 1));

crypto/constant_time_locl.h:165:1: Parameter `a`
        163.   	}
        164.   
        165. > static inline unsigned int constant_time_is_zero(unsigned int a)
        166.   	{
        167.   	return constant_time_msb(~a & (a - 1));

crypto/constant_time_locl.h:167:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `EVP_CipherFinal_ex` 
        165.   static inline unsigned int constant_time_is_zero(unsigned int a)
        166.   	{
        167.   	return constant_time_msb(~a & (a - 1));
                       ^
        168.   	}
        169.   

static inline unsigned int constant_time_is_zero(unsigned int a)
	{
	return constant_time_msb(~a & (a - 1));
	}
['unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,\n\t     int passlen, unsigned char *in, int inlen, unsigned char **data,\n\t     int *datalen, int en_de)\n{\n\tunsigned char *out;\n\tint outlen, i;\n\tEVP_CIPHER_CTX ctx;\n\tEVP_CIPHER_CTX_init(&ctx);\n        if (!EVP_PBE_CipherInit(algor->algorithm, pass, passlen,\n\t\t\t\t\t algor->parameter, &ctx, en_de)) {\n\t\tPKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR);\n\t\treturn NULL;\n\t}\n\tif(!(out = OPENSSL_malloc(inlen + EVP_CIPHER_CTX_block_size(&ctx)))) {\n\t\tPKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_MALLOC_FAILURE);\n\t\tgoto err;\n\t}\n\tif (!EVP_CipherUpdate(&ctx, out, &i, in, inlen))\n\t\t{\n\t\tOPENSSL_free(out);\n\t\tout = NULL;\n\t\tPKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_EVP_LIB);\n\t\tgoto err;\n\t\t}\n\toutlen = i;\n\tif(!EVP_CipherFinal_ex(&ctx, out + i, &i)) {\n\t\tOPENSSL_free(out);\n\t\tout = NULL;\n\t\tPKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_CIPHERFINAL_ERROR);\n\t\tgoto err;\n\t}\n\toutlen += i;\n\tif (datalen) *datalen = outlen;\n\tif (data) *data = out;\n\terr:\n\tEVP_CIPHER_CTX_cleanup(&ctx);\n\treturn out;\n}', 'int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n\t     const unsigned char *in, int inl)\n\t{\n\tif (ctx->encrypt)\n\t\treturn EVP_EncryptUpdate(ctx,out,outl,in,inl);\n\telse\treturn EVP_DecryptUpdate(ctx,out,outl,in,inl);\n\t}', 'int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n\t     const unsigned char *in, int inl)\n\t{\n\tint i,j,bl;\n\tif (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER)\n\t\t{\n\t\ti = ctx->cipher->do_cipher(ctx, out, in, inl);\n\t\tif (i < 0)\n\t\t\treturn 0;\n\t\telse\n\t\t\t*outl = i;\n\t\treturn 1;\n\t\t}\n\tif (inl <= 0)\n\t\t{\n\t\t*outl = 0;\n\t\treturn inl == 0;\n\t\t}\n\tif(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)\n\t\t{\n\t\tif(ctx->cipher->do_cipher(ctx,out,in,inl))\n\t\t\t{\n\t\t\t*outl=inl;\n\t\t\treturn 1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t*outl=0;\n\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\ti=ctx->buf_len;\n\tbl=ctx->cipher->block_size;\n\tOPENSSL_assert(bl <= (int)sizeof(ctx->buf));\n\tif (i != 0)\n\t\t{\n\t\tif (i+inl < bl)\n\t\t\t{\n\t\t\tmemcpy(&(ctx->buf[i]),in,inl);\n\t\t\tctx->buf_len+=inl;\n\t\t\t*outl=0;\n\t\t\treturn 1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tj=bl-i;\n\t\t\tmemcpy(&(ctx->buf[i]),in,j);\n\t\t\tif(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0;\n\t\t\tinl-=j;\n\t\t\tin+=j;\n\t\t\tout+=bl;\n\t\t\t*outl=bl;\n\t\t\t}\n\t\t}\n\telse\n\t\t*outl = 0;\n\ti=inl&(bl-1);\n\tinl-=i;\n\tif (inl > 0)\n\t\t{\n\t\tif(!ctx->cipher->do_cipher(ctx,out,in,inl)) return 0;\n\t\t*outl+=inl;\n\t\t}\n\tif (i != 0)\n\t\tmemcpy(ctx->buf,&(in[inl]),i);\n\tctx->buf_len=i;\n\treturn 1;\n\t}', 'int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)\n\t{\n\tif (ctx->encrypt)\n\t\treturn EVP_EncryptFinal_ex(ctx,out,outl);\n\telse\treturn EVP_DecryptFinal_ex(ctx,out,outl);\n\t}', 'int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)\n\t{\n\tunsigned int i, b;\n        unsigned char pad, padding_good;\n\t*outl=0;\n\tif (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER)\n\t\t{\n\t\tint ret = ctx->cipher->do_cipher(ctx, out, NULL, 0);\n\t\tif (ret < 0)\n\t\t\treturn 0;\n\t\telse\n\t\t\t*outl = ret;\n\t\treturn 1;\n\t\t}\n\tb=(unsigned int)(ctx->cipher->block_size);\n\tif (ctx->flags & EVP_CIPH_NO_PADDING)\n\t\t{\n\t\tif(ctx->buf_len)\n\t\t\t{\n\t\t\tEVPerr(EVP_F_EVP_DECRYPTFINAL_EX,EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH);\n\t\t\treturn 0;\n\t\t\t}\n\t\t*outl = 0;\n\t\treturn 1;\n\t\t}\n\tif (b > 1)\n\t\t{\n\t\tif (ctx->buf_len || !ctx->final_used)\n\t\t\t{\n\t\t\tEVPerr(EVP_F_EVP_DECRYPTFINAL_EX,EVP_R_WRONG_FINAL_BLOCK_LENGTH);\n\t\t\treturn(0);\n\t\t\t}\n\t\tOPENSSL_assert(b <= sizeof ctx->final);\n\t\tpad=ctx->final[b-1];\n\t\tpadding_good = (unsigned char)(~constant_time_is_zero_8(pad));\n\t\tpadding_good &= constant_time_ge_8(b, pad);\n                for (i = 1; i < b; ++i)\n\t\t\t{\n\t\t\tunsigned char is_pad_index = constant_time_lt_8(i, pad);\n\t\t\tunsigned char pad_byte_good = constant_time_eq_8(ctx->final[b-i-1], pad);\n\t\t\tpadding_good &= constant_time_select_8(is_pad_index, pad_byte_good, 0xff);\n\t\t\t}\n\t\tfor (i = 0; i < b - 1; ++i)\n\t\t\tout[i] = ctx->final[i] & padding_good;\n\t\t*outl = padding_good & ((unsigned char)(b - pad));\n\t\treturn padding_good & 1;\n\t\t}\n\telse\n\t\t{\n\t\t*outl = 0;\n\t\treturn 1;\n\t\t}\n\t}', 'static inline unsigned char constant_time_is_zero_8(unsigned int a)\n\t{\n\treturn (unsigned char)(constant_time_is_zero(a));\n\t}', 'static inline unsigned int constant_time_is_zero(unsigned int a)\n\t{\n\treturn constant_time_msb(~a & (a - 1));\n\t}']