#include <openssl/evp.h>
#include <openssl/dh.h>
#include <openssl/bn.h>
-#ifndef OPENSSL_NO_DSA
-# include <openssl/dsa.h>
-#endif
+#include <openssl/dsa.h>
#include <openssl/objects.h>
#include "internal/evp_int.h"
DH_PKEY_CTX *dctx;
dctx = OPENSSL_zalloc(sizeof(*dctx));
- if (!dctx)
+ if (dctx == NULL)
return 0;
dctx->prime_len = 1024;
dctx->subprime_len = -1;
return 0;
dctx->kdf_md = sctx->kdf_md;
if (dctx->kdf_ukm) {
- dctx->kdf_ukm = BUF_memdup(sctx->kdf_ukm, sctx->kdf_ukmlen);
+ dctx->kdf_ukm = OPENSSL_memdup(sctx->kdf_ukm, sctx->kdf_ukmlen);
dctx->kdf_ukmlen = sctx->kdf_ukmlen;
}
dctx->kdf_outlen = sctx->kdf_outlen;
if (dctx->use_dsa > 2)
return NULL;
ret = DSA_new();
- if (!ret)
+ if (ret == NULL)
return NULL;
if (subprime_len == -1) {
if (prime_len >= 2048)
if (ctx->pkey_gencb) {
pcb = BN_GENCB_new();
+ if (pcb == NULL)
+ return 0;
evp_pkey_set_cb_translate(pcb, ctx);
} else
pcb = NULL;
DSA *dsa_dh;
dsa_dh = dsa_dh_generate(dctx, pcb);
BN_GENCB_free(pcb);
- if (!dsa_dh)
+ if (dsa_dh == NULL)
return 0;
dh = DSA_dup_DH(dsa_dh);
DSA_free(dsa_dh);
}
#endif
dh = DH_new();
- if (!dh) {
+ if (dh == NULL) {
BN_GENCB_free(pcb);
return 0;
}
return 0;
}
dh = DH_new();
- if (!dh)
+ if (dh == NULL)
return 0;
EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, dh);
/* Note: if error return, pkey is freed by parent routine */
ret = 0;
Zlen = DH_size(dh);
Z = OPENSSL_malloc(Zlen);
- if (!Z) {
+ if (Z == NULL) {
goto err;
}
if (DH_compute_key_padded(Z, dhpub, dh) <= 0)