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
f5edf9d75a remove: lws_sequencer
lws_sequencer and lws_abstract were both false starts trying to do the
functionality of secure streams.

Since Secure Streams does a better job for both and there are no known
out-of-tree users of them, let's remove them and focus on Secure Streams.
2021-10-12 07:33:15 +01:00
Andy Green
057d03997f jrpc: add support 2021-10-11 09:10:15 +01:00
Andy Green
8fd1ea6180 examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
Andy Green
2cfa260e62 sspc: refactor to allow different transports
This is a NOP for existing usecases.

At the moment the only implemented transport for serialized SS is wsi, it's
typically used with Unix Domain Sockets, but it also works over tcp the
same.

It generalizes the interface between serialized chunks and the
transport, separately for client and proxy.  The wsi transport is migrated
to use the new transport ops structs.

It will then be possible to "bring your own transport", so long as it is
reliable, and in-order, both for proxy and client / sspc.

We also adapt minimal-secure-streams-binance to build the -client variant
via SS proxy as well.

LWS_ONLY_SSPC is added so libwebsockets can be produced with just sspc
client support even for tiny targets.

A new embedded minimal example for rpi pico is also provided that
demonstrates using Serialized SS over a UART to an SS proxy, to implement
the SS Binance example on the pico, even though it has no networking itself.
2021-10-08 09:48:41 +01:00
Andy Green
135234bd39 plat: baremetal and rpi pico support 2021-10-08 09:48:41 +01:00
Andy Green
65f16d737e dsh-empty 2021-10-08 09:48:41 +01:00
Andy Green
43bb8aead0 dsh: coalesce 2021-10-08 09:48:41 +01:00
Andy Green
1dbf1d8148 freertos: suppress return check on xSemaphoreTake
With the timeout set to portMAX_DELAY, there is no timeout and so no way
for the api to return failure.

https://www.freertos.org/a00122.html

However Coverity doesn't understand this, and futher, Coverity usually
ignores (void) result casts.  So add needless checks and the corresponding
needless unwinding to the 10 uses of lws_mutex_lock() in smd.c.

Invert the return value to align it with pthreads mutex lock return
semantics.
2021-10-08 09:48:29 +01:00
Tero Turtiainen
1d2df8a8fe tls: clear unused warning on WITHOUT_SERVER
I’ve got an error when compiling libwebsockets on Mac with -DLWS_WITHOUT_SERVER=ON:

libwebsockets/lib/tls/tls.c:98:22: error: unused variable 'cx' [-Werror,-Wunused-variable]
2021-10-07 13:26:22 +01:00
Kenneth Mastro
3c89fdb52e wolfssl: adapt SNI for recent changes
It seems WOLFSSL_SNI_HOST_NAME is an enum in later wolfssl, use
the wolfssl define HAVE_SNI as well
2021-10-07 13:26:13 +01:00
Pavel Otchertsov
3cee5910ac context: fix compilation error 2021-10-07 13:25:40 +01:00
caobug
95a8d2903c uv: handle uv_poll_init failure 2021-10-07 11:03:12 +01:00
Chunho Lee
f440a67ec8 ss-mqtt: Add support for Birth message
This provides Birth message on SS policy. The Birth message is
a message published just after the MQTT connection has been
established.
2021-10-07 10:59:08 +01:00
Chunho Lee
fa50cf23b0 ss-mqtt: Skip SUBSCRIBE when MQTT session is resumed 2021-10-07 09:49:36 +01:00
Andy Green
d447f8f1db client: connect: prefer default vh if none given
Giving NULL vh for the client connection is basically "don't care"....
prefer the "default" vh in that case
2021-10-05 07:40:17 +01:00
Andy Green
6cdaf85b89 ss: allow POLL from CONNECTING
Since CONNECTING is async and may take a while, there's nothing actually
wrong if the application asks to write again in the meanwhile and provokes
POLL.
2021-10-05 07:40:17 +01:00
caobug
90eb83a307 tls: ensure using ssl before doing tls_shutdown 2021-10-05 07:40:17 +01:00
Andy Green
ee15b82b6e cmake: unbreak LWS_WITH_SYS_STATE disabled build 2021-10-05 07:40:17 +01:00
=?UTF-8?q?M=C3=A4rt=20Laak?=
71b8f4dc68 windows: fix _lws_plat_file_seek_cur to update pos in fd
* needed to make fops_zip to work in windows
2021-10-05 07:40:17 +01:00
Andy Green
19ba1998fa tls: evolve handshake serialization into simultaneous_ssl_handshake_restriction
This patch adapts the recent change about serializing the number of
simultaneous tls handshakes allowed to 1, so you can set the number in the
context creation info, and the accounting for it is handled by counters
same as the overally tls restriction.

The name of the context info var to control it changes to simultaneous_ssl_handshake_restriction
which is now a count, the default 0 means no limit.

