summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/usr.bin/openssl/prime.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/usr.bin/openssl/prime.c b/src/usr.bin/openssl/prime.c
index 280ccef5fc..5e1ad70ca0 100644
--- a/src/usr.bin/openssl/prime.c
+++ b/src/usr.bin/openssl/prime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: prime.c,v 1.11 2018/02/07 05:47:55 jsing Exp $ */ 1/* $OpenBSD: prime.c,v 1.12 2019/01/20 01:59:06 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2004 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2004 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -116,7 +116,7 @@ prime_main(int argc, char **argv)
116 char *prime = NULL; 116 char *prime = NULL;
117 BIO *bio_out; 117 BIO *bio_out;
118 char *s; 118 char *s;
119 int ret = 1; 119 int is_prime, ret = 1;
120 120
121 if (single_execution) { 121 if (single_execution) {
122 if (pledge("stdio rpath", NULL) == -1) { 122 if (pledge("stdio rpath", NULL) == -1) {
@@ -184,9 +184,13 @@ prime_main(int argc, char **argv)
184 } 184 }
185 } 185 }
186 186
187 is_prime = BN_is_prime_ex(bn, prime_config.checks, NULL, NULL);
188 if (is_prime < 0) {
189 BIO_printf(bio_err, "BN_is_prime_ex failed.\n");
190 goto end;
191 }
187 BIO_printf(bio_out, "%s is %sprime\n", prime, 192 BIO_printf(bio_out, "%s is %sprime\n", prime,
188 BN_is_prime_ex(bn, prime_config.checks, 193 is_prime == 1 ? "" : "not ");
189 NULL, NULL) ? "" : "not ");
190 } 194 }
191 195
192 ret = 0; 196 ret = 0;