summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-04-17 19:51:05 +0000
committertb <>2023-04-17 19:51:05 +0000
commit479d1af67b76ef61da4df1b019d68b21407471f6 (patch)
tree78ef1be4678519c1ff8b8cbb03c3c03eee265a5d
parent4517d0d13b1eb3468dce44006ddf046cd152156e (diff)
downloadopenbsd-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/Makefile9
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
3PROGS += bn_add_sub 3PROGS += bn_add_sub
4PROGS += bn_cmp 4PROGS += bn_cmp
@@ -53,10 +53,15 @@ CLEANFILES += bn_isqrt_gen_tables.txt.tmp bn_isqrt_gen_tables.txt
53run-regress-bn_test bn_test.out: bn_test 53run-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)
57BC ?= bc-gh
58.endif
59BC ?= bc
60
56REGRESS_TARGETS += run-bc 61REGRESS_TARGETS += run-bc
57.PHONY: run-bc 62.PHONY: run-bc
58run-bc: bn_test.out 63run-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
62CLEANFILES += bn_test.out bc.out 67CLEANFILES += bn_test.out bc.out