summaryrefslogtreecommitdiffstats
path: root/fips
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-09-29 16:24:00 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-09-29 16:24:00 +0000
commit884c33b5c4ddfa893006628a33a165545ce27d42 (patch)
treeb89ea8099522341f777db7e195a107544cca9537 /fips
parent54bb3f68e15dc7a9739df5a0d1ab70a446f94c95 (diff)
Check return codes properly.
Diffstat (limited to 'fips')
-rw-r--r--fips/rand/fips_drbg_ec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fips/rand/fips_drbg_ec.c b/fips/rand/fips_drbg_ec.c
index fb5f77c897..c4d7612d6c 100644
--- a/fips/rand/fips_drbg_ec.c
+++ b/fips/rand/fips_drbg_ec.c
@@ -218,7 +218,7 @@ static int drbg_ec_mul(DRBG_EC_CTX *ectx, BIGNUM *r, const BIGNUM *s, int use_q)
if (!EC_POINT_get_affine_coordinates_GFp(ectx->curve, ectx->ptmp, r,
NULL, ectx->bctx))
return 0;
- return 0;
+ return 1;
}
static int drbg_ec_instantiate(DRBG_CTX *dctx,
@@ -244,7 +244,7 @@ static int drbg_ec_reseed(DRBG_CTX *dctx,
/* Check if we have a deferred s = s * P */
if (ectx->sp_defer)
{
- if (drbg_ec_mul(ectx, ectx->s, ectx->s, 0))
+ if (!drbg_ec_mul(ectx, ectx->s, ectx->s, 0))
return 0;
ectx->sp_defer = 0;
}
@@ -281,7 +281,7 @@ static int drbg_ec_generate(DRBG_CTX *dctx,
/* Check if we have a deferred s = s * P */
if (ectx->sp_defer)
{
- if (drbg_ec_mul(ectx, s, s, 0))
+ if (!drbg_ec_mul(ectx, s, s, 0))
goto err;
ectx->sp_defer = 0;
}
@@ -323,13 +323,13 @@ static int drbg_ec_generate(DRBG_CTX *dctx,
for (;;)
{
/* Step #6, calculate s = t * P */
- if (drbg_ec_mul(ectx, s, t, 0))
+ if (!drbg_ec_mul(ectx, s, t, 0))
goto err;
#ifdef EC_DRBG_TRACE
bnprint(stderr, "s in generate: ", ectx->s);
#endif
/* Step #7, calculate r = s * Q */
- if (drbg_ec_mul(ectx, r, s, 1))
+ if (!drbg_ec_mul(ectx, r, s, 1))
goto err;
#ifdef EC_DRBG_TRACE
bnprint(stderr, "r in generate is: ", r);