RDP compositor: enforce certificate and key
authorDavid FORT <contact@hardening-consulting.com>
Tue, 19 May 2015 07:57:37 +0000 (09:57 +0200)
committerDavid FORT <contact@hardening-consulting.com>
Thu, 21 May 2015 07:07:59 +0000 (09:07 +0200)
The RDP compositor is usable without certificates and key in a very limited
number of cases (local usage using xfreerdp), so let's force the presence of
keys and certificates.

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
src/compositor-rdp.c

index 3185141ffcea5235c863ab63095ec20b14c4e811..4091bace15ce6c59d87c497c99087361a6d8e2f6 100644 (file)
@@ -1263,5 +1263,11 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
        };
 
        parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv);
+       if (!config.rdp_key && (!config.server_cert || !config.server_key)) {
+               weston_log("the RDP compositor requires keys and an optional certificate for RDP or TLS security ("
+                               "--rdp4-key or --rdp-tls-cert/--rdp-tls-key)\n");
+               return NULL;
+       }
+
        return rdp_compositor_create(display, &config, argc, argv, wconfig);
 }