crypto/ec/ecdsa_ossl.c:277: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `ecdsa_sign_setup`.
Showing all 44 steps of the trace


crypto/ec/ecdsa_ossl.c:211:1: Parameter `eckey->group->order->top`
209.   }
210.   
211. > ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
212.                                  const BIGNUM *in_kinv, const BIGNUM *in_r,
213.                                  EC_KEY *eckey)

crypto/ec/ecdsa_ossl.c:260:9: Call
258.           goto err;
259.       }
260.       i = BN_num_bits(order);
               ^
261.       /*
262.        * Need to truncate digest if it is too long: first truncate whole bytes.

crypto/bn/bn_lib.c:139:9: Call
  137.       bn_check_top(a);
  138.   
  139.       if (BN_is_zero(a))
                 ^
  140.           return 0;
  141.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:842:1: Parameter `a->top`
    840.   }
    841.   
    842. > int BN_is_zero(const BIGNUM *a)
    843.   {
    844.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:277:18: Call
275.       do {
276.           if (in_kinv == NULL || in_r == NULL) {
277.               if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) {
                        ^
278.                   ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_ECDSA_LIB);
279.                   goto err;

crypto/ec/ecdsa_ossl.c:34:1: Parameter `eckey->group->order->top`
  32.   }
  33.   
  34. > static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
  35.                               BIGNUM **kinvp, BIGNUM **rp,
  36.                               const unsigned char *dgst, int dlen)

crypto/ec/ecdsa_ossl.c:82:18: Call
  80.   
  81.       /* Preallocate space */
  82.       order_bits = BN_num_bits(order);
                         ^
  83.       if (!BN_set_bit(k, order_bits)
  84.           || !BN_set_bit(r, order_bits)

crypto/bn/bn_lib.c:139:9: Call
    137.       bn_check_top(a);
    138.   
    139.       if (BN_is_zero(a))
                   ^
    140.           return 0;
    141.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:842:1: Parameter `a->top`
      840.   }
      841.   
      842. > int BN_is_zero(const BIGNUM *a)
      843.   {
      844.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:100:22: Call
  98.                   }
  99.               } else {
  100.                   if (!BN_priv_rand_range(k, order)) {
                              ^
  101.                       ECerr(EC_F_ECDSA_SIGN_SETUP,
  102.                                EC_R_RANDOM_NUMBER_GENERATION_FAILED);

crypto/bn/bn_rand.c:182:1: Parameter `range->top`
    180.   }
    181.   
    182. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
    183.   {
    184.       return bnrand_range(PRIVATE, r, range);

crypto/bn/bn_rand.c:184:12: Call
    182.   int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
    183.   {
    184.       return bnrand_range(PRIVATE, r, range);
                      ^
    185.   }
    186.   

crypto/bn/bn_rand.c:113:1: Parameter `range->top`
      111.   
      112.   /* random number r:  0 <= r < range */
      113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range)
      114.   {
      115.       int n;

crypto/ec/ecdsa_ossl.c:120:14: Call
  118.            * conditional copy.
  119.            */
  120.           if (!BN_add(r, k, order)
                      ^
  121.               || !BN_add(X, r, order)
  122.               || !BN_copy(k, BN_num_bits(r) > order_bits ? r : X))

crypto/bn/bn_add.c:14:1: Parameter `b->top`
    12.   
    13.   /* signed add of b to a. */
    14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
    15.   {
    16.       int ret, r_neg, cmp_res;

crypto/ec/ecdsa_ossl.c:121:17: Call
  119.            */
  120.           if (!BN_add(r, k, order)
  121.               || !BN_add(X, r, order)
                         ^
  122.               || !BN_copy(k, BN_num_bits(r) > order_bits ? r : X))
  123.               goto err;

crypto/bn/bn_add.c:14:1: Parameter `b->top`
    12.   
    13.   /* signed add of b to a. */
    14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
    15.   {
    16.       int ret, r_neg, cmp_res;

crypto/ec/ecdsa_ossl.c:126:14: Call
  124.   
  125.           /* compute r the x-coordinate of generator * k */
  126.           if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx)) {
                      ^
  127.               ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB);
  128.               goto err;

crypto/ec/ec_lib.c:922:1: Parameter `group->order->top`
    920.   }
    921.   
    922. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
    923.                    const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
    924.   {

crypto/ec/ec_lib.c:933:12: Call
    931.       scalars[0] = p_scalar;
    932.   
    933.       return EC_POINTs_mul(group, r, g_scalar,
                      ^
    934.                            (point != NULL
    935.                             && p_scalar != NULL), points, scalars, ctx);

crypto/ec/ec_lib.c:911:1: Parameter `group->order->top`
      909.    */
      910.   
      911. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
      912.                     size_t num, const EC_POINT *points[],
      913.                     const BIGNUM *scalars[], BN_CTX *ctx)

crypto/ec/ec_lib.c:917:16: Call
      915.       if (group->meth->mul == 0)
      916.           /* use default */
      917.           return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
                            ^
      918.   
      919.       return group->meth->mul(group, r, scalar, num, points, scalars, ctx);

crypto/ec/ec_mult.c:341:1: Parameter `group->order->top`
        339.    * in the addition if scalar != NULL
        340.    */
        341. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
        342.                   size_t num, const EC_POINT *points[], const BIGNUM *scalars[],
        343.                   BN_CTX *ctx)

