Commit Graph

327 Commits (913c314b312992386b6b514ef42203914bc3ad23)

Author SHA1 Message Date
Andri Yngvason 913c314b31 server: Use memcpy instead of strncpy for username/password
This fixed zero-termination error
2023-10-02 21:57:22 +00:00
Andri Yngvason f54aeed334 Notify client about NTP support 2023-10-01 10:56:42 +00:00
Andri Yngvason bdadcad1c8 Replace strlcpy with strncpy
The former isn't portable.
2023-09-29 22:00:48 +00:00
Andri Yngvason 3794405101 websocket: Add some missing copyright notices 2023-09-29 21:53:20 +00:00
Andri Yngvason 58d6dff5e5 API: Consolidate setup of security constraints 2023-09-29 21:53:20 +00:00
Andri Yngvason 373e5a0f9e Remove logging of sensitive information 2023-09-29 21:53:20 +00:00
Andri Yngvason d74878fd00 server: Allow arbitrary RSA key length 2023-09-29 21:53:20 +00:00
Andri Yngvason 74e9db19fd API: Add method to set RSA credentials 2023-09-29 21:53:20 +00:00
Andri Yngvason 4220cbb345 crypto: Add method to import RSA private keys 2023-09-29 21:53:20 +00:00
Andri Yngvason c38f669e13 Export base64 encoder and decoder 2023-09-29 21:53:20 +00:00
Andri Yngvason 98f6930580 ws-handshake: Use own base64 and SHA1 implementations 2023-09-29 21:53:20 +00:00
Andri Yngvason a02f578f9e Add base64 encoder & decoder
I prefer to have these independent of the crypto suite that's being used.
2023-09-29 21:53:20 +00:00
Andri Yngvason 4705c0cfcc Implement RSA-AES-256 security type 2023-09-29 21:53:20 +00:00
Andri Yngvason 396f4ed6c5 server: Clean up crypto resources on disconnect 2023-09-29 21:53:20 +00:00
Andri Yngvason 76c832d791 crypto: Make deleting NULL pointers noop 2023-09-29 21:53:20 +00:00
Andri Yngvason 7eb42324bf server: Define rsa-aes server key length constant 2023-09-29 21:53:20 +00:00
Andri Yngvason 08312c3296 crypto: Add sha256 2023-09-29 21:53:20 +00:00
Andri Yngvason d004a2fcb9 crypto: Remove unused code 2023-09-29 21:53:20 +00:00
Andri Yngvason f029484a87 crypto: Add AES256-EAX cipher 2023-09-29 21:53:20 +00:00
Andri Yngvason c6df99ec46 server: Use hash_{one,many} 2023-09-29 21:53:20 +00:00
Andri Yngvason d12973486a crypto: Add helper functions for hashing 2023-09-29 21:53:20 +00:00
Andri Yngvason 9507624cf3 Create dedicated RSA-AES stream
The message format isn't really within the domain of the cipher, so it
doesn't belong to the crypto interface.
2023-09-29 21:53:20 +00:00
Andri Yngvason 625323d8a3 stream-ws: Clean up exec-and-send resources 2023-09-29 21:53:20 +00:00
Andri Yngvason dfc20d065e stream-ws: Inherit stream-tcp
This eliminates the need for implementing all stream functions
2023-09-29 21:53:20 +00:00
Andri Yngvason f90c628e66 Add temporary api function to enable auth without tls 2023-09-29 21:53:20 +00:00
Andri Yngvason e341898bbc Implement RSA-AES 2023-09-29 21:53:20 +00:00
Andri Yngvason 71aa5acfde crypto: Integrate message handling into cipher 2023-09-29 21:53:20 +00:00
Andri Yngvason c12c1c800a crypto: Add RSA and AES-EAX 2023-09-29 21:53:20 +00:00
Andri Yngvason 7b878033f0 Implement Apple's Diffie-Hellman based security type 30 2023-09-29 21:53:20 +00:00
Andri Yngvason da2518e296 stream: Integrate cipher 2023-09-29 21:53:20 +00:00
Andri Yngvason 0c3a98483c Add abstract interface for low level crypto 2023-09-29 21:53:20 +00:00
MazTheMan fd1e18b475 Implement 24 bit pixel formats for raw and tight 2023-09-29 21:46:05 +00:00
Andri Yngvason 8872dece0c server: Defer client_unref in close_after_write
This ensures that the stream object stays alive while its write
queue is being processed.
2023-07-04 23:40:32 +00:00
Andri Yngvason 61fad8c96b server: Actually send a reason when handshake fails 2023-07-04 22:56:52 +00:00
Andri Yngvason ade1046391 stream: Allocate enough for tls upgrade 2023-05-30 08:40:56 +00:00
Andri Yngvason b5f37d0227 stream: Move tls specific member into tls impl 2023-05-28 15:50:36 +00:00
Andri Yngvason c006936fd0 http: Only support GET method 2023-04-30 14:31:34 +00:00
Andri Yngvason 2f439b9fa2 http: Stop memory leak in failure path 2023-04-30 14:29:30 +00:00
Andri Yngvason 1fa8d41aef http: Re-order includes 2023-04-30 14:21:35 +00:00
Andri Yngvason a179c83f81 http: Remove unused code 2023-04-30 14:20:53 +00:00
Andri Yngvason c0b3e16bb0 stream-ws: Sanitise handshake input 2023-04-30 14:03:12 +00:00
Andri Yngvason e5e6767c1e ws-handshake: Handle protocol & version fields 2023-04-30 13:44:12 +00:00
Andri Yngvason d7dc9c0db5 server: Set SO_SNDBUF to 65536
The previous value of 4096 caused a very bad performance regression
with GnuTLS.
2023-04-11 20:37:22 +00:00
Andri Yngvason 79d24ae0ca stream-gnutls: Handle EAGAIN correctly 2023-04-11 20:33:13 +00:00
Andri Yngvason 4b5e4d628d stream-gnutls: Fix use after free 2023-04-11 20:32:37 +00:00
Andri Yngvason afc0256b2f stream-tcp: EAGAIN is not an error
This fixes inadvertent treatment of a normal situation as an error.
2023-04-10 11:36:59 +00:00
Andri Yngvason 5530b22fde server: Reduce SO_SNDBUF to 4096
This will allow us to more accuately gauge the back-pressure on the socket.
2023-04-08 13:40:24 +00:00
Andri Yngvason aa6fadf2fd server: Use stream_exec_and_send for ntp 2023-04-08 13:40:24 +00:00
Andri Yngvason 0cdbf6a602 stream: Add exec_and_send function
This allows us to execute a function right before a leaves the send queue
and is really only useful for NTP as far as I can tell.
2023-04-08 13:02:45 +00:00
Andri Yngvason 19172140ba Add NTP inspired latency tracking and time sync 2023-04-07 21:24:22 +00:00