summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-02-14 15:07:55 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-02-14 15:07:55 +0000
commitc276fc6674b0af2498c1ae8e63377dd275bfe509 (patch)
tree476282ce7acebc9db1bf13a8a16f982d8b49c7b2 /lib/libcrypto
parent30a48f07f231afbb13c863d4256e76c9cb127fa3 (diff)
Fix tests that got incorrectly inverted with the BN_CTX_get() return check
diff. Spotted by miod@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/bn/bn_x931p.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libcrypto/bn/bn_x931p.c b/lib/libcrypto/bn/bn_x931p.c
index 89c86c1ff70..13abd5923c3 100644
--- a/lib/libcrypto/bn/bn_x931p.c
+++ b/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;
}