apps/apps.c:2536: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `JPAKE_STEP3B_process`.
Showing all 10 steps of the trace


apps/apps.c:2536:6: Call
2534.   	l = BIO_read(bconn, s3b.hk, sizeof s3b.hk);
2535.   	assert(l == sizeof s3b.hk);
2536.   	if(!JPAKE_STEP3B_process(ctx, &s3b))
             ^
2537.   		{
2538.   		ERR_print_errors(bio_err);

crypto/jpake/jpake.c:462:1: Parameter `ctx->key->top`
  460.       }
  461.   
  462. > int JPAKE_STEP3B_process(JPAKE_CTX *ctx, const JPAKE_STEP3B *received)
  463.       {
  464.       unsigned char hk[SHA_DIGEST_LENGTH];

crypto/jpake/jpake.c:466:5: Call
  464.       unsigned char hk[SHA_DIGEST_LENGTH];
  465.   
  466.       quickhashbn(hk, ctx->key);
             ^
  467.       if(memcmp(hk, received->hk, sizeof hk))
  468.   	{

crypto/jpake/jpake.c:415:1: Parameter `bn->top`
    413.       }
    414.   
    415. > static void quickhashbn(unsigned char *md, const BIGNUM *bn)
    416.       {
    417.       SHA_CTX sha;

crypto/jpake/jpake.c:420:5: Call
    418.   
    419.       SHA1_Init(&sha);
    420.       hashbn(&sha, bn);
               ^
    421.       SHA1_Final(md, &sha);
    422.       }

crypto/jpake/jpake.c:150:1: Parameter `bn->top`
      148.       }
      149.   
      150. > static void hashbn(SHA_CTX *sha, const BIGNUM *bn)
      151.       {
      152.       size_t l = BN_num_bytes(bn);

crypto/jpake/jpake.c:152:16: Call
      150.   static void hashbn(SHA_CTX *sha, const BIGNUM *bn)
      151.       {
      152.       size_t l = BN_num_bytes(bn);
                            ^
      153.       unsigned char *bin = OPENSSL_malloc(l);
      154.   

crypto/bn/bn_lib.c:248:1: <LHS trace>
246.   	}
247.   
248. > int BN_num_bits(const BIGNUM *a)
249.   	{
250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:248:1: Parameter `a->top`
        246.   	}
        247.   
        248. > int BN_num_bits(const BIGNUM *a)
        249.   	{
        250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:250:2: Binary operation: ([0, +oo] - 1):unsigned64 by call to `JPAKE_STEP3B_process` 
        248.   int BN_num_bits(const BIGNUM *a)
        249.   	{
        250.   	int i = a->top - 1;
                ^
        251.   	bn_check_top(a);
        252.   

int BN_num_bits(const BIGNUM *a)
	{
	int i = a->top - 1;
	bn_check_top(a);
	if (BN_is_zero(a)) return 0;
	return ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));
	}
['static void jpake_receive_step3b(JPAKE_CTX *ctx, BIO *bconn)\n\t{\n\tJPAKE_STEP3B s3b;\n\tint l;\n\tJPAKE_STEP3B_init(&s3b);\n\tl = BIO_read(bconn, s3b.hk, sizeof s3b.hk);\n\tassert(l == sizeof s3b.hk);\n\tif(!JPAKE_STEP3B_process(ctx, &s3b))\n\t\t{\n\t\tERR_print_errors(bio_err);\n\t\texit(1);\n\t\t}\n\tJPAKE_STEP3B_release(&s3b);\n\t}', 'int JPAKE_STEP3B_process(JPAKE_CTX *ctx, const JPAKE_STEP3B *received)\n    {\n    unsigned char hk[SHA_DIGEST_LENGTH];\n    quickhashbn(hk, ctx->key);\n    if(memcmp(hk, received->hk, sizeof hk))\n\t{\n\tJPAKEerr(JPAKE_F_JPAKE_STEP3B_PROCESS, JPAKE_R_HASH_OF_KEY_MISMATCH);\n\treturn 0;\n\t}\n    return 1;\n    }', 'static void quickhashbn(unsigned char *md, const BIGNUM *bn)\n    {\n    SHA_CTX sha;\n    SHA1_Init(&sha);\n    hashbn(&sha, bn);\n    SHA1_Final(md, &sha);\n    }', 'static void hashbn(SHA_CTX *sha, const BIGNUM *bn)\n    {\n    size_t l = BN_num_bytes(bn);\n    unsigned char *bin = OPENSSL_malloc(l);\n    hashlength(sha, l);\n    BN_bn2bin(bn, bin);\n    SHA1_Update(sha, bin, l);\n    OPENSSL_free(bin);\n    }', 'int BN_num_bits(const BIGNUM *a)\n\t{\n\tint i = a->top - 1;\n\tbn_check_top(a);\n\tif (BN_is_zero(a)) return 0;\n\treturn ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));\n\t}']