summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlteo <>2015-09-12 15:04:06 +0000
committerlteo <>2015-09-12 15:04:06 +0000
commitb6b9746992a205b72af1ef1e0f427cbe3eb1a096 (patch)
treebf88bdd1d7e2530030ef6294668edc34d80a57e0 /src
parent5b9ca35cbf458add3c0c5e9326f133e7ab812cb9 (diff)
downloadopenbsd-b6b9746992a205b72af1ef1e0f427cbe3eb1a096.tar.gz
openbsd-b6b9746992a205b72af1ef1e0f427cbe3eb1a096.tar.bz2
openbsd-b6b9746992a205b72af1ef1e0f427cbe3eb1a096.zip
Fix the openssl(1) prime command: When checking a decimal number for
primality, do not unnecessarily convert the original decimal number to hex in the output. Hex numbers explicitly specified with -hex remain unchanged. ok beck@ deraadt@ jsing@ miod@
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/prime.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/usr.bin/openssl/prime.c b/src/usr.bin/openssl/prime.c
index 673abc2405..55fac455e9 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.7 2015/08/22 16:36:05 jsing Exp $ */ 1/* $OpenBSD: prime.c,v 1.8 2015/09/12 15:04:06 lteo 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 *
@@ -177,8 +177,7 @@ prime_main(int argc, char **argv)
177 } 177 }
178 } 178 }
179 179
180 BN_print(bio_out, bn); 180 BIO_printf(bio_out, "%s is %sprime\n", prime,
181 BIO_printf(bio_out, " is %sprime\n",
182 BN_is_prime_ex(bn, prime_config.checks, 181 BN_is_prime_ex(bn, prime_config.checks,
183 NULL, NULL) ? "" : "not "); 182 NULL, NULL) ? "" : "not ");
184 } 183 }