crypto/ec/ec_mult.c:392:16: Call
        390.            * constant time version.
        391.            */
        392.           return ec_mul_consttime(group, r, scalar, NULL, ctx);
                              ^
        393.       }
        394.       if ((scalar == NULL) && (num == 1)) {

crypto/ec/ec_mult.c:131:1: Parameter `group->order->top`
          129.    * Returns 1 on success, 0 otherwise.
          130.    */
          131. > static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r,
          132.                               const BIGNUM *scalar, const EC_POINT *point,
          133.                               BN_CTX *ctx)

crypto/ec/ec_mult.c:145:18: Call
          143.           goto err;
          144.   
          145.       order_bits = BN_num_bits(group->order);
                                  ^
          146.   
          147.       s = EC_POINT_new(group);

crypto/bn/bn_lib.c:139:9: Call
            137.       bn_check_top(a);
            138.   
            139.       if (BN_is_zero(a))
                           ^
            140.           return 0;
            141.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:842:1: Parameter `a->top`
              840.   }
              841.   
              842. > int BN_is_zero(const BIGNUM *a)
              843.   {
              844.       return a->top == 0;

crypto/ec/ec_mult.c:188:14: Call
          186.            * constant-timeness
          187.            */
          188.           if (!BN_nnmod(k, k, group->order, ctx))
                              ^
          189.               goto err;
          190.       }

crypto/bn/bn_mod.c:13:1: Parameter `d->top`
            11.   #include "bn_lcl.h"
            12.   
            13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
            14.   {
            15.       /*

crypto/bn/bn_mod.c:20:11: Call
            18.        */
            19.   
            20.       if (!(BN_mod(r, m, d, ctx)))
                            ^
            21.           return 0;
            22.       if (!r->neg)

crypto/bn/bn_div.c:199:31: Call
              197.   
              198.       /* First we normalise the numbers */
              199.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                                                   ^
              200.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
              201.           goto err;

crypto/bn/bn_lib.c:140:9: Assignment
                138.   
                139.       if (BN_is_zero(a))
                140.           return 0;
                               ^
                141.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
                142.   }

crypto/bn/bn_div.c:199:5: Assignment
              197.   
              198.       /* First we normalise the numbers */
              199.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                         ^
              200.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
              201.           goto err;

crypto/bn/bn_div.c:200:11: Call
              198.       /* First we normalise the numbers */
              199.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
              200.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
                               ^
              201.           goto err;
              202.       sdiv->neg = 0;

crypto/bn/bn_shift.c:83:1: <Offset trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `n`
                81.   }
                82.   
                83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
                84.   {
                85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:97:5: Assignment
                95.       }
                96.   
                97.       nw = n / BN_BITS2;
                           ^
                98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
                99.           return 0;

crypto/bn/bn_shift.c:83:1: <Length trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `*r->d`
                81.   }
                82.   
                83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
                84.   {
                85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:98:9: Call
                96.   
                97.       nw = n / BN_BITS2;
                98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
                               ^
                99.           return 0;
                100.       r->neg = a->neg;

crypto/bn/bn_lib.c:938:1: Parameter `*a->d`
                  936.   }
                  937.   
                  938. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
                  939.   {
                  940.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_shift.c:104:5: Assignment
                102.       rb = BN_BITS2 - lb;
                103.       f = a->d;
                104.       t = r->d;
                           ^
                105.       t[a->top + nw] = 0;
                106.       if (lb == 0)

crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `ecdsa_sign_setup` 
                110.           for (i = a->top - 1; i >= 0; i--) {
                111.               l = f[i];
                112.               t[nw + i + 1] |= (l >> rb) & BN_MASK2;
                                   ^
                113.               t[nw + i] = (l << lb) & BN_MASK2;
                114.           }
