summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-07-29 08:37:33 +0000
committertb <>2022-07-29 08:37:33 +0000
commit564e3b57f90beb721bbd5a7f969b056710dea91b (patch)
treef01cf2153ffeda606e94d877ba8ee51dc2b08088 /src
parentf77e3e4e56676ad31b3ba549cf5f382c7d01ce2b (diff)
downloadopenbsd-564e3b57f90beb721bbd5a7f969b056710dea91b.tar.gz
openbsd-564e3b57f90beb721bbd5a7f969b056710dea91b.tar.bz2
openbsd-564e3b57f90beb721bbd5a7f969b056710dea91b.zip
Having a perfect square at this point is not an error. Rather it is
a shortcut bypassing expensive computation, so change goto err to goto done. Bug introduced in last refactoring before commit.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/bn/bn_bpsw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_bpsw.c b/src/lib/libcrypto/bn/bn_bpsw.c
index ef3b829cad..93d43afff3 100644
--- a/src/lib/libcrypto/bn/bn_bpsw.c
+++ b/src/lib/libcrypto/bn/bn_bpsw.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_bpsw.c,v 1.4 2022/07/29 08:32:20 tb Exp $ */ 1/* $OpenBSD: bn_bpsw.c,v 1.5 2022/07/29 08:37:33 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Martin Grenouilloux <martin.grenouilloux@lse.epita.fr> 3 * Copyright (c) 2022 Martin Grenouilloux <martin.grenouilloux@lse.epita.fr>
4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -248,7 +248,7 @@ bn_strong_lucas_selfridge(int *is_prime, const BIGNUM *n, BN_CTX *ctx)
248 goto err; 248 goto err;
249 if (is_perfect_square) { 249 if (is_perfect_square) {
250 *is_prime = 0; 250 *is_prime = 0;
251 goto err; 251 goto done;
252 } 252 }
253 253
254 /* 254 /*