aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2024-07-13 10:29:30 -0600
committerTheo Buehler <tb@openbsd.org>2024-07-13 10:29:30 -0600
commit2eb32c2e9b9a687d70e454b2d05e54ca913f8014 (patch)
tree851d4ede7ea053d966ac910cf7d98d9840a902e7
parent40d85d8623e8995e101431352488785a4d9b2a7f (diff)
downloadportable-2eb32c2e9b9a687d70e454b2d05e54ca913f8014.tar.gz
portable-2eb32c2e9b9a687d70e454b2d05e54ca913f8014.tar.bz2
portable-2eb32c2e9b9a687d70e454b2d05e54ca913f8014.zip
speed.c is likely broken on Windows, so add a hack
-rw-r--r--patches/speed.c.patch41
1 files changed, 29 insertions, 12 deletions
diff --git a/patches/speed.c.patch b/patches/speed.c.patch
index 4b129f8..1d6d021 100644
--- a/patches/speed.c.patch
+++ b/patches/speed.c.patch
@@ -1,6 +1,6 @@
1--- apps/openssl/speed.c.orig Fri Jul 28 06:04:45 2023 1--- apps/openssl/speed.c.orig Sat Jul 13 10:21:42 2024
2+++ apps/openssl/speed.c Fri Jul 28 06:09:00 2023 2+++ apps/openssl/speed.c Sat Jul 13 10:27:25 2024
3@@ -161,7 +161,16 @@ static void 3@@ -161,7 +161,16 @@
4 pkey_print_message(const char *str, const char *str2, 4 pkey_print_message(const char *str, const char *str2,
5 long num, int bits, int sec); 5 long num, int bits, int sec);
6 static void print_result(int alg, int run_no, int count, double time_used); 6 static void print_result(int alg, int run_no, int count, double time_used);
@@ -17,17 +17,20 @@
17 17
18 #define ALGOR_NUM 32 18 #define ALGOR_NUM 32
19 #define SIZE_NUM 5 19 #define SIZE_NUM 5
20@@ -431,7 +440,9 @@ speed_main(int argc, char **argv) 20@@ -430,9 +439,11 @@
21 const EVP_CIPHER *evp_cipher = NULL; 21 const EVP_CIPHER *evp_cipher = NULL;
22 const EVP_MD *evp_md = NULL; 22 const EVP_MD *evp_md = NULL;
23 int decrypt = 0; 23 int decrypt = 0;
24+#ifndef _WIN32 24+#ifndef _WIN32
25 int multi = 0; 25 int multi = 0;
26- const char *errstr = NULL;
27 struct sigaction sa;
26+#endif 28+#endif
27 const char *errstr = NULL; 29+ const char *errstr = NULL;
28 30
29 if (pledge("stdio proc", NULL) == -1) { 31 if (pledge("stdio proc", NULL) == -1) {
30@@ -506,6 +517,7 @@ speed_main(int argc, char **argv) 32 perror("pledge");
33@@ -506,6 +517,7 @@
31 decrypt = 1; 34 decrypt = 1;
32 j--; /* Otherwise, -decrypt gets confused with an 35 j--; /* Otherwise, -decrypt gets confused with an
33 * algorithm. */ 36 * algorithm. */
@@ -35,7 +38,7 @@
35 } else if (argc > 0 && strcmp(*argv, "-multi") == 0) { 38 } else if (argc > 0 && strcmp(*argv, "-multi") == 0) {
36 argc--; 39 argc--;
37 argv++; 40 argv++;
38@@ -520,6 +532,7 @@ speed_main(int argc, char **argv) 41@@ -520,6 +532,7 @@
39 } 42 }
40 j--; /* Otherwise, -multi gets confused with an 43 j--; /* Otherwise, -multi gets confused with an
41 * algorithm. */ 44 * algorithm. */
@@ -43,7 +46,7 @@
43 } else if (argc > 0 && strcmp(*argv, "-unaligned") == 0) { 46 } else if (argc > 0 && strcmp(*argv, "-unaligned") == 0) {
44 argc--; 47 argc--;
45 argv++; 48 argv++;
46@@ -855,7 +868,9 @@ speed_main(int argc, char **argv) 49@@ -851,7 +864,9 @@
47 BIO_printf(bio_err, "-evp e use EVP e.\n"); 50 BIO_printf(bio_err, "-evp e use EVP e.\n");
48 BIO_printf(bio_err, "-decrypt time decryption instead of encryption (only EVP).\n"); 51 BIO_printf(bio_err, "-decrypt time decryption instead of encryption (only EVP).\n");
49 BIO_printf(bio_err, "-mr produce machine readable output.\n"); 52 BIO_printf(bio_err, "-mr produce machine readable output.\n");
@@ -53,7 +56,7 @@
53 BIO_printf(bio_err, "-unaligned n use buffers with offset n from proper alignment.\n"); 56 BIO_printf(bio_err, "-unaligned n use buffers with offset n from proper alignment.\n");
54 goto end; 57 goto end;
55 } 58 }
56@@ -864,8 +879,10 @@ speed_main(int argc, char **argv) 59@@ -860,8 +875,10 @@
57 j++; 60 j++;
58 } 61 }
59 62
@@ -64,7 +67,21 @@
64 67
65 if (j == 0) { 68 if (j == 0) {
66 for (i = 0; i < ALGOR_NUM; i++) { 69 for (i = 0; i < ALGOR_NUM; i++) {
67@@ -1742,7 +1759,9 @@ speed_main(int argc, char **argv) 70@@ -933,11 +950,13 @@
71 #define COND(c) (run && count<0x7fffffff)
72 #define COUNT(d) (count)
73
74+#ifndef _WIN32
75 memset(&sa, 0, sizeof(sa));
76 sigemptyset(&sa.sa_mask);
77 sa.sa_flags = SA_RESTART;
78 sa.sa_handler = sig_done;
79 sigaction(SIGALRM, &sa, NULL);
80+#endif
81
82 #ifndef OPENSSL_NO_MD4
83 if (doit[D_MD4]) {
84@@ -1743,7 +1762,9 @@
68 ecdh_doit[j] = 0; 85 ecdh_doit[j] = 0;
69 } 86 }
70 } 87 }
@@ -74,7 +91,7 @@
74 if (!mr) { 91 if (!mr) {
75 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION)); 92 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION));
76 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_BUILT_ON)); 93 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_BUILT_ON));
77@@ -1898,11 +1917,15 @@ pkey_print_message(const char *str, const char *str2, 94@@ -1899,11 +1920,15 @@
78 static void 95 static void
79 print_result(int alg, int run_no, int count, double time_used) 96 print_result(int alg, int run_no, int count, double time_used)
80 { 97 {
@@ -90,7 +107,7 @@
90 static char * 107 static char *
91 sstrsep(char **string, const char *delim) 108 sstrsep(char **string, const char *delim)
92 { 109 {
93@@ -2109,4 +2132,5 @@ do_multi(int multi) 110@@ -2104,4 +2129,5 @@
94 free(fds); 111 free(fds);
95 return 1; 112 return 1;
96 } 113 }