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
957503436e http: mounts: LWSMPRO_NO_MOUNT
Provide a way to apply exception mount urls that exist on top of a larger
mount, but provide an exception which enforces the url to not be serviced
by the mount code, but by whatever dynamic handler is in place.
2023-12-12 05:57:38 +00:00
Andy Green
5e43b7039c ss: server: adopt 2023-12-10 09:18:52 +00:00
Andy Green
56d07ec06c ss: support raw file 2023-12-10 09:16:13 +00:00
Andy Green
44d9bc08f5 ss: lws_ss_get_vhost 2023-12-09 07:59:04 +00:00
Ilya Smelykh
fdfde2ce0b http: auth digest 2023-12-08 10:25:50 +00:00
Andy Green
42cb5ffbbe ss: server: allow back-back TXN 2023-12-08 07:25:12 +00:00
Andy Green
dab8e1c4f8 mac length: switch to ETHER_ADDR_LEN
Long story, there's also minimal example to take care of.

This change should take care of anything with ETHER_ADDR_LEN in
net/ethernet.h plus windows, for both the lib and example.
2023-12-07 05:31:25 +00:00
Philippe Ombredanne
b391e1141a License: Fix typo in MIT text in fsmount.c
Somehow, a string replacement of ns by fsm had damaged
the license text and introduced garbage.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2023-11-27 09:44:13 +00:00
Lonny Wong
8d4079884b pmd: revert #3014 and drain extensions before next ssl read 2023-11-24 05:51:46 +00:00
Andy Green
4af988600f net: lws_wol() and lws_parse_mac()
Introduce a LWS_WITH_WOL and an api to wake a mac address, optionally with
an address bind to the local interface to go out on.

Add a helper to parse ascii mac addresses well, and add tests.

Also thanks to OgreTransporter
https://github.com/warmcat/libwebsockets/issues/3016
2023-11-24 05:44:42 +00:00
Andy Green
24c37d1ea1 h2: reply with selected extension 2023-11-23 09:45:12 +00:00
Luka Kudra
8eb89bafb1 mbedtls: dont rely on potentially missing version api
https://github.com/warmcat/libwebsockets/issues/3013
2023-11-23 09:45:12 +00:00
Lonny Wong
57d539ef51 pmd: fix buffer being reused while draining extensions 2023-11-23 09:45:12 +00:00
zzblydia
5442cf7ebf cmake: ssl lib paths
replace PC_OPENSSL_LIBRARIES with PC_OPENSSL_LINK_LIBRARIES to link library with absolute path.
2023-11-23 09:45:12 +00:00
Orgad Shaneh
a1cda26305 windows: evade unused var warnings when logs disabled
https://github.com/warmcat/libwebsockets/pull/2792
2023-11-23 09:45:12 +00:00
Khem Raj
a07699d269 gcc: fix mbedtls missing enum
bcd970fb4f
2023-11-23 09:45:12 +00:00
Lonny Wong
4d6322d5b6 libuv: fix idle being stopped when there is still pending stuff
https://github.com/warmcat/libwebsockets/pull/3008
2023-11-23 09:45:12 +00:00
tjwalton
83eeb76d66 server: Always return result of _lws_vhost_init_server_af
Fixes https://github.com/warmcat/libwebsockets/issues/2702
2023-11-23 09:45:12 +00:00
Earl Robsham
8c4c5e6a21 pt_destroy: possible leaking pipe side
Updates the `lws_pt_destroy()` logic to ensure the pipe fds are closed if either `pt->dummy_pipe_fds[0]` or `pt->dummy_pipe_fds[1]` are still valid (previously was only checking `pt->dummy_pipe_fds[0]` which was resulting in the write fd to leak whenever a context was destroyed).
2023-11-23 09:45:12 +00:00
johnnychen
9f44863e07 tls: fix ssl connection error in raw connection 2023-11-23 09:45:12 +00:00
Max van Kessel
3fa129172a dbus: prevent double free timeout event
SUL callback triggers a dbus timeout handle, handle removes the linked
list entry and free's the memory attached to the entry. Remove the code
where the the entry was removed by the timer callback, which triggered
a double free of the same linked list entry.
2023-11-23 09:45:12 +00:00
Edward Zhang
9202017c27 pmd: fix ws parser for non pmd packet with pmd ext enabled 2023-11-23 09:45:11 +00:00
Daren Hayward
22621f30be b64: lws_b64_decode_stateful truncates response
Addresses issue #2855 by allowing the parsing of the final byte when there are at least 3 bytes remaining in the buffer.

For every 4 bytes of input, a maximum of 3 bytes of output are generated when decoding the base64 string. The buffer space, therefore, only requires an additional 3 bytes of space. The code checks for space in the buffer before adding null termination.
2023-11-23 09:45:11 +00:00
Andy Green
e5a9126e83 buflist: append: treat NULL additional buf as error not assert
Very very occasionally on server we try to add a NULL buffer to a buflist.

