Mercurial > hg > orthanc
annotate Resources/Patches/openssl-lsb.diff @ 2521:6db878376018
support anonymization of CurrentRequestedProcedureEvidenceSequence
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Apr 2018 17:59:16 +0200 |
parents | 6a3e2ca7a7a0 |
children |
rev | line source |
---|---|
566
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 --- ui_openssl.c.orig 2013-09-24 15:06:54.264420779 +0200 |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 +++ ui_openssl.c 2013-09-24 14:22:43.512312998 +0200 |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 @@ -291,7 +291,7 @@ |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 static unsigned short channel = 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 #else |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 #if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 -static TTY_STRUCT tty_orig,tty_new; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 +//static TTY_STRUCT tty_orig,tty_new; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 #endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 #endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 static FILE *tty_in, *tty_out; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 @@ -475,106 +475,21 @@ |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 /* Internal functions to open, handle and close a channel to the console. */ |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 static int open_console(UI *ui) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 { |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 - CRYPTO_w_lock(CRYPTO_LOCK_UI); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 - is_a_tty = 1; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 - |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 -#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 - tty_in=stdin; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 - tty_out=stderr; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 -#else |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 -# ifdef OPENSSL_SYS_MSDOS |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 -# define DEV_TTY "con" |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 -# else |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 -# define DEV_TTY "/dev/tty" |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 -# endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 - if ((tty_in=fopen(DEV_TTY,"r")) == NULL) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 - tty_in=stdin; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 - if ((tty_out=fopen(DEV_TTY,"w")) == NULL) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 - tty_out=stderr; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 - |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 -#if defined(TTY_get) && !defined(OPENSSL_SYS_VMS) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 - if (TTY_get(fileno(tty_in),&tty_orig) == -1) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 - { |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 -#ifdef ENOTTY |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 - if (errno == ENOTTY) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 - is_a_tty=0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 - else |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 -#ifdef EINVAL |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 - /* Ariel Glenn ariel@columbia.edu reports that solaris |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 - * can return EINVAL instead. This should be ok */ |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 - if (errno == EINVAL) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 - is_a_tty=0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 - else |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 - return 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 - } |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 -#ifdef OPENSSL_SYS_VMS |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 - status = sys$assign(&terminal,&channel,0,0); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 - if (status != SS$_NORMAL) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 - return 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 - status=sys$qiow(0,channel,IO$_SENSEMODE,&iosb,0,0,tty_orig,12,0,0,0,0); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 - if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL)) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 - return 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 return 1; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 } |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 static int noecho_console(UI *ui) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 { |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 -#ifdef TTY_FLAGS |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 - memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig)); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 - tty_new.TTY_FLAGS &= ~ECHO; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 - |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 -#if defined(TTY_set) && !defined(OPENSSL_SYS_VMS) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 - if (is_a_tty && (TTY_set(fileno(tty_in),&tty_new) == -1)) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 - return 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 -#ifdef OPENSSL_SYS_VMS |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 - tty_new[0] = tty_orig[0]; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 - tty_new[1] = tty_orig[1] | TT$M_NOECHO; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 - tty_new[2] = tty_orig[2]; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 - status = sys$qiow(0,channel,IO$_SETMODE,&iosb,0,0,tty_new,12,0,0,0,0); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 - if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL)) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 - return 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 return 1; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 } |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 static int echo_console(UI *ui) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 { |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 -#if defined(TTY_set) && !defined(OPENSSL_SYS_VMS) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 - memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig)); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 - tty_new.TTY_FLAGS |= ECHO; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 - |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 -#if defined(TTY_set) && !defined(OPENSSL_SYS_VMS) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 - if (is_a_tty && (TTY_set(fileno(tty_in),&tty_new) == -1)) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 - return 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 -#ifdef OPENSSL_SYS_VMS |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 - tty_new[0] = tty_orig[0]; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 - tty_new[1] = tty_orig[1] & ~TT$M_NOECHO; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 - tty_new[2] = tty_orig[2]; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 - status = sys$qiow(0,channel,IO$_SETMODE,&iosb,0,0,tty_new,12,0,0,0,0); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 - if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL)) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 - return 0; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 return 1; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 } |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 static int close_console(UI *ui) |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 { |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 - if (tty_in != stdin) fclose(tty_in); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 - if (tty_out != stderr) fclose(tty_out); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 -#ifdef OPENSSL_SYS_VMS |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 - status = sys$dassgn(channel); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 -#endif |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 - CRYPTO_w_unlock(CRYPTO_LOCK_UI); |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 - |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 return 1; |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 } |
6a3e2ca7a7a0
the client library compiles with LSB 4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 |