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

4519 commits

Author SHA1 Message Date
Andy Green
4415e84c09 v4.3.3 2023-11-20 06:27:02 +00:00
zzblydia
96dffe862d cmake: ssl lib paths
replace PC_OPENSSL_LIBRARIES with PC_OPENSSL_LINK_LIBRARIES to link library with absolute path.
2023-11-19 09:06:22 +00:00
Orgad Shaneh
cd8fb61f3b windows: evade unused var warnings when logs disabled
https://github.com/warmcat/libwebsockets/pull/2792
2023-11-18 05:36:58 +00:00
Khem Raj
59d42bcc74 gcc: fix mbedtls missing enum
bcd970fb4f
2023-11-17 07:07:35 +00:00
Lonny Wong
8a190f2758 libuv: fix idle being stopped when there is still pending stuff
https://github.com/warmcat/libwebsockets/pull/3008
2023-11-16 18:22:31 +00:00
tjwalton
3179273eae server: Always return result of _lws_vhost_init_server_af
Fixes https://github.com/warmcat/libwebsockets/issues/2702
2023-11-15 08:26:46 +00:00
Earl Robsham
7b5a070efc 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-15 08:12:17 +00:00
Edward Zhang
c097a44405 pmd: fix ws parser for non pmd packet with pmd ext enabled 2023-11-13 09:16:16 +00:00
Daren Hayward
ac9e3ba677 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-13 09:15:18 +00:00
Carsten Schuette
08ee6f14de clean: gcc13 false positive uninitialized
https://github.com/warmcat/libwebsockets/issues/3004
2023-11-10 11:16:53 +00:00
Andy Green
e7db2efabf mbedtls: if we have tls1.2 only accept exactly that 2023-11-07 06:40:58 +00:00
Andy Green
115571f0f3 cmake: mbedtls: mbedtls_ssl_conf_alpn_protocols check 2023-11-07 06:40:46 +00:00
Andy Green
5e060e2968 mbedtls: auto adapt to changed session constant 2023-11-07 06:40:07 +00:00
Ogre Transporter
cf07fef590 msvc: avoid error about mixed ellipsis and cond
https://github.com/warmcat/libwebsockets/issues/3001
2023-11-07 06:38:18 +00:00
Andy Green
5a5c31312e mbedtls: print library version 2023-11-07 06:38:11 +00:00
Andy Green
75b41f4a9d tls: mbedtls-3.5.0: correct privkey size 2023-11-05 08:30:54 +00:00
Andy Green
6dfc270232 ss: http: support PATCH
https://github.com/warmcat/libwebsockets/issues/2989
2023-10-27 06:16:42 +01:00
Nate Karstens
051dfbdb7d 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:04:08 +01:00
Audric Schiltknecht
c012b12589 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:08:18 +01:00
Andy Green
41ff4ef8ae openssl-server: enum vs int disagreement
https://github.com/warmcat/libwebsockets/issues/2907
2023-06-14 07:16:26 +01:00
Dmitry Potapov
12250cf3ef openssl3: change deprecated warnings suppression 2022-09-18 08:05:59 +01:00
Andy Green
937a8db996 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:05:16 +01:00
Damian Hobson-Garcia
58af7b4409 From df9761a261 Mon Sep 17 00:00:00 2001
Subject: [PATCH] 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-08-23 12:58:40 +01:00
Martlaak
8796dc00f5 windows: allow serving files open for write
https://github.com/warmcat/libwebsockets/issues/2713
2022-08-23 12:58:31 +01:00
Dmitry Potapov
39f6379c0c 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:58:05 +01:00
Vladimir Shakhov
ba84a1d3b5 Subject: [PATCH] platorm windows-sockets: treat WSAEWOULDBLOCK as
MBEDTLS_ERR_SSL_WANT_READ|WRITE
2022-08-05 19:45:20 +01:00
Arenoros
9bfca5b7c3 From a966322704 Mon Sep 17 00:00:00 2001
Subject: [PATCH] fix build on QNX 6.5.0
2022-07-13 06:23:40 +01:00
Ammar Faizi
50ed5217b0 From aa990b1451 Mon Sep 17 00:00:00 2001
Subject: [PATCH] lib/secure-streams: Fix clang build error
 `-Wunused-but-set-variable`

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-07-13 06:23:07 +01:00
qdztxc
0a5526b958 ws: tell caller we closed wsi on handshake failure
https://github.com/warmcat/libwebsockets/issues/2681
2022-07-12 09:48:47 +01:00
Andy Green
ea3a0ab9e0 windows: zlib: internal lib doesnt need find_package 2022-07-06 07:47:04 +01:00
Marco Gratzke
ee2e4074e4 spa: file upload fix 2022-07-04 14:21:38 +01:00
Poljak181
5a8f790870 logs: setup earlier so we can use on fail path
https://github.com/warmcat/libwebsockets/issues/2679
2022-06-29 17:23:35 +01:00
Mike Tettinger
a723789b0e test-apps: use correct EXTERNAL_POLL flag 2022-06-17 04:57:23 +01:00
Fabrice Fontaine
a5f81f8336 lib/tls/CMakeLists.txt: fix build without threads
openssl can be built without threads resulting in the following build
failure:

