feat:
--READ smash_read_this.txt
This commit is contained in:
commit
1ddf693260
181 files changed
+66527
No files matched your search
@@ -0,0 +1,45 @@
|
||||
# README
|
||||
|
||||
Please add optional dependencies in this folder
|
||||
|
||||
## TLS Support
|
||||
|
||||
At the moment there are two different options for TLS support.
|
||||
|
||||
* mbedtls 2.28 supports TLS version 1.2, 1.1 and older versions of TLS
|
||||
* mbedtls 3.6 supports TLS versions 1.2 and 1.3
|
||||
|
||||
### mbedtls 2.28
|
||||
|
||||
For TLS support with mbedtls 2.28 download the source tarball of version 2.28.x and extract here in the subfolder (Version 2.28.10 https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-2.28.10/mbedtls-2.28.10.tar.bz2)
|
||||
|
||||
On a Linux command line enter the following commands in this directory:
|
||||
|
||||
wget https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-2.28.10/mbedtls-2.28.10.tar.bz2
|
||||
tar xfj mbedtls-2.28.10.tar.bz2
|
||||
|
||||
To allow session resumption within an ongoing TLS connection (required by IEC 62351-3:2023) a patch (mbedtls_2.28_ssl_srv.c.patch) has to be applied to the mbedtls source code:
|
||||
|
||||
patch mbedtls-2.28.10/library/ssl_srv.c mbedtls_2.28_ssl_srv.c.patch
|
||||
|
||||
When running cmake the build system will automatically find the mbedtls source code and includes it into the library build.
|
||||
|
||||
When using make the make command has to be invoked with the WITH_MBEDTLS=1 parameter
|
||||
|
||||
make WITH_MBEDTLS=1
|
||||
|
||||
### mbedtls 3.6
|
||||
|
||||
For TLS support with mbedtls 3.6 download the source tarball of version 3.6.x and extract here in the subfolder (Version 3.6.2 https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.2/mbedtls-3.6.2.tar.bz2)
|
||||
|
||||
On a Linux command line enter the following commands in this directory:
|
||||
|
||||
wget https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.2/mbedtls-3.6.2.tar.bz2
|
||||
tar xfj mbedtls-3.6.2.tar.bz2
|
||||
|
||||
When running cmake the build system will automatically find the mbedtls source code and includes it into the library build.
|
||||
|
||||
When using make the make command has to be invoked with the WITH_MBEDTLS3=1 parameter
|
||||
|
||||
make WITH_MBEDTLS3=1
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
--- orig/mbedtls-2.28.10/library/ssl_srv.c 2025-03-24 11:49:00.000000000 +0000
|
||||
+++ mbedtls-2.28.10/library/ssl_srv.c 2026-01-30 18:15:47.656423746 +0000
|
||||
@@ -2691,15 +2691,36 @@
|
||||
if (session->id_len == 0) {
|
||||
return;
|
||||
}
|
||||
- if (ssl->conf->f_get_cache == NULL) {
|
||||
- return;
|
||||
- }
|
||||
#if defined(MBEDTLS_SSL_RENEGOTIATION)
|
||||
if (ssl->renego_status != MBEDTLS_SSL_INITIAL_HANDSHAKE) {
|
||||
+ if (ssl->session != NULL &&
|
||||
+ ssl->session->id_len == session->id_len &&
|
||||
+ memcmp(ssl->session->id, session->id, session->id_len) == 0 &&
|
||||
+ mbedtls_ssl_session_copy(session, ssl->session) == 0) {
|
||||
+ MBEDTLS_SSL_DEBUG_MSG(3, ("renegotiation: resuming existing session"));
|
||||
+ ssl->handshake->resume = 1;
|
||||
+ ssl->secure_renegotiation = MBEDTLS_SSL_SECURE_RENEGOTIATION;
|
||||
+
|
||||
+ /* call session cache just to inform application about session resumption */
|
||||
+ if (ssl->conf->f_get_cache != NULL) {
|
||||
+ mbedtls_ssl_session_init(&session_tmp);
|
||||
+
|
||||
+ session_tmp.id_len = session->id_len;
|
||||
+ memcpy(session_tmp.id, session->id, session->id_len);
|
||||
+
|
||||
+ ret = ssl->conf->f_get_cache(ssl->conf->p_cache,
|
||||
+ &session_tmp);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
+ if (ssl->conf->f_get_cache == NULL) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
mbedtls_ssl_session_init(&session_tmp);
|
||||
|
||||
session_tmp.id_len = session->id_len;
|
||||
Reference in new issue
Block a user