/* If the fields p and g in d are NULL, the corresponding input
* parameters MUST be non-NULL. q may remain NULL.
*/
- if (dh->p == NULL && p == NULL
- || dh->g == NULL && g == NULL)
+ if ((dh->p == NULL && p == NULL)
+ || (dh->g == NULL && g == NULL))
return 0;
if (p != NULL) {
/* If the fields p, q and g in d are NULL, the corresponding input
* parameters MUST be non-NULL.
*/
- if (d->p == NULL && p == NULL
- || d->q == NULL && q == NULL
- || d->g == NULL && g == NULL)
+ if ((d->p == NULL && p == NULL)
+ || (d->q == NULL && q == NULL)
+ || (d->g == NULL && g == NULL))
return 0;
if (p != NULL) {
* parameters MUST be non-NULL for n and e. d may be
* left NULL (in case only the public key is used).
*/
- if (r->n == NULL && n == NULL
- || r->e == NULL && e == NULL)
+ if ((r->n == NULL && n == NULL)
+ || (r->e == NULL && e == NULL))
return 0;
if (n != NULL) {
/* If the fields p and q in r are NULL, the corresponding input
* parameters MUST be non-NULL.
*/
- if (r->p == NULL && p == NULL
- || r->q == NULL && q == NULL)
+ if ((r->p == NULL && p == NULL)
+ || (r->q == NULL && q == NULL))
return 0;
if (p != NULL) {
/* If the fields dmp1, dmq1 and iqmp in r are NULL, the corresponding input
* parameters MUST be non-NULL.
*/
- if (r->dmp1 == NULL && dmp1 == NULL
- || r->dmq1 == NULL && dmq1 == NULL
- || r->iqmp == NULL && iqmp == NULL)
+ if ((r->dmp1 == NULL && dmp1 == NULL)
+ || (r->dmq1 == NULL && dmq1 == NULL)
+ || (r->iqmp == NULL && iqmp == NULL))
return 0;
if (dmp1 != NULL) {
BN_GENCB *_cb = NULL;
DH *a = NULL;
DH *b = NULL;
- BIGNUM *ap = NULL, *ag = NULL, *bp = NULL, *bg = NULL, *apub_key = NULL;
- BIGNUM *bpub_key = NULL, *priv_key = NULL;
+ const BIGNUM *ap = NULL, *ag = NULL, *apub_key = NULL, *priv_key = NULL;
+ const BIGNUM *bpub_key = NULL;
+ BIGNUM *bp = NULL, *bg = NULL;
char buf[12] = {0};
unsigned char *abuf = NULL;
unsigned char *bbuf = NULL;
unsigned char *Z2 = NULL;
const rfc5114_td *td = NULL;
BIGNUM *bady = NULL, *priv_key = NULL, *pub_key = NULL;
+ const BIGNUM *pub_key_tmp;
for (i = 0; i < (int)OSSL_NELEM(rfctd); i++) {
td = rfctd + i;
* Work out shared secrets using both sides and compare with expected
* values.
*/
- DH_get0_key(dhB, &pub_key, NULL);
- if (DH_compute_key(Z1, pub_key, dhA) == -1) {
- pub_key = NULL;
+ DH_get0_key(dhB, &pub_key_tmp, NULL);
+ if (DH_compute_key(Z1, pub_key_tmp, dhA) == -1)
goto bad_err;
- }
- DH_get0_key(dhA, &pub_key, NULL);
- if (DH_compute_key(Z2, pub_key, dhB) == -1) {
- pub_key = NULL;
+
+ DH_get0_key(dhA, &pub_key_tmp, NULL);
+ if (DH_compute_key(Z2, pub_key_tmp, dhB) == -1)
goto bad_err;
- }
- pub_key = NULL;
if (memcmp(Z1, td->Z, td->Z_len))
goto err;
unsigned long h;
unsigned char sig[256];
unsigned int siglen;
- BIGNUM *p = NULL, *q = NULL, *g = NULL;
+ const BIGNUM *p = NULL, *q = NULL, *g = NULL;
if (bio_err == NULL)
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);