From 2791a64273a747cd4e23d72ddbe479c32314b754 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 14 Feb 2015 15:07:54 +0000 Subject: Fix tests that got incorrectly inverted with the BN_CTX_get() return check diff. Spotted by miod@ --- src/lib/libcrypto/bn/bn_x931p.c | 10 +++++----- src/lib/libssl/src/crypto/bn/bn_x931p.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/libcrypto/bn/bn_x931p.c b/src/lib/libcrypto/bn/bn_x931p.c index 89c86c1ff7..13abd5923c 100644 --- a/src/lib/libcrypto/bn/bn_x931p.c +++ b/src/lib/libcrypto/bn/bn_x931p.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_x931p.c,v 1.6 2015/02/09 15:49:22 jsing Exp $ */ +/* $OpenBSD: bn_x931p.c,v 1.7 2015/02/14 15:07:54 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -107,11 +107,11 @@ BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, const BIGNUM *Xp, return 0; BN_CTX_start(ctx); - if (p1 != NULL) { + if (p1 == NULL) { if ((p1 = BN_CTX_get(ctx)) == NULL) goto err; } - if (p2 != NULL) { + if (p2 == NULL) { if ((p2 = BN_CTX_get(ctx)) == NULL) goto err; } @@ -252,11 +252,11 @@ BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1, int ret = 0; BN_CTX_start(ctx); - if (Xp1 != NULL) { + if (Xp1 == NULL) { if ((Xp1 = BN_CTX_get(ctx)) == NULL) goto error; } - if (Xp2 != NULL) { + if (Xp2 == NULL) { if ((Xp2 = BN_CTX_get(ctx)) == NULL) goto error; } diff --git a/src/lib/libssl/src/crypto/bn/bn_x931p.c b/src/lib/libssl/src/crypto/bn/bn_x931p.c index 89c86c1ff7..13abd5923c 100644 --- a/src/lib/libssl/src/crypto/bn/bn_x931p.c +++ b/src/lib/libssl/src/crypto/bn/bn_x931p.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_x931p.c,v 1.6 2015/02/09 15:49:22 jsing Exp $ */ +/* $OpenBSD: bn_x931p.c,v 1.7 2015/02/14 15:07:54 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -107,11 +107,11 @@ BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, const BIGNUM *Xp, return 0; BN_CTX_start(ctx); - if (p1 != NULL) { + if (p1 == NULL) { if ((p1 = BN_CTX_get(ctx)) == NULL) goto err; } - if (p2 != NULL) { + if (p2 == NULL) { if ((p2 = BN_CTX_get(ctx)) == NULL) goto err; } @@ -252,11 +252,11 @@ BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1, int ret = 0; BN_CTX_start(ctx); - if (Xp1 != NULL) { + if (Xp1 == NULL) { if ((Xp1 = BN_CTX_get(ctx)) == NULL) goto error; } - if (Xp2 != NULL) { + if (Xp2 == NULL) { if ((Xp2 = BN_CTX_get(ctx)) == NULL) goto error; } -- cgit v1.2.3-55-g6feb