diff options
author | Theo Buehler <tb@openbsd.org> | 2022-12-18 01:16:15 +0100 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2022-12-18 01:16:15 +0100 |
commit | da826ecc77a941f88a13287ad1e1034a3086f389 (patch) | |
tree | 30c67c75a94ad3d426afe3230314db86a04177b6 /patches/bn_shift.patch | |
parent | 8c4425cd5305bde35f340df47af5b26a457623d3 (diff) | |
download | portable-da826ecc77a941f88a13287ad1e1034a3086f389.tar.gz portable-da826ecc77a941f88a13287ad1e1034a3086f389.tar.bz2 portable-da826ecc77a941f88a13287ad1e1034a3086f389.zip |
Disable bn_shift benchmarks on Windows
Windows doesn't know about SIGALRM
Diffstat (limited to 'patches/bn_shift.patch')
-rw-r--r-- | patches/bn_shift.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/bn_shift.patch b/patches/bn_shift.patch new file mode 100644 index 0000000..f0298a2 --- /dev/null +++ b/patches/bn_shift.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | --- tests/bn_shift.c.orig Sun Dec 18 01:05:29 2022 | ||
2 | +++ tests/bn_shift.c Sun Dec 18 01:15:00 2022 | ||
3 | @@ -26,6 +26,10 @@ | ||
4 | |||
5 | #include <openssl/bn.h> | ||
6 | |||
7 | +#ifndef _MSC_VER | ||
8 | +#define INCLUDE_BENCHMARKS | ||
9 | +#endif | ||
10 | + | ||
11 | static const char *bn_shift_want_hex = \ | ||
12 | "02AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" \ | ||
13 | "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8"; | ||
14 | @@ -314,6 +318,8 @@ test_bn_rshift_to_zero(void) | ||
15 | return failed; | ||
16 | } | ||
17 | |||
18 | +#ifdef INCLUDE_BENCHMARKS | ||
19 | + | ||
20 | static void | ||
21 | benchmark_bn_lshift1(BIGNUM *bn) | ||
22 | { | ||
23 | @@ -507,9 +513,12 @@ benchmark_run(const struct benchmark *bm, int seconds) | ||
24 | BN_free(bn); | ||
25 | } | ||
26 | |||
27 | +#endif | ||
28 | + | ||
29 | static void | ||
30 | benchmark_bn_shift(void) | ||
31 | { | ||
32 | +#ifdef INCLUDE_BENCHMARKS | ||
33 | const struct benchmark *bm; | ||
34 | size_t i; | ||
35 | |||
36 | @@ -517,6 +526,9 @@ benchmark_bn_shift(void) | ||
37 | bm = &benchmarks[i]; | ||
38 | benchmark_run(bm, 5); | ||
39 | } | ||
40 | +#else | ||
41 | + return; | ||
42 | +#endif | ||
43 | } | ||
44 | |||
45 | int | ||