diff options
author | tb <> | 2023-04-17 19:51:05 +0000 |
---|---|---|
committer | tb <> | 2023-04-17 19:51:05 +0000 |
commit | 479d1af67b76ef61da4df1b019d68b21407471f6 (patch) | |
tree | 78ef1be4678519c1ff8b8cbb03c3c03eee265a5d | |
parent | 4517d0d13b1eb3468dce44006ddf046cd152156e (diff) | |
download | openbsd-479d1af67b76ef61da4df1b019d68b21407471f6.tar.gz openbsd-479d1af67b76ef61da4df1b019d68b21407471f6.tar.bz2 openbsd-479d1af67b76ef61da4df1b019d68b21407471f6.zip |
Allow overriding the bc implementation used in run-bc
While base bc is great, it uses libcrypto's BIGNUM implementation.
This implies that the independent verification of the bn_test isn't
as independent as it should be.
With this commit, run-bc picks up bn-gh if it is installed. This appears
to work on amd64, arm64 and sparc64 (where gbc is busted). I will send
PRs to the regress maintainers once I will have tested this a bit more
thoroughly. Committing this early since I juggle way too many diffs
already.
-rw-r--r-- | src/regress/lib/libcrypto/bn/Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/bn/Makefile b/src/regress/lib/libcrypto/bn/Makefile index 2ba1d396dd..9d9d77ae2d 100644 --- a/src/regress/lib/libcrypto/bn/Makefile +++ b/src/regress/lib/libcrypto/bn/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.30 2023/04/17 19:37:18 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.31 2023/04/17 19:51:05 tb Exp $ |
2 | 2 | ||
3 | PROGS += bn_add_sub | 3 | PROGS += bn_add_sub |
4 | PROGS += bn_cmp | 4 | PROGS += bn_cmp |
@@ -53,10 +53,15 @@ CLEANFILES += bn_isqrt_gen_tables.txt.tmp bn_isqrt_gen_tables.txt | |||
53 | run-regress-bn_test bn_test.out: bn_test | 53 | run-regress-bn_test bn_test.out: bn_test |
54 | ./bn_test -out bn_test.out | 54 | ./bn_test -out bn_test.out |
55 | 55 | ||
56 | .if exists(/usr/local/bin/bc-gh) | ||
57 | BC ?= bc-gh | ||
58 | .endif | ||
59 | BC ?= bc | ||
60 | |||
56 | REGRESS_TARGETS += run-bc | 61 | REGRESS_TARGETS += run-bc |
57 | .PHONY: run-bc | 62 | .PHONY: run-bc |
58 | run-bc: bn_test.out | 63 | run-bc: bn_test.out |
59 | bc < $> | tee bc.out | grep -v '^0$$' | 64 | ${BC} < $> | tee bc.out | grep -v '^0$$' |
60 | ! grep -v '^test ' <bc.out | grep -v '^0$$' | 65 | ! grep -v '^test ' <bc.out | grep -v '^0$$' |
61 | 66 | ||
62 | CLEANFILES += bn_test.out bc.out | 67 | CLEANFILES += bn_test.out bc.out |