aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/compat/ui_openssl_win.c42
1 files changed, 0 insertions, 42 deletions
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}