Commit Graph

487 Commits (9fa1027353cb5c66439d4a8ebacf4bab3069ae48)

Author SHA1 Message Date
Andri Yngvason 9fa1027353 server: Drop current frame if formats change
If the currently in-flight frame was dispatched before a format change,
it might be the wrong format for the client, so it's better to drop it.
2024-02-02 22:24:03 +00:00
Andri Yngvason ef106b92f1 server: Log encodings reported by client 2024-02-02 22:22:03 +00:00
Andri Yngvason f1a6710bba server: Log pixel format choice 2024-02-02 22:17:52 +00:00
Andri Yngvason 584fb77cc8 pixels: Add strings for RGB222 and BGR222 2024-02-02 22:14:28 +00:00
Andri Yngvason c7d7929f7c Keep zlib streams when switching encodings
Both RealVNC and TigerVNC clients expect zlib streams to remain when
switching encodings, so when they switch back, inflate fails if the
encoder is discared.

fixes #109
2024-02-02 22:10:01 +00:00
Andri Yngvason 58509ca889 Warn when client chooses non-true-color pixel format
This at least lets the user know why things failed.
2024-01-30 21:50:23 +00:00
Andri Yngvason 65fc23c88d server: Allow server to request more than 32 encodings
fixes #108
2024-01-24 18:29:50 +00:00
Andri Yngvason ddd5ee123e h264-encoder: Use AV_FRAME_FLAG_KEY instead of key_frame 2024-01-01 12:27:20 +00:00
Andri Yngvason f503cbef25 Replace nvnc_client_get_hostname with nvnc_client_get_address
This is a more accurate name for what is returned since
c76129b2d2.
2023-12-31 17:59:52 +00:00
Andri Yngvason 524f9e0399 logging: Set log function to default when unset 2023-12-26 15:11:28 +00:00
Andri Yngvason 4691a35b7b logging: Add method to set thread local log function
This allows the user to override the log function in the current thread
without receiving log messages from concurrent tasks.
2023-12-26 11:58:35 +00:00
Andri Yngvason a7f6c50d6d logging: Export default log function
This allows users to intercept log messages without fully overriding the
default log handler.
2023-12-26 11:30:21 +00:00
Andri Yngvason d80b51f650 server: Don't complete fb update more than once
If stream_send in finish_fb_update returns -1, then complete_fb_update
will be called there and in the callback to stream_send.
2023-11-19 20:28:43 +00:00
Andri Yngvason c76129b2d2 server: Remove DNS lookup
DNS lookup is slow and can even fail. Under some circumstances, it will
even block for a significant amount of time until it completes.

The user of this library can do the lookup instead if they wish.
2023-11-05 10:29:04 +00:00
Andri Yngvason 0e262c8f33 crypto: Initialise AES-ECB decode context correctly
This fixes Apple DH
2023-11-04 23:13:12 +00:00
Andri Yngvason 175d53bc41 server: Fix double-free on failed Apple DH 2023-11-04 23:10:15 +00:00
Andri Yngvason 6beb263027 Don't use tag for git version 2023-10-09 22:54:18 +00:00
Andri Yngvason a631809cbb README: Enumerate dependencies for crypto 2023-10-06 20:44:27 +00:00
Philipp Zabel 5b4141ac1d Remove superfluous whitespace
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-10-06 20:41:30 +00:00
Philipp Zabel bc3a47a654 Indent wrapped argument lists with two tabs (function calls)
Do not align wrapped function argument lists with the opening
parenthesis. Indent them with two tabs.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-10-06 20:41:30 +00:00
Philipp Zabel f04284351e Indent wrapped argument lists with two tabs (function definitions)
Do not align wrapped function argument lists with the opening
parenthesis. Indent them with two tabs.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-10-06 20:41:30 +00:00
Andri Yngvason 457737de6c Set version for next release 2023-10-04 22:46:37 +00:00
Andri Yngvason 57d3b8d02d damage-refinery: Use scalar xxh3 implementation
This is guaranteed to be portable. It's best to keep it like that until
runtime detection is implemented.
2023-10-04 09:03:11 +00:00
Andri Yngvason dc1d93cadf server: Defer cleaning up client resources on close
When the event is received, the client object may still be processing some
things, so let's allow it to finish.
2023-10-03 22:15:20 +00:00
Andri Yngvason f8f49196e8 server: Free RSA creds on close 2023-10-03 20:45:20 +00:00
Andri Yngvason 4be95d6938 crypto-nettle: Fix use after free 2023-10-03 20:44:46 +00:00
Andri Yngvason 995d678e1e damage-refinery: Replace murmurhash with XXH3 2023-10-03 20:33:27 +00:00
MazTheMan b066536aac zrle: fix for source format of 24 bits 2023-10-03 20:04:21 +00:00
Andri Yngvason 65d1d0e185 server: Use uint32_t for security result failure path 2023-10-02 23:05:19 +00:00
Andri Yngvason d2c8ab0b6c Revert "Export base64 encoder and decoder"
There is currently no use for this.

This reverts commit c38f669e13.
2023-10-02 22:47:04 +00:00
Andri Yngvason a5fecc0b97 stream: rsa-aes: Unref payload after encoding
This fixes a memory leak
2023-10-02 22:38:59 +00:00
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