Commit Graph

4632 Commits

Author SHA1 Message Date
Julien Ropé
95a0cfac8a With OpenSSL 1.0.2 and earlier: disable client-side renegotiation.
Fixed issue #49
Fixes BZ#1904459

Signed-off-by: Julien Ropé <jrope@redhat.com>
Reported-by: BlackKD
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-12-07 14:43:32 +00:00
Julien Ropé
ca5bbc5692 With OpenSSL 1.1: Disable client-initiated renegotiation.
Fixes issue #49
Fixes BZ#1904459

Signed-off-by: Julien Ropé <jrope@redhat.com>
Reported-by: BlackKD
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-12-07 14:43:24 +00:00
Julien Ropé
7da855b6f3 Add my name to the AUTHORS file to fix CI
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-12-07 11:13:16 +00:00
Julien Ropé
d8c6ff25b6 ci: suppress new possible loss coming with Fedora 33
- remove entry for g-type-register-static: the "possible" flag has been
  re-introduced in glib.supp
- add new entries for several calloc issues

Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-12-07 11:13:13 +00:00
Julien Ropé
5f06f847dd ci: update glib.supp file
Sync with Glib master file.

Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-12-07 11:13:07 +00:00
Frediano Ziglio
a078f25090 build: Prepare for 0.14.91 release
Really minor update to fix Meson build for release: additional files
cause the version string to contain "-dirty" which is not handled, so
doing a "git clean" fix the issue.
Autoconf did not trigger the issue as printf command give a
warning but strip what is not a number.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-10-26 11:57:20 +00:00
Uri Lublin
f23349f93e ci: install diffutils
Without diffutils, configure complains it can not find commands cmp and diff.
For example check-valgrind log shows:
checking for a working dd... ./configure: line 6852: cmp: command not found
./configure: line 6852: cmp: command not found

Signed-off-by: Uri Lublin <uril@redhat.com>
2020-10-26 12:54:06 +02:00
Frediano Ziglio
de5c20531e reds: Check VDAgentMonitorsConfig using spice-common code
Reduce code duplication.
Also this improve support for big endian machines as
agent_check_message fix also message endianess.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-10-25 20:02:16 +00:00
Frediano Ziglio
587c04f79e Improve big endian support for agent messages
Big endian machines on server are not officially supported but won't
hurt.
Messages from client are always encoded as little endian (as all
SPICE protocol).
Convert fields from little endian to host endian on some places
where numbers are used and not just binary copied.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-10-25 20:01:54 +00:00
Frediano Ziglio
44436a006f build: Prepare for 0.14.90 release
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-10-24 14:34:45 +01:00
Frediano Ziglio
4f71d0cdb7 Update spice-common submodule
This brings in the following changes:

Frediano Ziglio (18):
      snd_codec: Use better types for snd_codec_is_capable
      snd_codec: Use better type for function result
      snd_codec: Use better type for snd_codec_create mode
      backtrace: Do not attempt to compile if spice_backtrace is empty
      Avoid usage of GCC extension for __VA_ARGS__ where possible
      helper-fuzzer-demarshallers: Provide replacement for ftello for MSVC
      quic_tmpl: Remove unused bpc parameter
      ssl_verify: Do not check IP if we fail to resolve it
      proto: Add support for side mouse buttons
      quic: Constify a parameter
      quic: Fix typo in comment
      agent: Extend agent_check_message to support VDAgentMonitorsConfig extension
      quic: Check we have some data to start decoding quic image
      quic: Check image size in quic_decode_begin
      quic: Check RLE lengths
      quic: Avoid possible buffer overflow in find_bucket
      test-quic: Add fuzzer capabilities to the test
      test-quic: Add test cases for quic fuzzer

Haochen Tong (2):
      pixman_utils: fix clang "unused functions" warning
      marshal: fix clang "missing field initializer" warning on generated files

Marc-André Lureau (1):
      agent: fix vdagent monitor flag filtering

Changes in sound.cpp are required due to improved types.

In particular some security related changes are imported.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-10-24 14:34:39 +01:00
Frediano Ziglio
37fd91a51f build-sys: Fix computed version using Meson
In configure.ac the micro version is incremented if there is a
forth component in the version.
In Meson this was wrongly translated to "if contains git".

