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

472 commits

Author SHA1 Message Date
Andy Green
c0b0c0ed72 rsa-aes-gcm: only strip padding when required 2019-01-30 08:08:16 +08:00
Andy Green
658afbc658 crypto: openssl: use EVP hmac objects directly 2 2019-01-29 15:28:56 +08:00
Andy Green
849b20e594 crypto: openssl: use EVP hmac objects directly 2019-01-29 13:11:17 +08:00
Andy Green
9c7a0f28c0 minimal examples: ws-server-threads-smp 2019-01-28 07:02:33 +08:00
Andy Green
075b59ecaa x509: crypto tool: add alg 2019-01-27 16:25:07 +08:00
Andy Green
ed4db457c9 jwk: crypto tool: add --alg commandline arg 2019-01-27 16:08:34 +08:00
pblemel
39e19c85f1 qnx: qnx6.5 compatibility 2019-01-11 17:14:14 +08:00
Andy Green
0adc845507 lws-x509: validation functions 2018-12-31 20:35:54 +08:00
Andy Green
21889b53f7 ecdh-es
Mainly JWE support for ecdh-es and initial refactor to support multiple
recipients / signatures.
2018-12-27 06:45:32 +08:00
Andy Green
eda102e397 jwe 2018-12-27 06:45:32 +08:00
Andy Green
a3dcc95471 genec: generic ECDH crypto layer
!!! WIP

This implements the "genec" layer wrapping mbedtls + openssl
ECDH support.

API tests are added for the parts that are implemented so far.

Stuff related to ec at all, like keys, are prefixed lws_genec_.
Stuff specific to ECDH are prefixed lws_genecdh_.
2018-12-27 06:45:31 +08:00
Andy Green
47e14ba34b genrsa: add OAEP and PSS and convert openssl to EVP
Wanting PSS padding on signatures triggers and avalanche of
openssl EVP conversions as the only way to do it with the
openssl public apis.
2018-12-27 06:45:31 +08:00
Andy Green
ddb94d4e27 genaes: generic AES layer independent of tls library
Although RSA can be used directly for signing / JWS
on large chunks of data since it's only operating on
the hash, when JWE support arrives, which allows bulk
encryption, it's going to be mandatory to support
secondary AES ciphers to use on the bulk data.

This adds generic support for all AES modes that OpenSSL
and mbedTLS have in common, works on both mbedTLS and
OpenSSL the same, and adds unit tests for each mode
in api-test-gencrypto, to run in CI.
2018-12-27 06:45:31 +08:00
Andy Green
440dacc992 JOSE: refactor and prepare for JWE
Until now the JOSE pieces only had enough support for ACME.
This patch improves the JWK parsing to prepare for more
complete support and for adding JWE, genaes and genec in
later patches.
2018-12-27 06:45:31 +08:00
Andy Green
5976e4b334 deaddrop: handle @ urldecode in delete 2018-12-27 06:43:39 +08:00
Andy Green
5092350d16 autobahn: keep doing tests until we get a 500 2018-12-19 07:10:20 +08:00
Andy Green
97aa696dc6 minimal-ws-client: fix couple of breakages 2018-12-17 19:09:13 +08:00
Andy Green
08b5ad9299 role: raw-proxy 2018-12-01 11:05:59 +08:00
Andy Green
b318877cd9 adopt: allow associated accepted vhost connections to specific role
Normalize the vhost options around optionally handling noncompliant
traffic at the listening socket for both non-tls and tls cases.

By default everything is as before.

However it's now possible to tell the vhost to allow noncompliant
connects to fall back to a specific role and protocol, both set
by name in the vhost creation info struct.

The original vhost flags allowing http redirect to https and
direct http serving from https server (which is a security
downgrade if enabled) are cleaned up and tested.

A minimal example minimal-raw-fallback-http-server is added with
switches to confirm operation of all the valid possibilities (see
the readme on that).
2018-12-01 11:05:59 +08:00
Andy Green
531ad7ee2b minimal example deaddrop 2018-12-01 11:05:59 +08:00
Andy Green
a1b642f4fe pmd: do not inflate 0 input length
It generates repeated byte alignments plus EOT sequences
2018-11-21 19:58:34 +08:00
Andy Green
8f2edbe822 minimal-example-pmd-corner: pmd corner case exerciser 2018-11-21 17:03:29 +08:00
Andy Green
d9f982a055 minimal examples: update for CSP best practices
1) update the logos to svg

2) add svg icon for strict security policy where used

3) define new vhost option flag to enforce sending CSP headers
   with the result code

4) add vhost option flag to minimal examples to
   enforce sending CSP where applicable

5) Go through all the affecting examples confirming they
   still work

6) add LWS_RECOMMENDED_MIN_HEADER_SPACE constant (currently
   2048) to clarify when we need a buffer to hold headers...
   with CSP the headers have become potentially a lot
   larger.
2018-11-21 17:03:29 +08:00
Andy Green
c4c60fb95e minimal: update copies of test assets to CSP-compatible versions 2018-11-15 17:15:29 +08:00
Andy Green
0a0b88174d minimal: minimal-ws-client-spam 2018-11-15 10:00:54 +08:00
Andy Green
f6ae0edf8d strict host check vhost flag
https://github.com/warmcat/libwebsockets/issues/1423

