[PATCH] Fix API troubles with FreeRDP 2.0
Hardening
rdp.effort at gmail.com
Mon Sep 25 15:18:15 UTC 2017
Le 25/09/2017 à 10:49, Pekka Paalanen a écrit :
> On Fri, 22 Sep 2017 11:17:41 +0200
> David Fort <rdp.effort at gmail.com> wrote:
>
>> With FreeRDP 2.0 the crypto needs to be initialized or we fail as soon as we try to
>> compute a md5. The API also changed for the suppress output callback.
>> ---
>> libweston/compositor-rdp.c | 15 ++++++++++++++-
>> 1 file changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c
>> index 091472b..6706765 100644
>> --- a/libweston/compositor-rdp.c
>> +++ b/libweston/compositor-rdp.c
>> @@ -76,6 +76,10 @@
>> #include <freerdp/locale/keyboard.h>
>> #include <winpr/input.h>
>>
>> +#if FREERDP_VERSION_MAJOR >= 2
>> +#include <winpr/ssl.h>
>> +#endif
>> +
>> #include "shared/helpers.h"
>> #include "compositor.h"
>> #include "compositor-rdp.h"
>> @@ -159,6 +163,7 @@ to_rdp_backend(struct weston_compositor *base)
>> return container_of(base->backend, struct rdp_backend, base);
>> }
>>
>> +
>
> Stray newline?
Sorry, will fix that
>
>> static void
>> rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_peer *peer)
>> {
>> @@ -1013,7 +1018,8 @@ xf_peer_activate(freerdp_peer* client)
>> return TRUE;
>> }
>>
>> -static BOOL xf_peer_post_connect(freerdp_peer *client)
>> +static BOOL
>> +xf_peer_post_connect(freerdp_peer *client)
>> {
>> return TRUE;
>> }
>> @@ -1166,7 +1172,11 @@ xf_input_unicode_keyboard_event(rdpInput *input, UINT16 flags, UINT16 code)
>>
>>
>> static FREERDP_CB_RET_TYPE
>> +#if FREERDP_VERSION_MAJOR >= 2
>> +xf_suppress_output(rdpContext *context, BYTE allow, const RECTANGLE_16 *area)
>> +#else
>> xf_suppress_output(rdpContext *context, BYTE allow, RECTANGLE_16 *area)
>> +#endif
>> {
>> RdpPeerContext *peerContext = (RdpPeerContext *)context;
>>
>> @@ -1387,6 +1397,9 @@ weston_backend_init(struct weston_compositor *compositor,
>> struct weston_rdp_backend_config config = {{ 0, }};
>> int major, minor, revision;
>>
>> +#if FREERDP_VERSION_MAJOR >= 2
>> + winpr_InitializeSSL(0);
>> +#endif
>> freerdp_get_version(&major, &minor, &revision);
>> weston_log("using FreeRDP version %d.%d.%d\n", major, minor, revision);
>>
>
> Hi,
>
> I currently have net-misc/freerdp-2.0.0_pre20160722. Without this
> patch, the build runs fine.
>
> When I apply this patch and build, I get:
>
> CC libweston/rdp_backend_la-compositor-rdp.lo
> /home/pq/git/weston/libweston/compositor-rdp.c: In function ‘rdp_peer_init’:
> /home/pq/git/weston/libweston/compositor-rdp.c:1240:33: warning: assignment from incompatible pointer type
> client->update->SuppressOutput = xf_suppress_output;
> ^
>
A const has been added on the rect parameter, ignoring the warning is
ok, but I will resubmit something to drop it. Except with some
configure.ac tests, I'm not sure there's a way to determine if the const
is there (tests on sub-version aren't reliable).
> What is the FreeRDP version we should be using?
>
> Is there a reasonable way to make the warning go away, is it a fatal
> problem, or should we just live with it and suggest people to upgrade
> their FreeRDP snapshot to fix it?
>
> Can/should we have more strict FreeRDP configure.ac tests locking us to
> a compatible FreeRDP version?
>
> FWIW, the FreeRDP versions I seem to have available in Gentoo are:
> freerdp-1.2.1_pre20150326-r1
> freerdp-2.0.0_pre20160722
> freerdp-2.0.0_pre20161219
> freerdp-2.0.0_rc0
>
> Fedora 26 seems to have freerdp-2.0.0-34.20170831git3b83526.
>
>
IIRC I did some tests on Fedora 25 and Fedora 26 and it was compiling
fine. Anyway I noticed that remote connection does not refresh correctly
when plain bitmap encoding is used (looking at that).
Best regards
PS: I did (multiple time) promised a doc to test the RDP compositor, I'm
on it.
--
David FORT
website: http://www.hardening-consulting.com/
More information about the wayland-devel
mailing list