diff options
author | jsing <> | 2015-02-14 15:07:54 +0000 |
---|---|---|
committer | jsing <> | 2015-02-14 15:07:54 +0000 |
commit | 2791a64273a747cd4e23d72ddbe479c32314b754 (patch) | |
tree | 632867cbd8951ad79ca3f94690ea7fe9086441cb | |
parent | 5e65bc8b3214d70ba366a05d9640e405be041e6e (diff) | |
download | openbsd-2791a64273a747cd4e23d72ddbe479c32314b754.tar.gz openbsd-2791a64273a747cd4e23d72ddbe479c32314b754.tar.bz2 openbsd-2791a64273a747cd4e23d72ddbe479c32314b754.zip |
Fix tests that got incorrectly inverted with the BN_CTX_get() return check
diff.
Spotted by miod@
-rw-r--r-- | src/lib/libcrypto/bn/bn_x931p.c | 10 | ||||
-rw-r--r-- | 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 @@ | |||
1 | /* $OpenBSD: bn_x931p.c,v 1.6 2015/02/09 15:49:22 jsing Exp $ */ | 1 | /* $OpenBSD: bn_x931p.c,v 1.7 2015/02/14 15:07:54 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2005. | 3 | * project 2005. |
4 | */ | 4 | */ |
@@ -107,11 +107,11 @@ BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, const BIGNUM *Xp, | |||
107 | return 0; | 107 | return 0; |
108 | 108 | ||
109 | BN_CTX_start(ctx); | 109 | BN_CTX_start(ctx); |
110 | if (p1 != NULL) { | 110 | if (p1 == NULL) { |
111 | if ((p1 = BN_CTX_get(ctx)) == NULL) | 111 | if ((p1 = BN_CTX_get(ctx)) == NULL) |
112 | goto err; | 112 | goto err; |
113 | } | 113 | } |
114 | if (p2 != NULL) { | 114 | if (p2 == NULL) { |
115 | if ((p2 = BN_CTX_get(ctx)) == NULL) | 115 | if ((p2 = BN_CTX_get(ctx)) == NULL) |
116 | goto err; | 116 | goto err; |
117 | } | 117 | } |
@@ -252,11 +252,11 @@ BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1, | |||
252 | int ret = 0; | 252 | int ret = 0; |
253 | 253 | ||
254 | BN_CTX_start(ctx); | 254 | BN_CTX_start(ctx); |
255 | if (Xp1 != NULL) { | 255 | if (Xp1 == NULL) { |
256 | if ((Xp1 = BN_CTX_get(ctx)) == NULL) | 256 | if ((Xp1 = BN_CTX_get(ctx)) == NULL) |
257 | goto error; | 257 | goto error; |
258 | } | 258 | } |
259 | if (Xp2 != NULL) { | 259 | if (Xp2 == NULL) { |
260 | if ((Xp2 = BN_CTX_get(ctx)) == NULL) | 260 | if ((Xp2 = BN_CTX_get(ctx)) == NULL) |
261 | goto error; | 261 | goto error; |
262 | } | 262 | } |
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 @@ | |||
1 | /* $OpenBSD: bn_x931p.c,v 1.6 2015/02/09 15:49:22 jsing Exp $ */ | 1 | /* $OpenBSD: bn_x931p.c,v 1.7 2015/02/14 15:07:54 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2005. | 3 | * project 2005. |
4 | */ | 4 | */ |
@@ -107,11 +107,11 @@ BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, const BIGNUM *Xp, | |||
107 | return 0; | 107 | return 0; |
108 | 108 | ||
109 | BN_CTX_start(ctx); | 109 | BN_CTX_start(ctx); |
110 | if (p1 != NULL) { | 110 | if (p1 == NULL) { |
111 | if ((p1 = BN_CTX_get(ctx)) == NULL) | 111 | if ((p1 = BN_CTX_get(ctx)) == NULL) |
112 | goto err; | 112 | goto err; |
113 | } | 113 | } |
114 | if (p2 != NULL) { | 114 | if (p2 == NULL) { |
115 | if ((p2 = BN_CTX_get(ctx)) == NULL) | 115 | if ((p2 = BN_CTX_get(ctx)) == NULL) |
116 | goto err; | 116 | goto err; |
117 | } | 117 | } |
@@ -252,11 +252,11 @@ BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1, | |||
252 | int ret = 0; | 252 | int ret = 0; |
253 | 253 | ||
254 | BN_CTX_start(ctx); | 254 | BN_CTX_start(ctx); |
255 | if (Xp1 != NULL) { | 255 | if (Xp1 == NULL) { |
256 | if ((Xp1 = BN_CTX_get(ctx)) == NULL) | 256 | if ((Xp1 = BN_CTX_get(ctx)) == NULL) |
257 | goto error; | 257 | goto error; |
258 | } | 258 | } |
259 | if (Xp2 != NULL) { | 259 | if (Xp2 == NULL) { |
260 | if ((Xp2 = BN_CTX_get(ctx)) == NULL) | 260 | if ((Xp2 = BN_CTX_get(ctx)) == NULL) |
261 | goto error; | 261 | goto error; |
262 | } | 262 | } |