crypto/jpake/jpaketest.c:25: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `JPAKE_STEP1_process`.
Showing all 28 steps of the trace


crypto/jpake/jpaketest.c:24:5: Call
22.       puts("A->B s1");
23.       JPAKE_STEP1_init(&alice_s1);
24.       JPAKE_STEP1_generate(&alice_s1, alice);
          ^
25.       if(!JPAKE_STEP1_process(bob, &alice_s1))
26.   	{

crypto/jpake/jpake.c:280:5: Call
  278.       genrand(ctx);
  279.       generate_step_part(&send->p1, ctx->xa, ctx->p.g, ctx);
  280.       generate_step_part(&send->p2, ctx->xb, ctx->p.g, ctx);
             ^
  281.   
  282.       return 1;

crypto/jpake/jpake.c:251:5: Call
    249.       {
    250.       BN_mod_exp(p->gx, g, x, ctx->p.p, ctx->ctx);
    251.       generate_zkp(p, x, g, ctx);
               ^
    252.       }
    253.   

crypto/jpake/jpake.c:199:5: Call
      197.       BN_rand_range(r, ctx->p.q);
      198.      /* g^r */
      199.       BN_mod_exp(p->zkpx.gr, zkpg, r, ctx->p.p, ctx->ctx);
                 ^
      200.   
      201.      /* h=hash... */

crypto/bn/bn_exp.c:219:8: Call
        217.   			{
        218.   			BN_ULONG A = a->d[0];
        219.   			ret=BN_mod_exp_mont_word(r,A,p,m,ctx,NULL);
                      ^
        220.   			}
        221.   		else

crypto/bn/bn_exp.c:727:1: Parameter `rr->top`
          725.   	}
          726.   
          727. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
          728.                            const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
          729.   	{

crypto/jpake/jpake.c:202:5: Call
      200.   
      201.      /* h=hash... */
      202.       zkp_hash(h, zkpg, p, ctx->p.name);
                 ^
      203.   
      204.      /* b = r - x*h */

crypto/jpake/jpake.c:162:1: Parameter `p->zkpx.gr->top`
        160.   
        161.   /* h=hash(g, g^r, g^x, name) */
        162. > static void zkp_hash(BIGNUM *h, const BIGNUM *zkpg, const JPAKE_STEP_PART *p,
        163.   		     const char *proof_name)
        164.       {

crypto/jpake/jpake.c:175:5: Call
        173.       hashbn(&sha, zkpg);
        174.       OPENSSL_assert(!BN_is_zero(p->zkpx.gr));
        175.       hashbn(&sha, p->zkpx.gr);
                   ^
        176.       hashbn(&sha, p->gx);
        177.       hashstring(&sha, proof_name);

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: Parameter `a->top`
            246.   	}
            247.   
            248. > int BN_num_bits(const BIGNUM *a)
            249.   	{
            250.   	int i = a->top - 1;

crypto/jpake/jpake.c:156:5: Call
          154.   
          155.       hashlength(sha, l);
          156.       BN_bn2bin(bn, bin);
                     ^
          157.       SHA1_Update(sha, bin, l);
          158.       OPENSSL_free(bin);

crypto/bn/bn_lib.c:641:1: Parameter `a->top`
            639.   
            640.   /* ignore negative */
            641. > int BN_bn2bin(const BIGNUM *a, unsigned char *to)
            642.   	{
            643.   	int n,i;

crypto/bn/bn_lib.c:647:6: Call
            645.   
            646.   	bn_check_top(a);
            647.   	n=i=BN_num_bytes(a);
                        ^
            648.   	while (i--)
            649.   		{

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/jpake/jpaketest.c:25:9: Call
23.       JPAKE_STEP1_init(&alice_s1);
24.       JPAKE_STEP1_generate(&alice_s1, alice);
25.       if(!JPAKE_STEP1_process(bob, &alice_s1))
              ^
26.   	{
27.   	printf("Bob fails to process Alice's step 1\n");

crypto/jpake/jpake.c:285:1: Parameter `ctx->p.g->top`
  283.       }
  284.   
  285. > int JPAKE_STEP1_process(JPAKE_CTX *ctx, const JPAKE_STEP1 *received)
  286.       {
  287.      /* verify their ZKP(xc) */

crypto/jpake/jpake.c:288:9: Call
  286.       {
  287.      /* verify their ZKP(xc) */
  288.       if(!verify_zkp(&received->p1, ctx->p.g, ctx))
                 ^
  289.   	{
  290.   	JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_VERIFY_X3_FAILED);

crypto/jpake/jpake.c:214:1: Parameter `zkpg->top`
    212.       }
    213.   
    214. > static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg,
    215.   		      JPAKE_CTX *ctx)
    216.       {

crypto/jpake/jpake.c:223:5: Call
    221.       int ret = 0;
    222.   
    223.       zkp_hash(h, zkpg, p, ctx->p.peer_name);
               ^
    224.   
    225.      /* t1 = g^b */

crypto/jpake/jpake.c:162:1: Parameter `zkpg->top`
      160.   
      161.   /* h=hash(g, g^r, g^x, name) */
      162. > static void zkp_hash(BIGNUM *h, const BIGNUM *zkpg, const JPAKE_STEP_PART *p,
      163.   		     const char *proof_name)
      164.       {

crypto/jpake/jpake.c:173:5: Call
      171.       */
      172.       SHA1_Init(&sha);
      173.       hashbn(&sha, zkpg);
                 ^
      174.       OPENSSL_assert(!BN_is_zero(p->zkpx.gr));
      175.       hashbn(&sha, p->zkpx.gr);

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_STEP1_process` 
          248.   int BN_num_bits(const BIGNUM *a)
          249.   	{
          250.   	int i = a->top - 1;
                  ^
          251.   	bn_check_top(a);
          252.   
