-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [ssl] Add mbedtls 3 compatibility This means that mbedtls 3 is supported for dynamic builds * [ci] Use mbedtls3 for dynamic mac build * [cmake] Update to mbedtls 3.6 for static builds Use MBEDTLS_USER_CONFIG_FILE instead of patching the sources. * [ssl] Initialize PSA crypto when it is present. In mbedtls 3.6 TLS 1.3 support is turned on by default which uses PSA crypto See HaxeFoundation/hashlink#681 * [ci] Build on ubuntu bionic instead of xenial Xenial went EoL in 2021, and we cannot build new mbedtls versions on it. * [ssl] Fix mbedtls compilation errors on windows * [ssl] Link bcrypt on windows * [ssl] Define mbedtls config file when compiling ssl.c --------- Co-authored-by: Apprentice-Alchemist <[email protected]>
- Loading branch information
1 parent
7f280c5
commit 31e9db6
Showing
7 changed files
with
55 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,5 @@ | ||
# Apply config adjustments similer to Debian's | ||
# https://anonscm.debian.org/cgit/collab-maint/mbedtls.git/tree/debian/patches/01_config.patch | ||
|
||
set(config ${MbedTLS_source}/include/mbedtls/config.h) | ||
|
||
file(READ ${config} content) | ||
|
||
if (WIN32) | ||
# allow alternate threading implementation | ||
string(REPLACE | ||
"//#define MBEDTLS_THREADING_ALT" | ||
"#define MBEDTLS_THREADING_ALT" | ||
content "${content}" | ||
) | ||
# disable the TCP/IP networking routines | ||
# such that it wouldn't interfere with the #include <windows.h> in our threading_alt.h | ||
string(REPLACE | ||
"#define MBEDTLS_NET_C" | ||
"//#define MBEDTLS_NET_C" | ||
content "${content}" | ||
) | ||
|
||
file(COPY ${source}/libs/ssl/threading_alt.h | ||
DESTINATION ${MbedTLS_source}/include/mbedtls/ | ||
) | ||
else() | ||
# enable pthread mutexes | ||
string(REPLACE | ||
"//#define MBEDTLS_THREADING_PTHREAD" | ||
"#define MBEDTLS_THREADING_PTHREAD" | ||
content "${content}" | ||
) | ||
endif() | ||
|
||
# enable the HAVEGE random generator | ||
string(REPLACE | ||
"//#define MBEDTLS_HAVEGE_C" | ||
"#define MBEDTLS_HAVEGE_C" | ||
content "${content}" | ||
) | ||
# enable support for (rare) MD2-signed X.509 certs | ||
string(REPLACE | ||
"//#define MBEDTLS_MD2_C" | ||
"#define MBEDTLS_MD2_C" | ||
content "${content}" | ||
) | ||
# enable support for (rare) MD4-signed X.509 certs | ||
string(REPLACE | ||
"//#define MBEDTLS_MD4_C" | ||
"#define MBEDTLS_MD4_C" | ||
content "${content}" | ||
) | ||
# allow use of mutexes within mbed TLS | ||
string(REPLACE | ||
"//#define MBEDTLS_THREADING_C" | ||
"#define MBEDTLS_THREADING_C" | ||
content "${content}" | ||
) | ||
|
||
file(WRITE ${config} "${content}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifdef _WIN32 | ||
#define MBEDTLS_THREADING_ALT | ||
#endif | ||
#ifndef _WIN32 | ||
#define MBEDTLS_THREADING_PTHREAD | ||
#endif | ||
|
||
#undef MBEDTLS_NET_C | ||
|
||
#define MBEDTLS_THREADING_C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#define WIN32_LEAN_AND_MEAN | ||
#include <windows.h> | ||
|
||
typedef struct | ||
|