test/rsa_sp800_56b_test.c:443: error: BUFFER_OVERRUN_L3
  Offset: [31, +oo] Size: [0, 8388607] by call to `rsa_sp800_56b_check_keypair`.
Showing all 23 steps of the trace


test/rsa_sp800_56b_test.c:443:14: Call
441.             && TEST_ptr(ctx = BN_CTX_new())
442.             /* NULL parameters */
443.             && TEST_false(rsa_sp800_56b_check_keypair(key, NULL, -1, 2048))
                    ^
444.             /* load key */
445.             && TEST_ptr(p = bn_load_new(cav_p, sizeof(cav_p)))

crypto/rsa/rsa_sp800_56b_check.c:316:1: Parameter `rsa->dmp1->top`
  314.    *     6.4.1.3.3 "rsakpv2 - crt"
  315.    */
  316. > int rsa_sp800_56b_check_keypair(const RSA *rsa, const BIGNUM *efixed,
  317.                                   int strength, int nbits)
  318.   {

crypto/rsa/rsa_sp800_56b_check.c:377:14: Call
  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);
                      ^
  378.       if (ret != 1)
  379.           RSAerr(RSA_F_RSA_SP800_56B_CHECK_KEYPAIR, RSA_R_INVALID_KEYPAIR);

crypto/rsa/rsa_sp800_56b_check.c:24:1: Parameter `rsa->dmp1->top`
    22.    *   6.4.1.3.3: rsakpv2-crt Step 7
    23.    */
    24. > int rsa_check_crt_components(const RSA *rsa, BN_CTX *ctx)
    25.   {
    26.       int ret = 0;

crypto/rsa/rsa_sp800_56b_check.c:48:15: Call
    46.             && BN_sub_word(q1, 1)
    47.             /* (a) 1 < dP < (p – 1). */
    48.             && (BN_cmp(rsa->dmp1, BN_value_one()) > 0)
                        ^
    49.             && (BN_cmp(rsa->dmp1, p1) < 0)
    50.             /* (b) 1 < dQ < (q - 1). */

crypto/bn/bn_lib.c:581:1: Parameter `a->top`
      579.   }
      580.   
      581. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
      582.   {
      583.       int i;

crypto/rsa/rsa_sp800_56b_check.c:49:15: Call
    47.             /* (a) 1 < dP < (p – 1). */
    48.             && (BN_cmp(rsa->dmp1, BN_value_one()) > 0)
    49.             && (BN_cmp(rsa->dmp1, p1) < 0)
                        ^
    50.             /* (b) 1 < dQ < (q - 1). */
    51.             && (BN_cmp(rsa->dmq1, BN_value_one()) > 0)

crypto/bn/bn_lib.c:581:1: Parameter `a->top`
      579.   }
      580.   
      581. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
      582.   {
      583.       int i;

crypto/rsa/rsa_sp800_56b_check.c:57:14: Call
    55.             && (BN_cmp(rsa->iqmp, rsa->p) < 0)
    56.             /* (d) 1 = (dP . e) mod (p - 1)*/
    57.             && BN_mod_mul(r, rsa->dmp1, rsa->e, p1, ctx)
                       ^
    58.             && BN_is_one(r)
    59.             /* (e) 1 = (dQ . e) mod (q - 1) */

crypto/bn/bn_mod.c:193:1: Parameter `a->top`
      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:207:14: Call
      205.           goto err;
      206.       if (a == b) {
      207.           if (!BN_sqr(t, a, ctx))
                          ^
      208.               goto err;
      209.       } else {

crypto/bn/bn_sqr.c:17:1: Parameter `*r->d`
        15.    * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
        16.    */
        17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
        18.   {
        19.       int ret = bn_sqr_fixed_top(r, a, ctx);

crypto/bn/bn_sqr.c:19:15: Call
        17.   int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
        18.   {
        19.       int ret = bn_sqr_fixed_top(r, a, ctx);
                            ^
        20.   
        21.       bn_correct_top(r);

crypto/bn/bn_sqr.c:27:1: Parameter `a->top`
          25.   }
          26.   
          27. > int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
          28.   {
          29.       int max, al;

crypto/bn/bn_sqr.c:35:5: Assignment
          33.       bn_check_top(a);
          34.   
          35.       al = a->top;
                    ^
          36.       if (al <= 0) {
          37.           r->top = 0;

crypto/bn/bn_sqr.c:84:17: Call
          82.                   if (bn_wexpand(tmp, max) == NULL)
          83.                       goto err;
          84.                   bn_sqr_normal(rr->d, a->d, al, tmp->d);
                                ^
          85.               }
          86.           }

crypto/bn/bn_sqr.c:109:1: <Offset trace>
107.   
108.   /* tmp must have 2*n words */
109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
110.   {
111.       int i, j, max;

crypto/bn/bn_sqr.c:109:1: Parameter `n`
            107.   
            108.   /* tmp must have 2*n words */
            109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
            110.   {
            111.       int i, j, max;

crypto/bn/bn_sqr.c:115:5: Assignment
            113.       BN_ULONG *rp;
            114.   
            115.       max = n * 2;
                       ^
            116.       ap = a;
            117.       rp = r;

crypto/bn/bn_sqr.c:109:1: <Length trace>
107.   
108.   /* tmp must have 2*n words */
109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
110.   {
111.       int i, j, max;

crypto/bn/bn_sqr.c:109:1: Parameter `*r`
            107.   
            108.   /* tmp must have 2*n words */
            109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
            110.   {
            111.       int i, j, max;

crypto/bn/bn_sqr.c:117:5: Assignment
            115.       max = n * 2;
            116.       ap = a;
            117.       rp = r;
                       ^
            118.       rp[0] = rp[max - 1] = 0;
            119.       rp++;

crypto/bn/bn_sqr.c:118:13: Array access: Offset: [31, +oo] Size: [0, 8388607] by call to `rsa_sp800_56b_check_keypair` 
            116.       ap = a;
            117.       rp = r;
            118.       rp[0] = rp[max - 1] = 0;
                               ^
            119.       rp++;
            120.       j = n;