This fixes Gitlab issue #46.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-09-30 14:03:45 +01:00
Marc-André Lureau
d1bea58002 reds: fix vdagent monitor flag filtering
Fixes commit 828c881bd0a8d73a5c2038bdf22cb8ae7c793482 ("agent/qxl: add
monitors physical dimensions handling").

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-09-17 06:43:48 +01:00
Frediano Ziglio
f1e89573b6 reds: Specify virtual functions override RedCharDevice functions
Remove some possible warning, like

reds.cpp:216:18: warning: 'remove_client' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]
    virtual void remove_client(RedCharDeviceClientOpaque *opaque);
                 ^

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-09-16 14:34:17 +01:00
Frediano Ziglio
efc02a8c0f spicevmc: Remove unused declarations
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-09-16 14:34:15 +01:00
Marc-André Lureau
828c881bd0 agent/qxl: add monitors physical dimensions handling
Requires
https://gitlab.freedesktop.org/spice/spice-protocol/-/merge_requests/24

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-09-14 14:35:12 +01:00
Frediano Ziglio
5223aeed32 reds: Use g_strlcpy instead of strlen/strcpy
Some compiler could generate some warning, like

reds.cpp:2678:5: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
    strcpy(buf, pass);
    ^

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
2020-09-13 19:47:20 +01:00
Frediano Ziglio
8bb90e55aa inputs-channel: Support more mouse buttons
Extend mouse button bits support.
Allows to support up to 16 buttons.

Partly based on a patch from Kevin Pouget (RED_MOUSE_BUTTON_STATE_TO_AGENT
macro, updated on new protocol constants).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-09-02 09:21:03 +01:00
Frediano Ziglio
2899fd91fb dcc-send: Fix a regression adding an image item to the pipe
The regression was introduced by

    commit 22fc6a48e6

    red-channel-client: Change GQueue into a std::list

    Starts using smart pointers in the queue.

dcc_add_surface_area_image added a new pipe item in front if pos was
NULL. Before the commit red_add_lossless_drawable_dependencies passed
a pointer to the last element in the pipe adding the new item on the
back. The change caused the item to be inserted in front instead of
back. Restore the insert position.
This caused in some condition the pipe to grow uncontrollably (like
using a large notepad window on Windows 7 and moving it around).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-20 16:36:20 +01:00
Frediano Ziglio
07f26241b8 ci: Set G_TLS_GNUTLS_PRIORITY environment for makecheck-windows job
This workaround an error from test-listen test under Windows
reporting:

   GLib-Net-WARNING **: 09:24:25.152: Failed to set GnuTLS session priority with error beginning at %COMPAT: The request is invalid.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-07-20 16:35:33 +01:00
Frediano Ziglio
c87bd86c44 ci: Update Gitlab websocket-autobahn job for Fedora 32
Fedora 32 removed Python2 packages, we need to install compatibility
packages and install pip2 manually.
Autobahn test suite does not still support Python3.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-07-20 16:35:26 +01:00
Frediano Ziglio
8dcbc99d3f red-channel-client: Change gboolean -> bool
Avoid possible type conversion

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-20 10:17:22 +01:00
Frediano Ziglio
30d917ba5d red-channel-client: Make RedChannelClient::pipe_item_is_linked const
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-20 10:17:20 +01:00
Frediano Ziglio
db61c35e7f red-channel-client: Make some members const
This is now easier moving from GQueue to std::list.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-20 10:17:14 +01:00
Uri Lublin
8d8745211d mjpeg_encoder_reset_quality: do not hint inline
Let the compiler decide.

Apparently it causes CI makecheck to fail (see below).
Seems to me it's a gcc problem -- was working with version 9,
fails with version 10.
Making the function a non-inline one "fixes" this issue.
Alternatively adding to the structure "int dummy" above the "int type"
"fixes" the build too (but I went with the non-inline solution).

==== error ====
  CC       mjpeg-encoder.lo
In file included from /usr/include/string.h:495,
                 from ../../server/red-common.h:24,
                 from ../../server/mjpeg-encoder.c:25:
In function ‘memset’,
    inlined from ‘mjpeg_encoder_reset_quality’ at ../../server/mjpeg-encoder.c:385:5,
    inlined from ‘mjpeg_encoder_quality_eval_stop.part.0’ at ../../server/mjpeg-encoder.c:999:5:
/usr/include/bits/string_fortified.h:71:10: error: ‘__builtin_memset’ offset [788, 871] from the object at ‘encoder’ is out of the bounds of referenced subobject ‘type’ with type ‘int’ at offset 784 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../server/mjpeg-encoder.c: In function ‘mjpeg_encoder_quality_eval_stop.part.0’:
../../server/mjpeg-encoder.c:96:9: note: subobject ‘type’ declared here
   96 |     int type;
      |         ^~~~
