diff options
author | jsing <> | 2022-11-26 13:56:33 +0000 |
---|---|---|
committer | jsing <> | 2022-11-26 13:56:33 +0000 |
commit | bcbac728558eebfaa4404c405e7dc22769585345 (patch) | |
tree | 9f1339c5b70b0cfa4e8a0a5c70345e837a21ce77 /src/lib/libcrypto/bn/bn_prime.c | |
parent | 90d0616c736d954d327f399daa636de8e6a2c4d5 (diff) | |
download | openbsd-bcbac728558eebfaa4404c405e7dc22769585345.tar.gz openbsd-bcbac728558eebfaa4404c405e7dc22769585345.tar.bz2 openbsd-bcbac728558eebfaa4404c405e7dc22769585345.zip |
Remove BIGNUM consistency macros.
Compiling with BN_DEBUG (and if you want to take it further, BN_DEBUG_RAND)
supposedly adds consistency checks to the BN code. These are rarely if ever
used and introduce a bunch of clutter in the code. Furthermore, there are
hacks in place to undo things that the debugging code does.
Remove all of this mess and instead rely on always enabled checks, more
readable code and proper regress coverage to ensure correct behaviour.
"Good riddance." tb@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_prime.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_prime.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_prime.c b/src/lib/libcrypto/bn/bn_prime.c index bf3f931644..0ba288c46a 100644 --- a/src/lib/libcrypto/bn/bn_prime.c +++ b/src/lib/libcrypto/bn/bn_prime.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_prime.c,v 1.26 2022/11/09 22:52:51 tb Exp $ */ | 1 | /* $OpenBSD: bn_prime.c,v 1.27 2022/11/26 13:56:33 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -232,7 +232,6 @@ BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, | |||
232 | err: | 232 | err: |
233 | BN_CTX_end(ctx); | 233 | BN_CTX_end(ctx); |
234 | BN_CTX_free(ctx); | 234 | BN_CTX_free(ctx); |
235 | bn_check_top(ret); | ||
236 | 235 | ||
237 | return found; | 236 | return found; |
238 | } | 237 | } |
@@ -288,7 +287,6 @@ loop: | |||
288 | } | 287 | } |
289 | if (!BN_add_word(rnd, delta)) | 288 | if (!BN_add_word(rnd, delta)) |
290 | return (0); | 289 | return (0); |
291 | bn_check_top(rnd); | ||
292 | return (1); | 290 | return (1); |
293 | } | 291 | } |
294 | 292 | ||
@@ -338,7 +336,6 @@ loop: | |||
338 | 336 | ||
339 | err: | 337 | err: |
340 | BN_CTX_end(ctx); | 338 | BN_CTX_end(ctx); |
341 | bn_check_top(rnd); | ||
342 | return (ret); | 339 | return (ret); |
343 | } | 340 | } |
344 | 341 | ||
@@ -406,6 +403,5 @@ loop: | |||
406 | 403 | ||
407 | err: | 404 | err: |
408 | BN_CTX_end(ctx); | 405 | BN_CTX_end(ctx); |
409 | bn_check_top(p); | ||
410 | return (ret); | 406 | return (ret); |
411 | } | 407 | } |