Let's try dealing with that by failing (caller must always be able to
handle failure from OOM) rather than asserting.
2023-11-23 09:45:11 +00:00
Carsten Schuette
52597bf012 clean: gcc13 false positive uninitialized
https://github.com/warmcat/libwebsockets/issues/3004
2023-11-23 09:45:11 +00:00
Ogre Transporter
65f977c7de msvc: avoid error about mixed ellipsis and cond
https://github.com/warmcat/libwebsockets/issues/3001
2023-11-07 06:31:45 +00:00
Andy Green
26c3f9a01b tls: mbedtls-3.5.0: correct privkey size 2023-11-05 08:25:59 +00:00
Andy Green
407f88615f mbedtls: if we have tls1.2 only accept exactly that 2023-11-02 09:57:32 +00:00
Andy Green
2da771b129 cmake: mbedtls: mbedtls_ssl_conf_alpn_protocols check 2023-11-02 09:55:50 +00:00
Andy Green
05e08a511a mbedtls: print library version 2023-11-02 08:07:58 +00:00
Andy Green
e71398c02a mbedtls: auto adapt to changed session constant 2023-10-31 10:51:20 +00:00
Andy Green
816544f1d6 ss: http: support PATCH
https://github.com/warmcat/libwebsockets/issues/2989
2023-10-27 06:15:42 +01:00
Nate Karstens
d4c9158d88 openssl: Add lws ctx ref to client vhost's SSL_CTX
Adds a reference to the libwebsockets context to the OpenSSL context
used by the client vhost. This allows SSL info callbacks to work
correctly for clients, like it currently does for servers.

Co-authored-by: Marty Flickinger <marty.flickinger@garmin.com>
Signed-off-by: Marty Flickinger <marty.flickinger@garmin.com>
Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
2023-10-24 07:00:13 +01:00
zoraaver
a1cbc02aeb Add guard for setrlimit
LWS_HAVE_SYS_RESOURCE_H is correctly set by lws to prevent including
sys/resource.h. However there is no corresponding guard for setrlimit (a
function from that header). This causes a build failure on platforms
which don't have sys/resource.h available.
2023-10-21 07:22:09 +01:00
Audric Schiltknecht
5736786391 openssl: Properly report OpenSSL error in lws_tls_client_connect
In case of an SSL_ERROR_SSL in lws_tls_client_connect, the
lws_ssl_get_error call was calling lws_tls_err_describe_clear which
cleared the OpenSSL error from the stack. Thus, the tls.err_helper
attribute was set to the default value from ERR_error_string_n, masking
the actual OpenSSL error message from client code.
2023-10-21 07:00:01 +01:00
Dylan Taft
18fdb0d6ec ipv6: Add support for RFC5014 for Linux
Linux has a sockopt flag defined by RFC5014 that informs IPv6 systems with
SLAAC config to prefer to bind the socket to a public address instead of
any temporary private address.

This patch adds a client info flag LCCSCF_IPV6_PREFER_PUBLIC_ADDR that lets
the user indicate the client socket should be prepared with the public
address binding preference.

Currently it's only implemented on Linux.
2023-10-15 07:54:50 +01:00
Daniel Danzberger
4144c1e61b mbedtls-server: Fix broken client verification
This fixes clients being able to connect with a certicate that was not
signed by the configured CA when SSL_VERIFY_FAIL_IF_NO_PEER_CERT is set.

The issue only appeared when a client connects via IP address directly and
not use a hostname.

When the hostname was used to connect, the SNI 'callback lws_mbedtls_sni_cb'
overwrote the invalid verfiy mode of
MBEDTLS_SSL_VERIFY_OPTIONAL with MBEDTLS_SSL_VERIFY_REQUIRED by
calling SSL_set_SSL_CTX.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2023-09-28 11:06:05 +01:00
Mark Butowski
7ef2065fdf netlink: fix errant route delete on NEWADDR
NEWADDR was errantly deleting route entities, specifically it happend
to delete IPv6 route entries causing a disconnect of all IPv6 clients.
NEWADDR can be issued on a DHCP lease renew, which does not change any
of the routes.

Code was also cleaned up a bit, and added some helpful logging.
2023-09-24 08:27:04 +01:00
wangyingdong
07778789f4 Introducing libwebsockets support for nuttx
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-09-21 13:08:16 +01:00
Philippe Coval
a6a7fa646e fix: l/r/h/http2.c: Fix spelling mistake
Fix spelling mistake it was found while packaging mosquito for debian:

I: mosquitto: spelling-error-in-binary Inital Initial [usr/sbin/mosquitto]
I: mosquitto: spelling-error-in-binary witholding withholding [usr/sbin/mosquitto]

Forwarded: https://github.com/warmcat/libwebsockets/pull/2927
Signed-off-by: Philippe Coval <rzr@users.sf.net>
2023-09-21 13:08:11 +01:00
Andy Green
f9d1f25abe openssl-server: enum vs int disagreement
https://github.com/warmcat/libwebsockets/issues/2907
2023-06-14 07:14:51 +01:00
Andy Green
e8eb7d6bd6 dlo: add render_to_rgba 2023-02-10 06:03:43 +00:00
Andy Green
b35128118e lws_map: stop c++ compiler complaints 2022-09-19 07:49:42 +01:00
Andy Green
c2d7e33eeb ss-server: allow UPGRADE to UPGRADE
https://github.com/warmcat/libwebsockets/issues/2725
2022-09-18 08:23:01 +01:00
Sylvain Saunier
6a55f448e2 tls: alpn for client 2022-09-18 08:18:22 +01:00
Dmitry Potapov
bfbd80967a openssl3: change deprecated warnings suppression 2022-09-18 08:17:25 +01:00
songbuhuang
237506fed1 delete_from_fd: assert if fd beyond the max_fds
Signed-off-by: songbuhuang <544824346@qq.com>
2022-09-18 08:17:25 +01:00
songbuhuang
2c981f7670 clean: unreachable cruft
Signed-off-by: songbuhuang <544824346@qq.com>
2022-09-18 08:17:25 +01:00
Andy Green
03c7ce7365 win32: correct include path 2022-09-18 08:17:25 +01:00
Andy Green
af64c7fc4f http proxy: fix host 2022-09-18 08:17:20 +01:00