summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-12-09 21:17:05 +0100
committerMatt Caswell <matt@openssl.org>2017-01-25 09:06:34 +0000
commite705fcf197b397cdfa1367f5ebd9826775a5a981 (patch)
tree3c13aaa77f376f86429a86a635c31dd1d26c33b5 /crypto
parent48722ff5f0988128c85e3cd3169d6457d6450c11 (diff)
Style
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1618)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/dh/dh_check.c2
-rw-r--r--crypto/dsa/dsa_pmeth.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c
index fcc1d99ad7..b362ccfea1 100644
--- a/crypto/dh/dh_check.c
+++ b/crypto/dh/dh_check.c
@@ -92,7 +92,7 @@ int DH_check(const DH *dh, int *ret)
r = BN_is_prime_ex(t1, BN_prime_checks, ctx, NULL);
if (r < 0)
goto err;
- if (!r)
+ if (!r)
*ret |= DH_CHECK_P_NOT_SAFE_PRIME;
}
ok = 1;
diff --git a/crypto/dsa/dsa_pmeth.c b/crypto/dsa/dsa_pmeth.c
index 95f088a5ec..88744a9ce2 100644
--- a/crypto/dsa/dsa_pmeth.c
+++ b/crypto/dsa/dsa_pmeth.c
@@ -31,8 +31,8 @@ typedef struct {
static int pkey_dsa_init(EVP_PKEY_CTX *ctx)
{
- DSA_PKEY_CTX *dctx;
- dctx = OPENSSL_malloc(sizeof(*dctx));
+ DSA_PKEY_CTX *dctx = OPENSSL_malloc(sizeof(*dctx));
+
if (dctx == NULL)
return 0;
dctx->nbits = 1024;
@@ -50,6 +50,7 @@ static int pkey_dsa_init(EVP_PKEY_CTX *ctx)
static int pkey_dsa_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
{
DSA_PKEY_CTX *dctx, *sctx;
+
if (!pkey_dsa_init(dst))
return 0;
sctx = src->data;
@@ -116,6 +117,7 @@ static int pkey_dsa_verify(EVP_PKEY_CTX *ctx,
static int pkey_dsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
{
DSA_PKEY_CTX *dctx = ctx->data;
+
switch (type) {
case EVP_PKEY_CTRL_DSA_PARAMGEN_BITS:
if (p1 < 256)
@@ -200,6 +202,7 @@ static int pkey_dsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
DSA_PKEY_CTX *dctx = ctx->data;
BN_GENCB *pcb;
int ret;
+
if (ctx->pkey_gencb) {
pcb = BN_GENCB_new();
if (pcb == NULL)
@@ -225,6 +228,7 @@ static int pkey_dsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
static int pkey_dsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
{
DSA *dsa = NULL;
+
if (ctx->pkey == NULL) {
DSAerr(DSA_F_PKEY_DSA_KEYGEN, DSA_R_NO_PARAMETERS_SET);
return 0;