aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2022-02-07Don't use netlinkandroid-t-preview-2android-t-preview-1android-t-beta-3android-s-v2-beta-3android-s-qpr3-beta-1android-t-preview-1android-s-v2-beta-3android-s-qpr3-beta-1Jorge E. Moreira
Bug: 217379705 Test: locally Change-Id: I9512f5ceb6e99e1a4b785845b69327140ea3cff9
2022-01-06Fix build files for update to 4.3Jorge E. Moreira
Bug: 209665362 Test: locally Change-Id: I2be9d28c27df50f45b74e9430dfd46ea55aef6c9
2022-01-05Merge remote-tracking branch 'aosp/upstream-v4.3-stable'Jorge E. Moreira
Bug: 209665362 Test: none Change-Id: Icf1b53ae8f677834c7fff74c450715a4108efe01
2021-12-14docs: lws_service_tsichilL1n
2021-11-22windows: mingw file type is int (v2)Andy Green
2021-11-09windows: mingw file type is intAndy Green
2021-11-08docs: audit api return informationPW Hu
https://github.com/warmcat/libwebsockets/issues/2481
2021-10-27mqtt: allow indicating username and password are not on heapChunho Lee
Fix minimal-mqtt-client and minimal-mqtt-client-multi from crashes by allowing indicating username and password are not on heap.
2021-10-26docs: client: Add UNIX socket connection notes for clientsFelipe Gasper
2021-10-11lecp: remove extra struct lws_lec_pctx fwd definitionsYichen Gu
C++ compilers set to less than C11 may choke on it, it's anyway not needed any more since no references between that and the actual definition.
2021-10-07ss-mqtt: Add support for Birth messageChunho Lee
This provides Birth message on SS policy. The Birth message is a message published just after the MQTT connection has been established.
2021-10-05tls: evolve handshake serialization into simultaneous_ssl_handshake_restrictionAndy Green
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-05ws-server-threads-smp: modernizeAndy Green
2021-10-05mqtt: allow indicating client_id is not on heapAndy Green
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-08-31http: custom hdr: add custom name iteratorAusten Stone
2021-08-31ss: port binance exampleAndy Green
2021-08-31cose: keys and signing + validationAndy Green
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-21lecp: add CBOR stream parser LECP like JSON LEJPAndy Green
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-21http: cookies: support cookie jar in and outYichen Gu
2021-08-21lws_mapAndy Green
2021-08-21evlib: remove PREPARE_DELETION as cruftAndy Green
2021-08-19sspc: add LWSSSCS_UPSTREAM_LINK_RETRY stateAndy Green
Add a transient state that indicates that we are retrying an upstream link before the sspc creation can proceed. The state() ack paramemeter shows the number of ms we have been retrying. This is only issued if proxy mode clients are having difficulty reaching their proxy, and are retrying. As a transient state it doesn't affect the ss overall state, which will not have reached CREATING yet.
2021-08-19conmon: add dns and protocol_specificAndy Green
This adds an indication of dns disposition to the conmon results, and for http, if it gets that far a protocol-specific indication of http response code.
2021-08-16cpd: pass up lws_ss_request_tx retAndy Green
2021-08-13service: assert on thread shenanigansAndy Green
2021-07-13tls: mbedtls-3Andy Green
Adapt mbedtls support for compatibility with v3, while maintaining compatibility with v2. Notice v3 has removed the ability to encrypt with pubkey and decrypt with privkey. Openssl still has it, atm with v3 these fall back to encrypt with privkey and decrypt with pubkey. > The RSA module no longer supports private-key operations with the > public key or vice versa. As a consequence, RSA operation functions > no longer have a mode parameter. If you were calling RSA operations > with the normal mode (public key for verification or encryption, > private key for signature or decryption), remove the > MBEDTLS_MODE_PUBLIC or MBEDTLS_MODE_PRIVATE argument. If you were > calling RSA operations with the wrong mode, which rarely makes sense >from a security perspective, this is no longer supported.
2021-07-13remove LWS_WITH_DEPRECATED_THINGSAndy Green
2021-07-08tls: add option to serialize ssl handshakeBing Zhao
This is useful for memory constrained systems such as esp32 to improve heap usage minfree/watermark. On esp32 with simultaneous_ssl_restriction = 2 (MQTT+H1), Without this change, sys heap minfree ranges from 59k to 71k in 100 iterations, average 66.5k. With this change, sys heap minfree ranges from 64k to 71k in 100 interations, average 68.7k
2021-07-04fault injection: pseudorandom 64-bit range supportAndy Green
This adds an api allowing fault injection path implementations to get hold of pseudo-random numbers between an externally-provided range. You can set it using, eg, --fault-injection "f1(10%),f1_delay(123..456)" while f1 shows how to decide whether to inject the fault and f1_delay provides a pseudo-random number between the two values for the fault implementation code to use.
2021-07-04WextraAndy Green
Add -Wextra (with -Wno-unused-parameter) to unix builds in addition to -Wall -Werror. This can successfully build everything in Sai without warnings / errors.
2021-07-01logs: introduce log_cxAndy Green
2021-06-22vhost: allow multiple listen socketsAndy Green
Some platforms need two sockets with AF_INET and AF_INET6 to listen to both protocols. This patch changes the single listen socket each vhost could previously handle to become an lws_dll2 and adapts the related code to handle them as a linked-list rather than as a singleton. The next patch adapts the listen / server code to create multiple listen wsi for vhosts listening on multiple ip protocols.
2021-06-22tls: JIT TrustAndy Green
Add support for dynamically determining the CAs needed to validate server certificates. This allows you to avoid instantiating > 120 X.509 trusted CA certs and have them take up heap the whole time. Works for both openssl and mbedtls. See READMEs/README.jit-trust.md for the documentation You likely want the next patch for http redirect enhancements as well.
2021-06-22client: add option for allowing redirect tls downgradesAndy Green
2021-06-22mbedtls: add AKID and SKID supportAndy Green
2021-06-22lws_cache_ttlAndy Green
2021-06-11ss: direct protocol stringJed Lu
2021-06-07wilcard: change api to use length for checkAndy Green
The wilcard part was always length driven... but the check part relied on being NUL terminated. Change that to also use a length specifier and not need any NUL. To migrate old uses, just add a fourth param as strlen(check).
2021-06-07evlib: allow custom evlib opsAndy Green
Adapt the event lib support slighly so we can pass an event lib "plugin" header in at context creation time, and direct all event loop handling to go via that. This can then be lightly adapted to interface to an existing custom event loop cleanly, without the problems of EXTERNAL_POLL. The external loop must consult with us about the max wait timeout as shown in the added minimal-http-server-eventlib-custom example. The example shows a complete implementation working with a custom poll() loop cleanly while only needing 5 ops in the custom event lib handler.
2021-05-27ss-mqtt: Add support for MQTT UNSUBSCRIBE and DISCONNECTChunho Lee
Send UNSUBSCRIBE and DISCONNECT when LWSSSSRET_DISCONNECT_ME is returned.
2021-05-27mqtt: Add support for QoS 2Chunho Lee
Add support for QoS 2.
2021-05-25TCP_FASTOPENAndy Green
2021-05-04license: fix two old headers from pre-MIT changeAndy Green
These two headers managed to avoid the global switch from LGPL2.1 -> MIT back in the day, correct them to be aligned with the rest of lws' own license, ie, MIT.
2021-04-15mbedtls: allow central trust store preloadAndy Green
Mbedtls does not have the same concept as openssl about preloading the system trust store into every SSL_CTX. This patch allows you to simulate the behaviour by passing in a context creation-time filepath that all client SSL_CTX will be initialized from.
2021-04-15ss: wire up EVENT_WAIT_CANCELLEDAndy Green
Currently the lws_cancel_service() api only manifests itself at lws level. This adds a state LWSSSCS_EVENT_WAIT_CANCELLED that is broadcast to all SS in the event loop getting the cancel service api call, and allows SS-level user code to pick up handling events from other threads. There's a new example minimal-secure-streams-threads which shows the pattern for other threads to communicate with and trigger the event in the lws service thread.
2021-04-15docs: lws_write: decruftifyAndy Green
2021-04-10http: parser: straighten out %00 legalityAndy Green
https://github.com/warmcat/libwebsockets/issues/2262 This adds a README explaining what can be expected if your URLs contain %00, and adds a safe helper for urlargs-by-name that is length-based. Contains fix for extra NUL on some headers https://github.com/warmcat/libwebsockets/issues/2267
2021-04-07ss: proxy: get rx flow control workingAndy Green
This fixes the proxy rx flow by adding an lws_dsh helper to hide the off-by-one in the "kind" array (kind 0 is reserved for tracking the unallocated dsh blocks). For testing, it adds a --blob option on minimal-secure-streams[-client] which uses a streamtype "bulkproxflow" from here https://warmcat.com/policy/minimal-proxy-v4.2-v2.json "bulkproxflow": { "endpoint": "warmcat.com", "port": 443, "protocol": "h1", "http_method": "GET", "http_url": "blob.bin", "proxy_buflen": 32768, "proxy_buflen_rxflow_on_above": 24576, "proxy_buflen_rxflow_off_below": 8192, "tls": true, "retry": "default", "tls_trust_store": "le_via_dst" } This downloads a 51MB blob of random data with the SHA256sum ed5720c16830810e5829dfb9b66c96b2e24efc4f93aa5e38c7ff4150d31cfbbf The minimal-secure-streams --blob example client delays the download by 50ms every 10KiB it sees to force rx flow usage at the proxy. It downloads the whole thing and checks the SHA256 is as expected. Logs about rxflow status are available at LLL_INFO log level.
2021-04-05client: add CONNECTING protocol cbAndy Green
2021-04-05ss: sspc: add conmon performance telemetryAndy Green
This provides a way to get ahold of LWS_WITH_CONMON telemetry from Secure Streams, it works the same with direct onward connections or via the proxy. You can mark streamtypes with a "perf": true policy attribute... this causes the onward connections on those streamtypes to collect information about the connection performance, and the unsorted DNS results. Streams with that policy attribute receive extra data in their rx callback, with the LWSSS_FLAG_PERF_JSON flag set on it, containing JSON describing the performance of the onward connection taken from CONMON data, in a JSON representation. Streams without the "perf" attribute set never receive this extra rx. The received JSON is based on the CONMON struct info and looks like {"peer":"46.105.127.147","dns_us":596,"sockconn_us":31382,"tls_us":28180,"txn_resp_us:23015,"dns":["2001:41d0:2:ee93::1","46.105.127.147"]} A new minimal example minimal-secure-streams-perf is added that collects this data on an HTTP GET from warmcat.com, and is built with a -client version as well if LWS_WITH_SECURE_STREAMS_PROXY_API is set, that operates via the ss proxy and produces the same result at the client.