mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-08 16:11:18 +00:00
Merge pull request #3650 from cesanta/wolf
fix WolfSSL not working on built-in TCP/IP
This commit is contained in:
3 files changed
+32
-6
No files matched your search
@@ -78,10 +78,6 @@ jobs:
|
|||||||
cc: [gcc, clang, g++, clang++]
|
cc: [gcc, clang, g++, clang++]
|
||||||
target: [mip_test, mip_tap_test]
|
target: [mip_test, mip_tap_test]
|
||||||
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
|
ssl: ["", BUILTIN, MBEDTLS, OPENSSL, WOLFSSL]
|
||||||
# #3226: built-in TCP is currently not working with WolfSSL (builds fine)
|
|
||||||
exclude:
|
|
||||||
- ssl: WOLFSSL
|
|
||||||
target: mip_tap_test
|
|
||||||
name: ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }}
|
name: ${{ matrix.target }} CC=${{ matrix.cc }} SSL=${{ matrix.ssl }}
|
||||||
env:
|
env:
|
||||||
CC: ${{ matrix.cc }}
|
CC: ${{ matrix.cc }}
|
||||||
@@ -94,6 +90,26 @@ jobs:
|
|||||||
- uses: webfactory/ssh-agent@v0.10.0
|
- uses: webfactory/ssh-agent@v0.10.0
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.HEALTH_TESTS_SSH_KEY }}
|
ssh-private-key: ${{ secrets.HEALTH_TESTS_SSH_KEY }}
|
||||||
|
# WolfSSL version (5.6.6) in current GH runner (Ubuntu 24.04) is broken for EC
|
||||||
|
# https://github.com/wolfSSL/wolfssl/pull/10065
|
||||||
|
- name: Build non-broken WolfSSL version
|
||||||
|
if: matrix.ssl == 'WOLFSSL'
|
||||||
|
run: |
|
||||||
|
sudo apt -y update
|
||||||
|
sudo apt -y install autoconf automake libtool
|
||||||
|
git clone --depth 1 --branch v5.9.1-stable https://github.com/wolfSSL/wolfssl
|
||||||
|
cd wolfssl
|
||||||
|
./autogen.sh
|
||||||
|
./configure --prefix="$GITHUB_WORKSPACE/wolfssl-install" --enable-all
|
||||||
|
make -j"$(nproc)"
|
||||||
|
make install
|
||||||
|
echo "WOLFSSL=$GITHUB_WORKSPACE/wolfssl-install" >> "$GITHUB_ENV"
|
||||||
|
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
|
||||||
|
if [ "${{ matrix.cc }}" = "g++" ] || [ "${{ matrix.cc }}" = "clang++" ]; then
|
||||||
|
echo "TFLAGS=$TFLAGS -DWOLFSSL_USE_OPTIONS_H -Wno-pedantic" >> "$GITHUB_ENV"
|
||||||
|
else
|
||||||
|
echo "TFLAGS=$TFLAGS -DWOLFSSL_USE_OPTIONS_H" >> "$GITHUB_ENV"
|
||||||
|
fi
|
||||||
- run: if [ "${{ matrix.target }}" == "mip_tap_test" ]; then source ./test/setup_ga_network.sh ; sed -i -e "s/127.0.0.1//" test/mosquitto.conf; cat test/mosquitto.conf; ./test/setup_mqtt_server.sh; fi && sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev && make -C test ${{ matrix.target }} > log
|
- run: if [ "${{ matrix.target }}" == "mip_tap_test" ]; then source ./test/setup_ga_network.sh ; sed -i -e "s/127.0.0.1//" test/mosquitto.conf; cat test/mosquitto.conf; ./test/setup_mqtt_server.sh; fi && sudo apt -y update ; sudo apt -y install libmbedtls-dev libwolfssl-dev && make -C test ${{ matrix.target }} > log
|
||||||
- if: success() || failure()
|
- if: success() || failure()
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+6
-1
@@ -21233,7 +21233,12 @@ size_t mg_tls_pending(struct mg_connection *c) {
|
|||||||
|
|
||||||
long mg_tls_recv(struct mg_connection *c, void *buf, size_t len) {
|
long mg_tls_recv(struct mg_connection *c, void *buf, size_t len) {
|
||||||
struct mg_tls *tls = (struct mg_tls *) c->tls;
|
struct mg_tls *tls = (struct mg_tls *) c->tls;
|
||||||
int n = SSL_read(tls->ssl, buf, (int) len);
|
int n;
|
||||||
|
#if MG_TLS == MG_TLS_WOLFSSL
|
||||||
|
uint8_t dummy; // WolfSSL requires destination != NULL
|
||||||
|
if (buf == NULL && len == 0) buf = &dummy;
|
||||||
|
#endif
|
||||||
|
n = SSL_read(tls->ssl, buf, (int) len);
|
||||||
if (!c->is_tls_hs && (buf == NULL || len == 0) && n == 0) return 0; // MIP
|
if (!c->is_tls_hs && (buf == NULL || len == 0) && n == 0) return 0; // MIP
|
||||||
if (n < 0 && mg_tls_err(c, tls, n) == 0) return MG_IO_WAIT;
|
if (n < 0 && mg_tls_err(c, tls, n) == 0) return MG_IO_WAIT;
|
||||||
if (n <= 0) return MG_IO_ERR;
|
if (n <= 0) return MG_IO_ERR;
|
||||||
|
|||||||
+6
-1
@@ -315,7 +315,12 @@ size_t mg_tls_pending(struct mg_connection *c) {
|
|||||||
|
|
||||||
long mg_tls_recv(struct mg_connection *c, void *buf, size_t len) {
|
long mg_tls_recv(struct mg_connection *c, void *buf, size_t len) {
|
||||||
struct mg_tls *tls = (struct mg_tls *) c->tls;
|
struct mg_tls *tls = (struct mg_tls *) c->tls;
|
||||||
int n = SSL_read(tls->ssl, buf, (int) len);
|
int n;
|
||||||
|
#if MG_TLS == MG_TLS_WOLFSSL
|
||||||
|
uint8_t dummy; // WolfSSL requires destination != NULL
|
||||||
|
if (buf == NULL && len == 0) buf = &dummy;
|
||||||
|
#endif
|
||||||
|
n = SSL_read(tls->ssl, buf, (int) len);
|
||||||
if (!c->is_tls_hs && (buf == NULL || len == 0) && n == 0) return 0; // MIP
|
if (!c->is_tls_hs && (buf == NULL || len == 0) && n == 0) return 0; // MIP
|
||||||
if (n < 0 && mg_tls_err(c, tls, n) == 0) return MG_IO_WAIT;
|
if (n < 0 && mg_tls_err(c, tls, n) == 0) return MG_IO_WAIT;
|
||||||
if (n <= 0) return MG_IO_ERR;
|
if (n <= 0) return MG_IO_ERR;
|
||||||
|
|||||||
Reference in new issue
Block a user