-- Looking for HMAC_CTX_new
-- Looking for HMAC_CTX_new - not found

[...]

In file included from /home/buildroot/autobuild/instance-0/output-1/build/libwebsockets-4.3.1/include/libwebsockets.h:661,
                 from /home/buildroot/autobuild/instance-0/output-1/build/libwebsockets-4.3.1/lib/core/./private-lib-core.h:140,
                 from /home/buildroot/autobuild/instance-0/output-1/build/libwebsockets-4.3.1/lib/plat/unix/unix-misc.c:28:
/home/buildroot/autobuild/instance-0/output-1/build/libwebsockets-4.3.1/include/libwebsockets/lws-genhash.h:85:18: error: field 'ctx' has incomplete type
   85 |         HMAC_CTX ctx;
      |                  ^~~

To fix this build failure, don't unconditionally add pthread if openssl
has been found through pkg-config as openssl.pc will contain the
appropriate dependencies (i.e. -lpthread but also -lz or -latomic)

Fixes:
 - http://autobuild.buildroot.org/results/2ae9e3249b6fcc9e6c30e7783e264fc6599e61df

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-06-14 07:50:24 +01:00
Jaume
065035ecd5 windows: client connect: use sockaddr size 2022-06-14 07:42:25 +01:00
Mykola Stryebkov
754d2b4578 eventloop: windows: ssl: remove spin 2022-06-14 07:34:43 +01:00
Paul Shark
fe107059fc http: server: correct plugin name in error 2022-06-14 07:34:34 +01:00
Andy Green
ebabf49bce http: server: mounts: dont assume Basic Auth if no FILE_OPS 2022-06-10 13:35:39 +01:00
Andy Green
b0a749c8e7 v4.3.2 2022-05-17 17:53:27 +01:00
Richard Shi
5a008cf282 http: compression: fix selection
https://github.com/warmcat/libwebsockets/issues/2633
2022-05-17 15:53:53 +01:00
Andrii Sevastianov
6d8a798742 validity: fix bad pointer access
We cannot access wsi after __lws_close_free_wsi.
2022-05-17 15:53:53 +01:00
Nick
bfd921df9c clean: remove needless LWS_PRE
Several examples trim their buffer with an extra LWS_PRE from the end...
actually end should point to end the end of buf without a second LWS_PRE
reservation.

https://github.com/warmcat/libwebsockets/issues/2629
2022-05-17 15:53:53 +01:00
Andy Green
310abddf5e coverity: ss: mqtt: remove needless wsi check
881     	case LWS_CALLBACK_MQTT_UNSUBSCRIBE_TIMEOUT:
>>>     CID 392688:    (REVERSE_INULL)
>>>     Null-checking "wsi" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
882     		if (!wsi || !wsi->mqtt)
883     			return -1;

