comparison OrthancFramework/Resources/Patches/openssl-3.0.1.patch @ 4861:d1aae7c3dd5d openssl-3.x

upgraded openssl to 3.0.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 24 Dec 2021 17:12:49 +0100
parents
children
comparison
equal deleted inserted replaced
4860:3e9a76464e8a 4861:d1aae7c3dd5d
1 diff -urEb openssl-3.0.1.orig/crypto/threads_win.c openssl-3.0.1/crypto/threads_win.c
2 --- openssl-3.0.1.orig/crypto/threads_win.c 2021-12-24 16:56:23.016304241 +0100
3 +++ openssl-3.0.1/crypto/threads_win.c 2021-12-24 16:58:09.436272646 +0100
4 @@ -207,13 +207,30 @@
5 int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
6 CRYPTO_RWLOCK *lock)
7 {
8 +#if defined(_WIN32) && !defined(_WIN64)
9 + /**
10 + * Prevents the following error, at least on Visual Studio 2008,
11 + * but most probably on any Window 32bit system:
12 + * "CoreLibrary.lib(threads_win.obj) : error LNK2019: unresolved
13 + * external symbol _InterlockedOr64 referenced in function
14 + * _CRYPTO_atomic_or". TODO - The lock should be locked!
15 + * https://developercommunity.visualstudio.com/t/-interlockedexchangeadd64-is-unresolved-on-x86/1227636
16 + **/
17 + *ret = (*val) | op;
18 +#else
19 *ret = (uint64_t)InterlockedOr64((LONG64 volatile *)val, (LONG64)op) | op;
20 +#endif
21 return 1;
22 }
23
24 int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)
25 {
26 +#if defined(_WIN32) && !defined(_WIN64)
27 + /* See comment above */
28 + *ret = *val;
29 +#else
30 *ret = (uint64_t)InterlockedOr64((LONG64 volatile *)val, 0);
31 +#endif
32 return 1;
33 }
34
35 diff -urEb openssl-3.0.1.orig/providers/implementations/rands/seeding/rand_unix.c openssl-3.0.1/providers/implementations/rands/seeding/rand_unix.c
36 --- openssl-3.0.1.orig/providers/implementations/rands/seeding/rand_unix.c 2021-12-24 16:56:23.056304227 +0100
37 +++ openssl-3.0.1/providers/implementations/rands/seeding/rand_unix.c 2021-12-24 16:57:03.408290650 +0100
38 @@ -453,6 +453,7 @@
39 * system call and this should always succeed which renders
40 * this alternative but essentially identical source moot.
41 */
42 +#if !defined(__LSB_VERSION__) // "syscall()" is not available in LSB
43 if (uname(&un) == 0) {
44 kernel[0] = atoi(un.release);
45 p = strchr(un.release, '.');
46 @@ -463,6 +464,7 @@
47 return 0;
48 }
49 }
50 +#endif
51 /* Open /dev/random and wait for it to be readable */
52 if ((fd = open(DEVRANDOM_WAIT, O_RDONLY)) != -1) {
53 if (DEVRANDM_WAIT_USE_SELECT && fd < FD_SETSIZE) {