engines/e_ubsec.c:896: error: INTEGER_OVERFLOW_L2
  ([0, `dh->p->top`] - 1):unsigned64 by call to `BN_num_bits`.
Showing all 7 steps of the trace


engines/e_ubsec.c:876:1: Parameter `dh->p->top`
874.   
875.   #ifndef OPENSSL_NO_DH
876. > static int ubsec_dh_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh)
877.           {
878.           int      ret      = -1,

engines/e_ubsec.c:882:17: Call
880.                    fd;
881.   
882.           k_len = BN_num_bits(dh->p);
                       ^
883.   
884.           if ((fd = p_UBSEC_ubsec_open(UBSEC_KEY_DEVICE_NAME)) <= 0)

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;

engines/e_ubsec.c:896:75: Call
894.                                                  (unsigned char *)dh->priv_key->d, BN_num_bits(dh->priv_key),
895.                                                  (unsigned char *)pub_key->d, BN_num_bits(pub_key),
896.                                                  (unsigned char *)dh->p->d, BN_num_bits(dh->p),
                                                                                 ^
897.                                                  key, &k_len) != 0)
898.                   {

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, dh->p->top] - 1):unsigned64 by call to `BN_num_bits` 
  248.   int BN_num_bits(const BIGNUM *a)
  249.   	{
  250.   	int i = a->top - 1;
          ^
  251.   	bn_check_top(a);
  252.   

int BN_num_bits(const BIGNUM *a)
	{
	int i = a->top - 1;
	bn_check_top(a);
	if (BN_is_zero(a)) return 0;
	return ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));
	}
['static int ubsec_dh_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh)\n        {\n        int      ret      = -1,\n                 k_len,\n                 fd;\n        k_len = BN_num_bits(dh->p);\n        if ((fd = p_UBSEC_ubsec_open(UBSEC_KEY_DEVICE_NAME)) <= 0)\n                {\n                const DH_METHOD *meth;\n                UBSECerr(UBSEC_F_UBSEC_DH_COMPUTE_KEY, UBSEC_R_UNIT_FAILURE);\n                meth = DH_OpenSSL();\n                ret = meth->compute_key(key, pub_key, dh);\n                goto err;\n                }\n        if (p_UBSEC_diffie_hellman_agree_ioctl(fd,\n                                               (unsigned char *)dh->priv_key->d, BN_num_bits(dh->priv_key),\n                                               (unsigned char *)pub_key->d, BN_num_bits(pub_key),\n                                               (unsigned char *)dh->p->d, BN_num_bits(dh->p),\n                                               key, &k_len) != 0)\n                {\n                const DH_METHOD *meth;\n                UBSECerr(UBSEC_F_UBSEC_DH_COMPUTE_KEY, UBSEC_R_REQUEST_FAILED);\n                p_UBSEC_ubsec_close(fd);\n                meth = DH_OpenSSL();\n                ret = meth->compute_key(key, pub_key, dh);\n                goto err;\n                }\n        p_UBSEC_ubsec_close(fd);\n        ret = p_UBSEC_ubsec_bits_to_bytes(k_len);\nerr:\n        return ret;\n        }', 'int BN_num_bits(const BIGNUM *a)\n\t{\n\tint i = a->top - 1;\n\tbn_check_top(a);\n\tif (BN_is_zero(a)) return 0;\n\treturn ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));\n\t}']