1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

3778 commits

Author SHA1 Message Date
Andy Green
ef4a85d0e1 ws: ext header is already delimited if present 2025-03-05 07:11:22 +00:00
makejian
a656eb5f1b mbedtls/ssl: free cert chain when mbedtls_client_preload_filepath enabled
Signed-off-by: makejian <makejian@xiaomi.com>
2025-03-03 07:40:34 +00:00
Andy Green
a9b8fe7ebf ws: delimit ws upgrade protocol when exts available
https://github.com/warmcat/libwebsockets/issues/3151
2025-03-03 07:31:09 +00:00
Daniel Danzberger
4c50636912 unix: Fix linker errors when building without sdevent
When building without systemd event support (-DLWS_WITH_SDEVENT=OFF) on
a system that has libsystemd headers installed, lib/plat/unix-systemd.c
is build in anyway.
The final libwebsockets library has then references to symbols from
libsystemd even though it won't be linked.

Resulting in the follwoing linker errros:
--
/usr/bin/ld: /usr/local/lib/libwebsockets.so: undefined reference to `sd_is_socket_inet'
/usr/bin/ld: /usr/local/lib/libwebsockets.so: undefined reference to `sd_is_socket_unix'
/usr/bin/ld: /usr/local/lib/libwebsockets.so: undefined reference to `sd_listen_fds'
--

This commit ensures that unix-system.c is only build when LWS_WITH_SDEVENT is set and
the system has libsystemd headers installed.

Signed-off-by: Daniel Danzberger <dd@embedd.com>
2025-03-01 08:13:50 +00:00
Martin Quinson
53f8384732 PkgConfig: include libsystemd if needed by lib 2025-02-28 17:21:11 +00:00
Andy Green
4a23c07bf4 async dns: allow up to 8 x 128-char CNAMEs from 4
https://github.com/warmcat/libwebsockets/issues/3329

Extra ~600 bytes stack needed might be a struggle for RTOS, trimmed from 10
recommended in issue.
2025-02-27 07:41:00 +00:00
Andy Green
b71445eb43 lws_mux_mark_immortal: remove noisy log 2025-02-25 19:34:29 +00:00
Andy Green
4b1b4a4caa lws_tls_openssl_asn1time_to_unix: fix 13 char asn1 epoch
Also align to struct tm's year epoch of 1900

https://github.com/warmcat/libwebsockets/issues/3341
2025-02-24 12:41:07 +00:00
Andy Green
f3613b4b74 google-fuzzer: avoid warnings about c / c++ size diff 2025-02-14 16:09:57 +00:00
Andy Green
2ffb8c6d5e sll_protocol may be be16
Google's fuzzer platform blows a warning

/src/libwebsockets/lib/plat/unix/unix-sockets.c:497:21: warning: implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to '__be16' (aka 'unsigned short') [-Wimplicit-int-conversion]
  497 |         sll.sll_protocol = (uint32_t)(htons((uint16_t)0x800));
2025-02-14 16:09:44 +00:00
Davidovory03
207d634fc0 mbedtls: translate error codes for caller
https://github.com/warmcat/libwebsockets/issues/3315
2025-01-22 08:43:45 +00:00
Andy Green
fb6a7c8131 coverity 472861: http2: deal with zero length data without overflow 2025-01-22 08:43:45 +00:00
Andy Green
aff5bb43e4 coverity 472860: ops-h2: let coverity see all err enums covered
x
2025-01-22 08:43:45 +00:00
Andy Green
f835779a74 coverity 472863: cookies: length check order wrong 2025-01-22 08:43:45 +00:00
Andy Green
70dc6783e0 coverity 472859: jpeg restart_interval 2025-01-22 08:43:45 +00:00
Andy Green
8e0e0b91df coverity 872858: hash gen overflow false positive
Help it ignore that we use the MS 7 bits in the next part of the operation
and discard it in the first part.
2025-01-22 08:43:45 +00:00
Andy Green
04707231d2 coverity 472862: cookiejar overflow 2025-01-22 08:43:36 +00:00
Albert Ribes
1fccae47ed lejp: E implies float
Since eg, 1e-3 is a float without needing a decimal point, let's just
generally take it that anything with the exponent token is a float, ie, 1e3
is also a float despite it can be expressed as an integer.

This seems right also because E is itself not valid in an integer.

https://github.com/warmcat/libwebsockets/issues/3308
2025-01-10 13:59:09 +00:00
Andy Green
d568eccd4c spa: use sized local info rather than incoming
We allow a default 0 length in the incoming const info to mean a default
size (of 512).  We implement it by copying the incoming const info to a
copy in the spa that we can adapt, which is all good.

But in two cases after we dumbly use the incoming const info directly
instead of the adapted copy.

https://github.com/warmcat/libwebsockets/issues/3294
2024-12-13 09:22:26 +00:00
Lucas
6328231f2a mbedtls: fix issue about memory leak
https://github.com/warmcat/libwebsockets/issues/3177
2024-11-08 07:57:25 +00:00
Andy Green
4393edf1a5 esp-idf-update 2024-11-03 07:59:12 +00:00
Andy Green
d026f6d1b6 idf: cleanups 2024-11-03 07:59:12 +00:00
Andy Green
0fbe31e00b spi: read 2024-11-03 07:59:12 +00:00
stropee
e04a3cf132 http: pipeline: handle methods lacking COMPLETED_CLIENT_HTTP
Signed-off-by: stropee <simon@sirocha.fr>
2024-11-03 07:59:04 +00:00
stropee
ea00ad2076 http: pipeline: enable for more methods
Signed-off-by: stropee <simon@sirocha.fr>
2024-11-03 07:58:59 +00:00
Orgad Shaneh
8263a6814e clean: var unused when no logs 2024-11-02 09:37:27 +00:00
Jeongik Cha
367ba7efe1 mbedtls: fix verify_mode properly in LWS_HAVE_mbedtls_ssl_set_hs_authmode as well 2024-11-02 09:36:41 +00:00
Jeongik Cha
84e640ddb8 mbedtls: verify_mode should match to auth_mode
SSL_VERIFY_PEER->MBEDTLS_SSL_VERIFY_REQUIRED
SSL_VERIFY_FAIL_IF_NO_PEER_CERT->MBEDTLS_SSL_VERIFY_OPTIONAL
2024-11-02 09:36:34 +00:00
Jeongik Cha
319b2e74c3 mbedtls: client: check cert exists and is valid
It should be SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, but it was only SSL_VERIFY_FAIL_IF_NO_PEER_CERT, so it didn't verify the cert, it only checked its existence.

To fix that, turn on both just like openssl-server.c does.
2024-11-02 09:36:26 +00:00
zzblydia
c1b609db4f lws_snprintf: check null pointer before using 2024-11-02 09:36:19 +00:00
makejian
2718a4572f mbedtls-client: Enable the version number is correct
After mbedtls version 3.0, support for TLS 1.0 and 1.1 has been removed. For details, please see https://github.com/Mbed-TLS/mbedtls/issues/4286.
If use a new version of mbedtls, connection errors may occur due to version reasons. So we hope it can be configured according to the supported version.

Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-31 16:14:00 +00:00
Andy Green
032adce8c3 minimal: add note about binding mount 2024-10-31 15:20:11 +00:00
Orgad Shaneh
c3a5c097ce tls-sessions: Pass correct type for printf %u 2024-10-06 08:10:51 +01:00
Orgad Shaneh
0336ff058e win: simplify error logging in windows-sockets.c 2024-10-03 05:27:48 +01:00
Orgad Shaneh
994278eff3 unix-file: Fix signed/unsigned implicit conversion 2024-10-03 05:21:43 +01:00
Andy Green
5f3d5e3a3d custom_event: fake_POLLIN_override
As discussed in

https://github.com/warmcat/libwebsockets/issues/3219
2024-09-30 12:49:08 +01:00
Andy Green
78a6d17aa2 mbedtls: provide declaration if ge 3.5
https://github.com/warmcat/libwebsockets/issues/3169
2024-09-29 11:50:00 +01:00
Andy Green
9dbbd45170 lws_get_urlarg_by_name: drop candidates that wont fit in buf rather than bail
https://github.com/warmcat/libwebsockets/issues/3227
2024-09-28 06:03:06 +01:00
Andy Green
c60bff0991 ws: extensions: allow h2 headers
https://github.com/warmcat/libwebsockets/issues/3151
2024-09-26 06:13:05 +01:00
Andy Green
da61d4df06 win: file: use INVALID_HANDLE_VALUE directly
c571d22dba (commitcomment-142753910)
2024-09-25 12:25:05 +01:00
Andy Green
082443ff25 netdev: BIND_TO_DEVICE 2024-09-25 10:43:29 +01:00
stropee
6bf61482b2 freertos: extra do_ripe 2024-09-25 10:30:24 +01:00
Andy Green
4f32b715ce win: trigger context destroy if pt destroying itself
https://github.com/warmcat/libwebsockets/issues/3182

This follows the flow for *nix
2024-09-25 09:36:29 +01:00
iwashiira
a7e21153b0 upng: implement stricter integer overflow check
https://github.com/warmcat/libwebsockets/pull/3156
2024-09-25 09:08:30 +01:00
Andy Green
0a5a701cfc event: blow error if runtime context options want eventlib we dont have
https://github.com/warmcat/libwebsockets/issues/3186
2024-09-25 09:04:14 +01:00
Andy Green
e975bae1e6 ws: increase sanity check for spins needed to consume buffer to 100
https://github.com/warmcat/libwebsockets/issues/3184
2024-09-25 08:52:53 +01:00
Andy Green
b486c2b545 pipe: only pt destroy pipe close should close pipe fds
https://github.com/warmcat/libwebsockets/issues/2873
2024-09-25 08:42:44 +01:00
Andy Green
2b47b276d4 win32: upscale timeout_ms to 64-bit int
This may help with this:

https://github.com/warmcat/libwebsockets/issues/3201
2024-09-25 07:12:50 +01:00
Andy Green
11b99188f8 without-server: adapt loops to not touch listen_list
https://github.com/warmcat/libwebsockets/issues/3203
2024-09-25 07:02:12 +01:00
Andy Green
6112189aac unix-sockets: extra care around short for some toolchains
https://github.com/warmcat/libwebsockets/issues/3163
2024-09-25 06:46:25 +01:00