test/rsa_sp800_56b_test.c:305: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `rsa_check_private_exponent`.
Showing all 17 steps of the trace


test/rsa_sp800_56b_test.c:305:14: Call
303.             && TEST_true(RSA_set0_key(key, n, e, d))
304.             /* fails since d >= lcm(p-1, q-1) */
305.             && TEST_false(rsa_check_private_exponent(key, 8, ctx))
                    ^
306.             && TEST_true(BN_set_word(d, 45))
307.             /* d is correct size and 1 = e.d mod lcm(p-1, q-1) */

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: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.indexes`
      169.   }
      170.   
      171. > void BN_CTX_start(BN_CTX *ctx)
      172.   {
      173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_mod.c:218:5: Call
    216.       ret = 1;
    217.    err:
    218.       BN_CTX_end(ctx);
               ^
    219.       return ret;
    220.   }

crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
      183.   }
      184.   
      185. > void BN_CTX_end(BN_CTX *ctx)
      186.   {
      187.       CTXDBG("ENTER BN_CTX_end()", ctx);

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

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

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

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

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

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