The count rejects tls connection attempts when the tls borrow is attempted,
and separately hands back the hs borrow from the tls borrow when the
connection attempt fails or succeeds.
2021-10-05 07:40:17 +01:00
Andy Green
ad990a61a0 ss: policy: unwind after policy syntax errors cleanly 2021-10-05 07:40:17 +01:00
Andy Green
8c7d541011 threadpool: SYNC timeout on netbsdBE
NetBSD Big-Endian on an RPi 3 + uSD is very slow, increase the threadpool
SYNC timeout a bit and normalize the task stop flow if it is exceeded.
2021-10-05 07:40:16 +01:00
Andy Green
0fda90c40a ws-server-threads-smp: modernize 2021-10-05 07:40:03 +01:00
Yucong Sun
ed8865e2b2 asyncdns: provide correct length with CCE 2021-10-05 07:10:10 +01:00
Andy Green
919981fba6 netlink: fix empty route index discovery 2021-10-05 07:10:02 +01:00
Andy Green
d069098683 conmon: async-dns: off-by-one 2021-10-05 07:09:55 +01:00
Andy Green
b6004e08c9 mqtt: allow indicating client_id is not on heap
Not sure why we don't leave any freeing to the caller, but since we don't
allow indicating that the provided client id should not be freed.
2021-10-05 07:09:47 +01:00
oaleshina
17199959aa h2: ping pong: separate payloads
https://github.com/warmcat/libwebsockets/pull/2413
2021-10-05 07:09:37 +01:00
Andy Green
733f0c10f0 mbedtls: fix validation
mbedtls validation was broken by an earlier patch on main... fix it and add
a CI test also using the wrong CA cert so this can be caught straight away
from now on.
2021-10-05 07:09:13 +01:00
Andy Green
c38567960a dsh: remove foreign support
We're going to refactor dsh to not have foreign support, let's remove it in
one step.
2021-10-04 12:59:27 +01:00
Andy Green
1e56dc9642 ss: http: defend against CONNECTED-CONNECTED 2021-10-04 12:55:45 +01:00
Andy Green
a0e60304a4 ss: h1: defeat CCE if told CONNECTED 2021-10-04 12:55:45 +01:00
Andy Green
9ff83d9e75 ss: h1: be sure to go through DISCONNECTING if CCE 2021-10-04 12:55:45 +01:00
Andy Green
65a954a9c4 ss-h1: reset message state for repeated use
This lets one "opportunistic" mode http policy SS be able to be used
multiple times.
2021-10-04 12:55:45 +01:00
Andy Green
005e130393 h2: make has_buffered_out check nwsi 2021-09-13 15:15:31 +01:00
Andy Green
27fac9dd86 warn: avoid one toolchain false positive 2021-09-09 15:27:41 +01:00
xionghui
365328c4d3 http server: allow serving files with special unicode path 2021-09-09 15:27:27 +01:00
Biswapriyo Nath
cced56b2ad Subject: [PATCH] cmake: Install pkgconfig files in mingw 2021-09-09 07:27:31 +01:00
Andy Green
372fdc7184 cancel pipe: make sure we closed it on destroy with no EVENTFD case 2021-09-09 07:27:31 +01:00
Andy Green
a8a443e645 wolfssl: update gencrypto 2021-09-08 09:42:11 +01:00
Andy Green
0c94138fd3 tls: handle WANT_WRITE via POLLOUT to POLLIN 2021-09-02 16:43:18 +01:00
Andy Green
3892a9d21c h2: bulk rx: deal with window
We don't always keep updating the rxflow window on bulk rx, and just run
down the initial.  This keeps us going with 64K in flight
2021-08-31 05:45:40 +01:00
Austen Stone
f6954e432c http: custom hdr: add custom name iterator 2021-08-31 05:45:40 +01:00
Andy Green
4d81fee54f validity: take context and pt lock before close 2021-08-31 05:45:40 +01:00
Andy Green
572e7e03e5 http: hdr: sync lws_hdr_total_length with lws_hdr_copy 2021-08-31 05:45:40 +01:00
Andy Green
06e881aad6 esp32c3
Add
2021-08-31 05:45:40 +01:00
Andy Green
d4dd7cb695 esp-idf: update againt 2021-08-06 head 2021-08-31 05:45:40 +01:00
Andy Green
81a3ca3e84 ss: port binance example 2021-08-31 05:45:40 +01:00
Andy Green
4db2ff872b cose: keys and signing + validation
Support for COSE keys and signing / validation

 - lws_cose_key_t and import / export / generation apis for EC / RSA / SYMMETRIC

 - cose_sign1 ES256/384/512,RS256/384/512 sign + validate, passes RFC8152 WG tests sign1-tests
 - cose_sign  ES256/384/512,RS256/384/512 sign + validate, passes RFC8152 WG tests sign-tests
 - cose_mac0  HS256/HS256_64/384/512      sign + validate, passes RFC8152 WG tests hmac-examples
 - cose_mac   HS256/HS256_64/384/512             validate, passes RFC8152 WG tests hmac-examples

 - lws-crypto-cose-key commandline tool for key / key set dumping and
   creation
 - lws-crypro-cose-sign commandline tool for signing / validation

 - lws-api-test-cose - large number of test vectors and tests from RFC8152
2021-08-31 05:45:35 +01:00
Andy Green
dcaa0013b4 lecp: add CBOR stream parser LECP like JSON LEJP
This provides very memory-efficient CBOR stream parsing
and writing.

The parser  converts pieces of CBOR into callbacks that define
the structure and collate string and blobs into buffer chunks
for extensible and easy access.

It is fragementation-safe and does not need all the CBOR in
the same place at one time, chunks of CBOR are parsed and
discarded as provided.

It does not allocate and just needs a few hundred bytes of
stack for even huge CBOR objects.  Huge strings and blobs
are handled without needing memory to hold them atomically.

Includes ./minimal-examples/api-tests/api-test-lecp that
unit tests it against 82 official example CBORs and
26 additional test vectors from COSE (just checking the CBOR
parsing).

The writing apis allow printf style semantics with a variety
of CBOR-aware %-formats.  The apis write into a context that
manages output buffer usage, if the output buffer fills,
then the apis return with an AGAIN code that lets you issue
and reset the output buffer and repeat the api all to issue
more output.  The subsequent calls can occur much later or
from a different function context, so this is perfect for
WRITEABLE-mediated output from the network parts of lws.

See ./READMEs/README.cbor-lecp.md
2021-08-21 17:44:40 +01:00