crypto/rsa/rsa_sp800_56b_check.c:375: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `rsa_check_private_exponent`.
Showing all 25 steps of the trace


crypto/rsa/rsa_sp800_56b_check.c:360:5: Call
358.           return 0;
359.   
360.       BN_CTX_start(ctx);
           ^
361.       r = BN_CTX_get(ctx);
362.       if (r == NULL || !BN_mul(r, rsa->p, rsa->q, ctx))

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
  169.   }
  170.   
  171. > void BN_CTX_start(BN_CTX *ctx)
  172.   {
  173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/rsa/rsa_sp800_56b_check.c:375:14: Call
373.             && (rsa_check_pminusq_diff(r, rsa->p, rsa->q, nbits) > 0)
374.             /* (Step 6): Check the private exponent d */
375.             && rsa_check_private_exponent(rsa, nbits, ctx)
                    ^
376.             /* 6.4.1.2.3 (Step 7): Check the CRT components */
377.             && rsa_check_crt_components(rsa, ctx);

crypto/rsa/rsa_sp800_56b_check.c:157:1: Parameter `ctx->stack.depth`
  155.    *     (Step 6b) 1 = (d*e) mod LCM(p–1, q–1)
  156.    */
  157. > int rsa_check_private_exponent(const RSA *rsa, int nbits, BN_CTX *ctx)
  158.   {
  159.       int ret;

crypto/rsa/rsa_sp800_56b_check.c:166:5: Call
  164.           return 0;
  165.   
  166.       BN_CTX_start(ctx);
             ^
  167.       r = BN_CTX_get(ctx);
  168.       p1 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
    169.   }
    170.   
    171. > void BN_CTX_start(BN_CTX *ctx)
    172.   {
    173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/rsa/rsa_sp800_56b_check.c:175:15: Call
  173.       ret = (gcd != NULL
  174.             /* LCM(p - 1, q - 1) */
  175.             && (rsa_get_lcm(ctx, rsa->p, rsa->q, lcm, gcd, p1, q1, p1q1) == 1)
                       ^
  176.             /* (Step 6a) d < LCM(p - 1, q - 1) */
  177.             && (BN_cmp(rsa->d, lcm) < 0)

crypto/rsa/rsa_sp800_56b_check.c:220:1: Parameter `ctx->stack.depth`
    218.   
    219.   /* return LCM(p-1, q-1) */
    220. > int rsa_get_lcm(BN_CTX *ctx, const BIGNUM *p, const BIGNUM *q,
    221.                   BIGNUM *lcm, BIGNUM *gcd, BIGNUM *p1, BIGNUM *q1,
    222.                   BIGNUM *p1q1)

crypto/rsa/rsa_sp800_56b_check.c:179:14: Call
  177.             && (BN_cmp(rsa->d, lcm) < 0)
  178.             /* (Step 6b) 1 = (e . d) mod LCM(p - 1, q - 1) */
  179.             && BN_mod_mul(r, rsa->e, rsa->d, lcm, ctx)
                      ^
  180.             && BN_is_one(r));
  181.   

crypto/bn/bn_mod.c:193:1: Parameter `ctx->stack.depth`
    191.   
    192.   /* slow but works */
    193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
    194.                  BN_CTX *ctx)
    195.   {

crypto/bn/bn_mod.c:203:5: Call
    201.       bn_check_top(m);
    202.   
    203.       BN_CTX_start(ctx);
               ^
    204.       if ((t = BN_CTX_get(ctx)) == NULL)
    205.           goto err;

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
      169.   }
      170.   
      171. > void BN_CTX_start(BN_CTX *ctx)
      172.   {
      173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_mod.c:210:14: Call
    208.               goto err;
    209.       } else {
    210.           if (!BN_mul(t, a, b, ctx))
                        ^
    211.               goto err;
    212.       }

crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth`
      495.   #endif                          /* BN_RECURSION */
      496.   
      497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
      498.   {
      499.       int ret = bn_mul_fixed_top(r, a, b, ctx);

crypto/bn/bn_mul.c:499:15: Call
      497.   int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
      498.   {
      499.       int ret = bn_mul_fixed_top(r, a, b, ctx);
                           ^
      500.   
      501.       bn_correct_top(r);

crypto/bn/bn_mul.c:533:5: Call
        531.       top = al + bl;
        532.   
        533.       BN_CTX_start(ctx);
                   ^
        534.       if ((r == a) || (r == b)) {
        535.           if ((rr = BN_CTX_get(ctx)) == NULL)

crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
          169.   }
          170.   
          171. > void BN_CTX_start(BN_CTX *ctx)
          172.   {
          173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_mul.c:618:5: Call
        616.    err:
        617.       bn_check_top(r);
        618.       BN_CTX_end(ctx);
                   ^
        619.       return ret;
        620.   }

crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
          183.   }
          184.   
          185. > void BN_CTX_end(BN_CTX *ctx)
          186.   {
          187.       if (ctx == NULL)

crypto/bn/bn_ctx.c:193:27: Call
          191.           ctx->err_stack--;
          192.       else {
          193.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                           ^
          194.           /* Does this stack frame have anything to release? */
          195.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:268:1: <Offset trace>
266.   }
267.   
268. > static unsigned int BN_STACK_pop(BN_STACK *st)
269.   {
270.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:268:1: Parameter `st->depth`
            266.   }
            267.   
            268. > static unsigned int BN_STACK_pop(BN_STACK *st)
            269.   {
            270.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:268:1: <Length trace>
266.   }
267.   
268. > static unsigned int BN_STACK_pop(BN_STACK *st)
269.   {
270.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:268:1: Parameter `*st->indexes`
            266.   }
            267.   
            268. > static unsigned int BN_STACK_pop(BN_STACK *st)
            269.   {
            270.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:270:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `rsa_check_private_exponent` 
            268.   static unsigned int BN_STACK_pop(BN_STACK *st)
            269.   {
            270.       return st->indexes[--(st->depth)];
                              ^
            271.   }
            272.   
