aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2023-11-01 20:50:15 -0500
committerBrent Cook <busterb@gmail.com>2023-11-01 20:50:15 -0500
commit1a5be425a9a6720cc367b1c298610a7a41a2fb3d (patch)
tree83b2395eb98309e7d13f69b99946097f1d6790c6 /crypto
parent18f5064a9d12117f87570e69c4fb923d86e7bd57 (diff)
parent548b3d0485c0ad00c6041670c2192c4b5bd80e66 (diff)
downloadportable-1a5be425a9a6720cc367b1c298610a7a41a2fb3d.tar.gz
portable-1a5be425a9a6720cc367b1c298610a7a41a2fb3d.tar.bz2
portable-1a5be425a9a6720cc367b1c298610a7a41a2fb3d.zip
Land #922, build fixes for various platforms
Diffstat (limited to 'crypto')
-rw-r--r--crypto/CMakeLists.txt3
-rw-r--r--crypto/Makefile.am.macosx-x86_641
-rw-r--r--crypto/compat/ui_openssl_win.c42
3 files changed, 2 insertions, 44 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index d61e607..7efb143 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -111,7 +111,6 @@ if(HOST_ASM_MACOSX_X86_64)
111 bn/arch/amd64/word_clz.S 111 bn/arch/amd64/word_clz.S
112 bn/arch/amd64/bn_arch.c 112 bn/arch/amd64/bn_arch.c
113 ) 113 )
114 add_definitions(-Dendbr64=)
115 add_definitions(-DAES_ASM) 114 add_definitions(-DAES_ASM)
116 add_definitions(-DBSAES_ASM) 115 add_definitions(-DBSAES_ASM)
117 add_definitions(-DVPAES_ASM) 116 add_definitions(-DVPAES_ASM)
@@ -153,6 +152,7 @@ if(HOST_ASM_MASM_X86_64)
153 whrlpool/wp-masm-x86_64.S 152 whrlpool/wp-masm-x86_64.S
154 cpuid-masm-x86_64.S 153 cpuid-masm-x86_64.S
155 ) 154 )
155 add_definitions(-Dendbr64=)
156 add_definitions(-DAES_ASM) 156 add_definitions(-DAES_ASM)
157 add_definitions(-DBSAES_ASM) 157 add_definitions(-DBSAES_ASM)
158 add_definitions(-DVPAES_ASM) 158 add_definitions(-DVPAES_ASM)
@@ -193,6 +193,7 @@ if(HOST_ASM_MINGW64_X86_64)
193 whrlpool/wp-mingw64-x86_64.S 193 whrlpool/wp-mingw64-x86_64.S
194 cpuid-mingw64-x86_64.S 194 cpuid-mingw64-x86_64.S
195 ) 195 )
196 add_definitions(-Dendbr64=)
196 add_definitions(-DAES_ASM) 197 add_definitions(-DAES_ASM)
197 add_definitions(-DBSAES_ASM) 198 add_definitions(-DBSAES_ASM)
198 add_definitions(-DVPAES_ASM) 199 add_definitions(-DVPAES_ASM)
diff --git a/crypto/Makefile.am.macosx-x86_64 b/crypto/Makefile.am.macosx-x86_64
index 219a7ac..b9b89cf 100644
--- a/crypto/Makefile.am.macosx-x86_64
+++ b/crypto/Makefile.am.macosx-x86_64
@@ -34,7 +34,6 @@ ASM_X86_64_MACOSX += bn/arch/amd64/bn_arch.c
34EXTRA_DIST += $(ASM_X86_64_MACOSX) 34EXTRA_DIST += $(ASM_X86_64_MACOSX)
35 35
36if HOST_ASM_MACOSX_X86_64 36if HOST_ASM_MACOSX_X86_64
37libcrypto_la_CPPFLAGS += -Dendbr64=
38libcrypto_la_CPPFLAGS += -DAES_ASM 37libcrypto_la_CPPFLAGS += -DAES_ASM
39libcrypto_la_CPPFLAGS += -DBSAES_ASM 38libcrypto_la_CPPFLAGS += -DBSAES_ASM
40libcrypto_la_CPPFLAGS += -DVPAES_ASM 39libcrypto_la_CPPFLAGS += -DVPAES_ASM
diff --git a/crypto/compat/ui_openssl_win.c b/crypto/compat/ui_openssl_win.c
index c245111..b6a621f 100644
--- a/crypto/compat/ui_openssl_win.c
+++ b/crypto/compat/ui_openssl_win.c
@@ -139,9 +139,6 @@ static int is_a_tty;
139 139
140/* Declare static functions */ 140/* Declare static functions */
141static int read_till_nl(FILE *); 141static int read_till_nl(FILE *);
142static void recsig(int);
143static void pushsig(void);
144static void popsig(void);
145static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl); 142static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl);
146 143
147static int read_string(UI *ui, UI_STRING *uis); 144static int read_string(UI *ui, UI_STRING *uis);
@@ -236,8 +233,6 @@ read_till_nl(FILE *in)
236 return 1; 233 return 1;
237} 234}
238 235
239static volatile sig_atomic_t intr_signal;
240
241static int 236static int
242read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl) 237read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
243{ 238{
@@ -247,12 +242,9 @@ read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
247 int maxsize = BUFSIZ - 1; 242 int maxsize = BUFSIZ - 1;
248 char *p; 243 char *p;
249 244
250 intr_signal = 0;
251 ok = 0; 245 ok = 0;
252 ps = 0; 246 ps = 0;
253 247
254 pushsig();
255
256 ps = 1; 248 ps = 1;
257 249
258 if (!echo && !noecho_console(ui)) 250 if (!echo && !noecho_console(ui))
@@ -276,16 +268,11 @@ read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
276 ok = 1; 268 ok = 1;
277 269
278error: 270error:
279 if (intr_signal == SIGINT)
280 ok = -1;
281 if (!echo) 271 if (!echo)
282 fprintf(tty_out, "\n"); 272 fprintf(tty_out, "\n");
283 if (ps >= 2 && !echo && !echo_console(ui)) 273 if (ps >= 2 && !echo && !echo_console(ui))
284 ok = 0; 274 ok = 0;
285 275
286 if (ps >= 1)
287 popsig();
288
289 explicit_bzero(result, BUFSIZ); 276 explicit_bzero(result, BUFSIZ);
290 return ok; 277 return ok;
291} 278}
@@ -348,32 +335,3 @@ close_console(UI *ui)
348 335
349 return 1; 336 return 1;
350} 337}
351
352/* Internal functions to handle signals and act on them */
353static void
354pushsig(void)
355{
356 savsig[SIGABRT] = signal(SIGABRT, recsig);
357 savsig[SIGFPE] = signal(SIGFPE, recsig);
358 savsig[SIGILL] = signal(SIGILL, recsig);
359 savsig[SIGINT] = signal(SIGINT, recsig);
360 savsig[SIGSEGV] = signal(SIGSEGV, recsig);
361 savsig[SIGTERM] = signal(SIGTERM, recsig);
362}
363
364static void
365popsig(void)
366{
367 signal(SIGABRT, savsig[SIGABRT]);
368 signal(SIGFPE, savsig[SIGFPE]);
369 signal(SIGILL, savsig[SIGILL]);
370 signal(SIGINT, savsig[SIGINT]);
371 signal(SIGSEGV, savsig[SIGSEGV]);
372 signal(SIGTERM, savsig[SIGTERM]);
373}
374
375static void
376recsig(int i)
377{
378 intr_signal = i;
379}