If you vhost->options has the flag LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK,
then if the server is sent an upgrade request, the content of the Host: header is
required to match the vhost name + port.  The port is set to the well-known values
of 80 and 443 if no :port on the host: value, depending on tls or not on the
connection.

minimal-ws-server can now take a -h flag to set this.  lejp-conf (eg, lwsws) can now take
a flag strict-host-check on the vhost to enable it as well.
2018-11-13 09:55:06 +08:00
Andy Green
97f9af5e3b tokenizer: flags for dot not delim and floats as strings 2018-11-13 09:34:10 +08:00
Andy Green
aa4143aebd lws_diskcache: split generic parts from gitohashi into lws 2018-11-12 15:24:42 +08:00
Andy Green
da59453302 minimal-ws-client-echo: add --ssl flag 2018-11-03 09:10:57 +08:00
pblemel
b45f224b2a client-echo: fix search-replace case problem
https://github.com/warmcat/libwebsockets/issues/1437
2018-10-26 14:03:23 +08:00
Andy Green
d3bc2c3f4f fulltext search 2018-10-26 13:53:28 +08:00
Andy Green
14764ccbe2 ws client: apply tokenize to upgrade header
Switches to use lws_hdr_copy() for the case the header is fragmented

See also https://github.com/warmcat/libwebsockets/issues/1435
2018-10-18 06:30:07 +08:00
Andy Green
a5b2248e72 lwsac
Introduce an api for efficiently dealing with allocations for
large, unknown amounts of objects.
2018-10-16 05:05:56 +08:00
Andy Green
33a6034875 codacy: minor fixes 2018-10-13 08:16:27 +08:00
Andy Green
6cd80f9fc7 lws_tokenize 2018-10-13 08:16:27 +08:00
Andy Green
47e10ab200 dbus-ws-proxy
This builds on the new dbus role support to provide a minimal example proxy
between ws and dbus.

A client app is provided that asks the proxy to connect to libwebsockets.org
and proxy the drawing data from the mirror example there back to the dbus
client using dbus messages.
2018-10-13 08:16:27 +08:00
Andy Green
31dfc4aa12 role: dbus
This adds support for the integrating libdbus into the lws event loop.

Unlike the other roles, lws doesn't completely adopt the fd and libdbus insists
to retain control over the fd lifecycle.  However libdbus provides apis for
foreign code (lws) to provide event loop services to libdbus for the fd.

Accordingly, unlike the other roles rx and writeable are not subsumed into
lws callback messages and the events remain the property of libdbus.

A context struct wrapper is provided that is available in the libdbus
callbacks to bridge between the lws and dbus worlds, along with
a minimal example dbus client and server.
2018-10-13 08:16:27 +08:00
Andy Green
2f8efa1082 auth: record basic auth user
This causes the WSI_TOKEN_HTTP_AUTHORIZATION content to be
replaced by the plaintext username that succeeded to be
authenticated.
2018-10-02 10:52:09 +08:00
Andy Green
000d2d2027 docs: adjust lost image links 2018-09-19 10:22:21 +08:00
Andy Green
ebed5e74cb threadpool 2018-09-11 18:27:59 +08:00
Andy Green
edd7efd43d client: libuv: fix close handling during redirect
During client redirect we "reset" the wsi to the redirect address,
involving closing the current fd that was told to redirect (it will
usually be a completely different server or port).

With libuv and its two-stage close that's not trivial.  This solves
the problem we will "reset" (overwrite) where the handle lives in the
wsi with new a new connection / handle by having it copied out into
an allocated watcher struct, which is freed in the uv close callback.

To confirm it the minimal ws client example gets some new options, the
original problem was replicated with this

$ lws-minimal-ws-client-echo -s invalid.url.com -p 80

https://github.com/warmcat/libwebsockets/issues/1390
2018-09-11 18:27:59 +08:00
Andy Green
23e433ac1b minimal: adapt for ping test over https 2018-08-20 07:44:20 +08:00
Andy Green
d461f46a97 libwebsockets.h: clean out some boilerplate better put in core/private.h
https://github.com/warmcat/libwebsockets/issues/1370
2018-08-16 19:10:32 +08:00
Andy Green
991241905c client: use effective wsi for some callbacks 2018-07-20 08:40:53 +08:00
Andy Green
6677425272 minimal: kill stray symlink
https://github.com/warmcat/libwebsockets/issues/1344
2018-07-19 15:58:24 +08:00
chrisplusplus
2b9c69b55f Update protocol_lws_minimal_server_echo.c
This plugin will not compile as a plugin without changing
LWS_PLUGIN_PROTOCOL_MINIMAL_server_echo to
LWS_PLUGIN_PROTOCOL_MINIMAL_SERVER_ECHO
2018-07-11 15:31:22 +08:00
Andy Green
f2f96857d6 fd_cloexec: add and use lws_open wrapper and lws_plat_apply_FD_CLOEXEC() on cgi 2018-06-23 12:56:21 +08:00
Andy Green
157ac030ab minimal-http-server-dynamic: add tls vhost as well 2018-06-20 16:41:27 +08:00
Andy Green
06680fc2a8 minimal-http-server-tls-80 2018-06-20 16:41:27 +08:00
Andy Green
410db9a28e minimal-http-server-multivhost: add --die-after-vhost option 2018-06-20 16:36:22 +08:00