crypto/rsa/rsa_oaep.c:197: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`.
Showing all 7 steps of the trace


crypto/rsa/rsa_oaep.c:197:32: Call
195.   		goto cleanup;
196.   
197.   	good &= constant_time_is_zero(CRYPTO_memcmp(db, phash, mdlen));
                                      ^
198.   
199.   	found_one_byte = 0;

crypto/cryptlib.c:406:2: Assignment
  404.   	const unsigned char *a = in_a;
  405.   	const unsigned char *b = in_b;
  406.   	unsigned char x = 0;
          ^
  407.   
  408.   	for (i = 0; i < len; i++)

crypto/cryptlib.c:411:2: Assignment
  409.   		x |= a[i] ^ b[i];
  410.   
  411.   	return x;
          ^
  412.   	}

crypto/rsa/rsa_oaep.c:197:10: Call
195.   		goto cleanup;
196.   
197.   	good &= constant_time_is_zero(CRYPTO_memcmp(db, phash, mdlen));
                ^
198.   
199.   	found_one_byte = 0;

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 `constant_time_is_zero` 
  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));
	}
['int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,\n\tconst unsigned char *from, int flen, int num,\n\tconst unsigned char *param, int plen,\n\tconst EVP_MD *md, const EVP_MD *mgf1md)\n\t{\n\tint i, dblen, mlen = -1, one_index = 0, msg_index;\n\tunsigned int good, found_one_byte;\n\tconst unsigned char *maskedseed, *maskeddb;\n\tunsigned char *db = NULL, *em = NULL, seed[EVP_MAX_MD_SIZE],\n\t\tphash[EVP_MAX_MD_SIZE];\n\tint mdlen;\n\tif (md == NULL)\n\t\tmd = EVP_sha1();\n\tif (mgf1md == NULL)\n\t\tmgf1md = md;\n\tmdlen = EVP_MD_size(md);\n        if (tlen <= 0 || flen <= 0)\n\t\treturn -1;\n\tif (num < flen || num < 2 * mdlen + 2)\n\t\tgoto decoding_err;\n\tdblen = num - mdlen - 1;\n\tdb = OPENSSL_malloc(dblen);\n\tem = OPENSSL_malloc(num);\n\tif (db == NULL || em == NULL)\n\t\t{\n\t\tRSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1, ERR_R_MALLOC_FAILURE);\n\t\tgoto cleanup;\n\t\t}\n\tmemset(em, 0, num);\n\tmemcpy(em + num - flen, from, flen);\n\tgood = constant_time_is_zero(em[0]);\n\tmaskedseed = em + 1;\n\tmaskeddb = em + 1 + mdlen;\n\tif (PKCS1_MGF1(seed, mdlen, maskeddb, dblen, mgf1md))\n\t\tgoto cleanup;\n\tfor (i = 0; i < mdlen; i++)\n\t\tseed[i] ^= maskedseed[i];\n\tif (PKCS1_MGF1(db, dblen, seed, mdlen, mgf1md))\n\t\tgoto cleanup;\n\tfor (i = 0; i < dblen; i++)\n\t\tdb[i] ^= maskeddb[i];\n\tif (!EVP_Digest((void *)param, plen, phash, NULL, md, NULL))\n\t\tgoto cleanup;\n\tgood &= constant_time_is_zero(CRYPTO_memcmp(db, phash, mdlen));\n\tfound_one_byte = 0;\n\tfor (i = mdlen; i < dblen; i++)\n\t\t{\n\t\tunsigned int equals1 = constant_time_eq(db[i], 1);\n\t\tunsigned int equals0 = constant_time_is_zero(db[i]);\n\t\tone_index = constant_time_select_int(~found_one_byte & equals1,\n\t\t\ti, one_index);\n\t\tfound_one_byte |= equals1;\n\t\tgood &= (found_one_byte | equals0);\n\t\t}\n\tgood &= found_one_byte;\n\tif (!good)\n\t\tgoto decoding_err;\n\tmsg_index = one_index + 1;\n\tmlen = dblen - msg_index;\n\tif (tlen < mlen)\n\t\t{\n\t\tRSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1, RSA_R_DATA_TOO_LARGE);\n\t\tmlen = -1;\n\t\t}\n\telse\n\t\t{\n\t\tmemcpy(to, db + msg_index, mlen);\n\t\tgoto cleanup;\n\t\t}\ndecoding_err:\n\tRSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1, RSA_R_OAEP_DECODING_ERROR);\ncleanup:\n\tif (db != NULL) OPENSSL_free(db);\n\tif (em != NULL) OPENSSL_free(em);\n\treturn mlen;\n\t}', 'int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)\n\t{\n\tsize_t i;\n\tconst unsigned char *a = in_a;\n\tconst unsigned char *b = in_b;\n\tunsigned char x = 0;\n\tfor (i = 0; i < len; i++)\n\t\tx |= a[i] ^ b[i];\n\treturn x;\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}']