cc1: all warnings being treated as errors

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-17 07:45:16 +01:00
Frediano Ziglio
10749220dd Encapsulate more pipe item initialisation in constructors
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:27 +01:00
Frediano Ziglio
20408491fa video-stream: Move some structure definition to use more RedPipeItemNum
Users of structures needs enumeration definitions too.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:25 +01:00
Frediano Ziglio
228db683ba dcc: Move some structure definition to use more RedPipeItemNum
Users of structures needs enumeration definitions too.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:22 +01:00
Frediano Ziglio
f4bc555b62 dcc: Remove red_drawable_pipe_item_new, use constructor
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:20 +01:00
Frediano Ziglio
fe9ad0d5ba red-pipe-item: Remove red_pipe_item_(un)ref
Most code uses now red::shared_ptr

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:18 +01:00
Frediano Ziglio
8a0d9369bc char-device: Use list and shared pointers for RedCharDeviceClient queue
Automatically handle ownership avoiding using red_pipe_item_(un)ref.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:16 +01:00
Frediano Ziglio
76fe97a157 char-device: Make RedCharDeviceClient a proper class
Provide constructor and destructor, use new/delete.
This allows additional fields to be properly initialized if needed.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:12 +01:00
Frediano Ziglio
39efd79d53 spicevmc: Simplify code to compress messages
Remove some conditional compilation.
Make try_compress_lz4 return success or failure and change the
messages making easier to read result from try_compress_lz4.
Remove "n" parameter from try_compress_lz4, use message size
instead.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:10 +01:00
Frediano Ziglio
dd9b78fd78 Use smart pointers for RedPipeItem
Reduces usage of manual reference counting.
Avoids usage of new and use instead red::make_shared to both
create and own pipe items.
Use move semantic to reduce useless copies.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:08 +01:00
Frediano Ziglio
22fc6a48e6 red-channel-client: Change GQueue into a std::list
Starts using smart pointers in the queue.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:06 +01:00
Frediano Ziglio
586e45f185 cursor-channel: Remove cursor_pipe_item_new function, use constructor
This is a preparation to move to smart pointers.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:04 +01:00
Frediano Ziglio
bd6d043152 Remove some red_pipe_item_(un)ref usage
Replace with smart pointers instead.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:02 +01:00
Frediano Ziglio
93405ae3c6 Automatically release some pipe item resources
Now that items are managed by constructors/destructors avoid some
manual releases.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:47:59 +01:00
Frediano Ziglio
fa404f73d8 main-channel-client: Pass directly a RedPipeItem from VDI
Provides a base class to allows RedCharDeviceVDIPort to pass
a RedPipeItem to MainChannelClient instead of having to wrap
into another item.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:47:58 +01:00
Frediano Ziglio
d55c8837f8 red-pipe-item: Add and use a small utility class for easier initialization
Most of the times each class has an associated constant so
allows to be able to define the constant at declaration time.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:47:55 +01:00
Frediano Ziglio
a30df693cf red-pipe-item: Use inheritance on RedPipeItem
This allows to:
- reuse reference counting;
- avoid having to manually call g_free to release item memory;
- assure item is initialized;
- avoids some manual casts.

It will also allows to use smart pointers.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:47:53 +01:00
Frediano Ziglio
45e964dc5a red-pipe-item: Better encapsulate marshaller_unref_pipe_item
To avoid memory errors marshaller_unref_pipe_item should be
matched with a previous call to red_pipe_item_ref.
This is correctly done but to reduce the possibility of breaking
this rule move both referencing and unreferencing into a new
RedPipeItem::add_to_marshaller method.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:47:45 +01:00
Frediano Ziglio
65d7d24f21 test-gst: Handle better errors from callback
Exit more cleanly, otherwise sometimes some strange failures
occurs. This is due to the fact that a thread is cleaning up
everything while the others are still working.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-07-12 20:05:30 +01:00
Frediano Ziglio
1cd063d5fe test-gst: Returns specific error if encoder is not supported
This allows to detect missing required system packages.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-07-12 20:04:34 +01:00
Frediano Ziglio
4e4e31cc4b Update spice-common submodule
This brings in the following changes:

Frediano Ziglio (6):
      test-utils: Add missing include file
      test-quic: Test fixed images
      test-quic: Different "more_space" function for decode and encode
      Reuse macros from spice-protocol
      rect: Avoid usage of "small"
      build: Remove -Werror from Meson build

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-03 16:36:08 +01:00
Frediano Ziglio
6a230f3609 smartcard: Remove usage of tokens
RedCharDeviceSmartcard is not using token handling (which is designed
only for VDAgent) so push directly to client.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-03 10:47:34 +01:00
Frediano Ziglio
d60cef04e9 inputs-channel-client: Update RECEIVE_BUF_SIZE
For historical reasons this was computed using VDAgent details.
Provide a more suitable and simple constant.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-07-02 21:17:58 +01:00
Frediano Ziglio
d5a0e9d0ef video-stream: Remove only assigned "fps" field
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-07-02 21:11:47 +01:00
Frediano Ziglio
f028c9b787 event-loop: Avoid useless cast
"func" is already a "SpiceWatchFunc", remove the first cast to
the same type.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-06-29 09:14:25 +01:00
Frediano Ziglio
24c8692e5f Remove useless "common/ring.h" include
Not used directly by these source files.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-06-29 08:56:36 +01:00