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

4776 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
Andy Green
d67dd81b0e libsystemd: require LWS_WITH_SDEVENT for socketact example 2025-03-02 08:48:56 +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
Glen Mabey
216af745e3 Subject: docs: fix typo 2025-02-26 06:37:42 +00:00
Andy Green
b71445eb43 lws_mux_mark_immortal: remove noisy log 2025-02-25 19:34:29 +00:00
Mark Adler
3f7c79fd57 win32port: zlib: upstream bugfix patch on inftrees.c
From 6a043145ca6e9c55184013841a67b2fef87e44c0 Mon Sep 17 00:00:00 2001
Subject: [PATCH] Remove offset pointer optimization in inftrees.c.

inftrees.c was subtracting an offset from a pointer to an array,
in order to provide a pointer that allowed indexing starting at
the offset. This is not compliant with the C standard, for which
the behavior of a pointer decremented before its allocated memory
is undefined. Per the recommendation of a security audit of the
zlib code by Trail of Bits and TrustInSoft, in support of the
Mozilla Foundation, this tiny optimization was removed, in order
to avoid the possibility of undefined behavior.
2025-02-24 12:41:19 +00:00
Andy Green
0689fc82ca dos2unix: win32port/zlib/inftrees.c 2025-02-24 12:41:17 +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
75849aa83b minimal-ss-binance-update-path 2025-02-14 17:53:50 +00:00
Andy Green
19d2e9d828 minimal-ss-binance-update-CA 2025-02-14 16:10:00 +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
a74362ffdd examples: ss server: correct README 2024-12-18 07:24:07 +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
626f8816cf esp-idf: update compatibility to 5.3.1 2024-11-03 07:59:12 +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
John Harrison
3da6939728 cmake: Added option to disable libcap
https://github.com/warmcat/libwebsockets/pull/3260
2024-11-02 09:36:48 +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
Alexandre Snarskii
6b950e8666 cmake: improve net/ethernet.h header detection 2024-10-08 05:47:46 +01: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
4c3f13eda0 win: change uid_t and gid_t from int to unsigned int
Like they are on Linux.
2024-10-03 05:24:54 +01:00
Orgad Shaneh
994278eff3 unix-file: Fix signed/unsigned implicit conversion 2024-10-03 05:21:43 +01:00
Orgad Shaneh
56cc214ac7 win32: zlib: Fix buffer overflow on inflate (CVE-2022-37434) 2024-10-03 05:14:15 +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