annotate OrthancFramework/Resources/Patches/openssl-3.1.0.patch @ 5376:4ab905749aed

fix Housekeeper plugin triggers configuration
author Alain Mazy <am@osimis.io>
date Tue, 22 Aug 2023 16:35:22 +0200
parents bd25d1c33362
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5233
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
1 diff -urEb openssl-3.1.0.orig/crypto/riscvcap.c openssl-3.1.0/crypto/riscvcap.c
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
2 --- openssl-3.1.0.orig/crypto/riscvcap.c 2023-03-14 13:59:07.000000000 +0100
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
3 +++ openssl-3.1.0/crypto/riscvcap.c 2023-04-04 17:18:21.018468423 +0200
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
4 @@ -37,7 +37,8 @@
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
5
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
6 static void strtoupper(char *str)
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
7 {
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
8 - for (char *x = str; *x; ++x)
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
9 + char* x;
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
10 + for (x = str; *x; ++x)
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
11 *x = toupper(*x);
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
12 }
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
13
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
14 @@ -51,12 +52,13 @@
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
15 {
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
16 char envstrupper[BUFLEN];
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
17 char buf[BUFLEN];
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
18 + size_t i;
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
19
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
20 /* Convert env str to all uppercase */
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
21 OPENSSL_strlcpy(envstrupper, envstr, sizeof(envstrupper));
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
22 strtoupper(envstrupper);
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
23
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
24 - for (size_t i = 0; i < kRISCVNumCaps; ++i) {
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
25 + for (i = 0; i < kRISCVNumCaps; ++i) {
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
26 /* Prefix capability with underscore in preparation for search */
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
27 BIO_snprintf(buf, BUFLEN, "_%s", RISCV_capabilities[i].name);
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
28 if (strstr(envstrupper, buf) != NULL) {
5228
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 diff -urEb openssl-3.1.0.orig/providers/implementations/rands/seeding/rand_unix.c openssl-3.1.0/providers/implementations/rands/seeding/rand_unix.c
5233
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
30 --- openssl-3.1.0.orig/providers/implementations/rands/seeding/rand_unix.c 2023-03-14 13:59:07.000000000 +0100
bd25d1c33362 fix compatibility of openssl 3.1.0 with ANSI C
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5228
diff changeset
31 +++ openssl-3.1.0/providers/implementations/rands/seeding/rand_unix.c 2023-04-04 17:17:43.874649403 +0200
5228
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 @@ -452,6 +452,7 @@
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 * system call and this should always succeed which renders
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * this alternative but essentially identical source moot.
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 */
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 +#if !defined(__LSB_VERSION__) // "syscall()" is not available in LSB
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 if (uname(&un) == 0) {
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 kernel[0] = atoi(un.release);
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 p = strchr(un.release, '.');
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 @@ -462,6 +463,7 @@
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 return 0;
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 }
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 }
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 +#endif
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 /* Open /dev/random and wait for it to be readable */
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 if ((fd = open(DEVRANDOM_WAIT, O_RDONLY)) != -1) {
993a6b23f032 upgraded to openssl 3.1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 if (DEVRANDM_WAIT_USE_SELECT && fd < FD_SETSIZE) {