wsi can't be NULL for a callback specific to a wsi.
2022-05-17 15:53:53 +01:00
Andy Green
71db363fe4 ss: mqtt: remove c99isms and fix types
Blows on Centos 7 / 8 in Sai with

/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c: In function âexpand_metadataâ:
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:304:2: error: missing braces around initializer [-Werror=missing-braces]
lws_strexp_t exp = {0};
^
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:304:2: error: (near initialization for âexp.nameâ) [-Werror=missing-braces]
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:304:2: error: missing initializer for field âcbâ of âlws_strexp_tâ [-Werror=missing-field-initializers]
In file included from /home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/include/libwebsockets.h:737:0,
from /home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/core/./private-lib-core.h:146,
from /home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:25:
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/include/libwebsockets/lws-tokenize.h:196:23: note: âcbâ declared here
lws_strexp_expand_cb cb;
^
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c: In function âsecstream_mqtt_shadow_subscribeâ:
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:441:2: error: âforâ loop initial declarations are only allowed in C99 mode
for (unsigned int i = 0; i < suffixes_len; i++) {
^
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:441:2: note: use option -std=c99 or -std=gnu99 to compile your code
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c: In function âsecstream_mqttâ:
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:481:2: error: missing braces around initializer [-Werror=missing-braces]
lws_strexp_t exp = {0};
^
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:481:2: error: (near initialization for âexp.nameâ) [-Werror=missing-braces]
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:481:2: error: missing initializer for field âcbâ of âlws_strexp_tâ [-Werror=missing-field-initializers]
In file included from /home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/include/libwebsockets.h:737:0,
from /home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/core/./private-lib-core.h:146,
from /home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:25:
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/include/libwebsockets/lws-tokenize.h:196:23: note: âcbâ declared here
lws_strexp_expand_cb cb;
^
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:677:27: error: conversion to âuint32_tâ from âsize_tâ may alter its value [-Werror=conversion]
uint32_t acc_n = strlen(LWS_MQTT_SHADOW_RESP_ACCEPTED_STR);
^
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:678:27: error: conversion to âuint32_tâ from âsize_tâ may alter its value [-Werror=conversion]
uint32_t rej_n = strlen(LWS_MQTT_SHADOW_RESP_REJECTED_STR);
^
/home/sai/big-long-dir-to-make-rpm-happy-o/jobs/0-0.0/libwebsockets/lib/secure-streams/protocols/ss-mqtt.c:680:4: error: âforâ loop initial declarations are only allowed in C99 mode
for (uint32_t i = 0; i < h->u.mqtt.shadow_sub.num_topics; i++) {

little additional cleaning and conversion to modern lwsl_xxx_yyy(xxx, ...)
2022-05-17 15:53:53 +01:00
Chunho Lee
8b1693a05e ss: mqtt: add support for AWS IoT Shadow topic
This introduces AWS IoT Shadow topic support. This subscribes and
unsubscribes shadow response topics before and after shadow topic
is transmitted.
2022-05-17 15:53:53 +01:00
Andy Green
c398dd546b coverity: reorder NULL check 2022-05-17 15:53:53 +01:00
Andy Green
2d48f559f0 mbedtls: some versions need x509 overallocation 2022-05-17 15:37:16 +01:00
Harshit Malpani
cf7862dd3c plat: esp32: Remove esp_attr.h file 2022-05-17 15:37:16 +01:00
dcpng
65870ebce3 windows: plugins uv fixes
https://github.com/warmcat/libwebsockets/issues/2617
2022-05-17 15:37:16 +01:00
Andy Green
e02aaff34c gcc12: extend test-client buffer for dumb increment 2022-05-17 15:37:16 +01:00