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
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
Andy Green
3454cd1f8a test: async dns: handle dynamic ads on warmcat
We use warmcat dns for testing, but for a while it has become dynamic
breaking the tests.

Fix up the affected tests with IPv4 addresses from getaddrinfo() so they
pass when they match these results.
2023-11-09 12:04:47 +00:00
Andy Green
48e09ddf51 clean: pedantic: remove repeated typedefs
https://github.com/warmcat/libwebsockets/issues/3002
2023-11-08 07:27:18 +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
Javier Navarro
ec6d5ac6d5 ios: Remove the support for bitcode 2022-09-19 11:01:22 +01:00
Andy Green
b35128118e lws_map: stop c++ compiler complaints 2022-09-19 07:49:42 +01:00
Andy Green
34ef70ab00 docs: compressed remaining_pack_payload case
https://github.com/warmcat/libwebsockets/issues/2683
2022-09-18 08:29:16 +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
Lorenzo Arena
fc58ddbdb1 minimal-examples-lowlevel: fix misleading comment for the conceal value 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
9700773296 tests: disable tests with jig rot
A couple of tests can't work because the peer setup they rely on has rotted
on the peer side.
2022-09-18 08:17:25 +01:00
Andy Green
af64c7fc4f http proxy: fix host 2022-09-18 08:17:20 +01:00
Vladimir
8ab44ae28b client: win32: sul for client connection status polling
https://github.com/warmcat/libwebsockets/pull/2715
https://github.com/warmcat/libwebsockets/pull/2722
2022-09-18 06:16:14 +01:00
Damian Hobson-Garcia
a5ea6eabca remove LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY callback
When a certificate for a TLS connection is provided, but a private
key is not, the SSL_CTX initialization exits early, before the
CONTEXT_REQUIRES_PRIVATE_KEY callback can be issued.
Remove the now obsolete callback and update the vhost
field description to state that the LOAD_EXTRA_SERVER_VERIFY_CERTS
callback should be used instead.
2022-09-18 06:13:47 +01:00
Martlaak
50f32d0da2 windows: allow serving files open for write
https://github.com/warmcat/libwebsockets/issues/2713
2022-08-23 12:56:08 +01:00
Dmitry Potapov
162e11e530 vhost: remove from defer binding on destroy
If a vhost is removed, it should remove references to it from the
defer binding list to avoid dangling pointers, which can crash the
application.
2022-08-17 08:57:37 +01:00
Andy Green
ac17bde9d9 zstream 2022-08-05 19:45:07 +01:00
Arenoros
e3ed2ba690 From a966322704 Mon Sep 17 00:00:00 2001
Subject: [PATCH] fix build on QNX 6.5.0
2022-07-13 06:24:12 +01:00
qdztxc
173c84a595 ws: tell caller we closed wsi on handshake failure
https://github.com/warmcat/libwebsockets/issues/2681
2022-07-12 09:47:56 +01:00
Andy Green
608688b308 upng-gzip: fuzz: size temp arrays to worst huff size
https://oss-fuzz.com/testcase-detail/5964400971874304

The original upng code this is based on just sizes the temp buffers for 15,
but the trees can come in 19, 32, or 288 lengths.  Set the buffer sizes for
the worst case.

Add some asserts to help catch any further problems more directly.
2022-07-11 17:54:02 +01:00
Andy Green
523c921206 win32: zip header path 2022-07-09 19:38:15 +01:00
Andy Green
6fb072d5c9 upng-gzip: fuzz: fix unsigned overflow
https://github.com/warmcat/libwebsockets/issues/2687
2022-07-05 07:12:32 +01:00
Andy Green
4d7175ddd8 ss: policy: reject lack of server tls cert when tls used
https://github.com/warmcat/libwebsockets/issues/2686
2022-07-04 15:49:13 +01:00
Marco Gratzke
c28b390e77 spa: file upload fix 2022-07-04 14:23:02 +01:00
Poljak181
b0b4f0dd56 logs: setup earlier so we can use on fail path
https://github.com/warmcat/libwebsockets/issues/2679
2022-06-29 17:21:43 +01:00
Ammar Faizi
dcca7a514d ss: Fix clang build error
When building with clang-15, I got the following error:
```
  error: variable 'm' set but not used [-Werror,-Wunused-but-set-variable]
          int n, m = 0;
                 ^
```
Let's just remove the `m` variable here, it's not used.

Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-06-22 06:19:28 +01:00
Mike Tettinger
a5612fbb9a test-apps: use correct EXTERNAL_POLL flag 2022-06-17 04:52:17 +01:00