X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=engines%2Fe_ubsec.c;h=aa5709bd8cf5912cf0fa4856d4a45497e5bbd73a;hb=d2add2efaa2df50063c7aa6d849525dfe1c1d6da;hp=fe6bdba25b414b0c9febfe92b83819c8b0f36a8f;hpb=d4f0339c66eace1b7f90f07f43b6d8595342cce3;p=openssl.git diff --git a/engines/e_ubsec.c b/engines/e_ubsec.c index fe6bdba25b..aa5709bd8c 100644 --- a/engines/e_ubsec.c +++ b/engines/e_ubsec.c @@ -302,8 +302,8 @@ static t_UBSEC_diffie_hellman_generate_ioctl *p_UBSEC_diffie_hellman_generate_ioctl = NULL; static t_UBSEC_diffie_hellman_agree_ioctl *p_UBSEC_diffie_hellman_agree_ioctl = NULL; #endif -static t_UBSEC_rsa_mod_exp_ioctl *p_UBSEC_rsa_mod_exp_ioctl = NULL; #ifndef OPENSSL_NO_RSA +static t_UBSEC_rsa_mod_exp_ioctl *p_UBSEC_rsa_mod_exp_ioctl = NULL; static t_UBSEC_rsa_mod_exp_crt_ioctl *p_UBSEC_rsa_mod_exp_crt_ioctl = NULL; #endif #ifndef OPENSSL_NO_DSA @@ -630,10 +630,8 @@ static int ubsec_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *dq, const BIGNUM *qinv, BN_CTX *ctx) { int y_len, - m_len, fd; - m_len = BN_num_bytes(p) + BN_num_bytes(q) + 1; y_len = BN_num_bits(p) + BN_num_bits(q); /* Check if hardware can't handle this argument. */ @@ -935,7 +933,7 @@ static int ubsec_dh_generate_key(DH *dh) priv_key = BN_new(); if (priv_key == NULL) goto err; priv_key_len = BN_num_bits(dh->p); - bn_wexpand(priv_key, dh->p->top); + if(bn_wexpand(priv_key, dh->p->top) == NULL) goto err; do if (!BN_rand_range(priv_key, dh->p)) goto err; while (BN_is_zero(priv_key)); @@ -950,7 +948,7 @@ static int ubsec_dh_generate_key(DH *dh) { pub_key = BN_new(); pub_key_len = BN_num_bits(dh->p); - bn_wexpand(pub_key, dh->p->top); + if(bn_wexpand(pub_key, dh->p->top) == NULL) goto err; if(pub_key == NULL) goto err; } else