|
|
edecca |
From 549657f96937eee9d31a44f9cb202bd61a4ce99d Mon Sep 17 00:00:00 2001
|
|
|
edecca |
Message-Id: <549657f96937eee9d31a44f9cb202bd61a4ce99d@dist-git>
|
|
|
edecca |
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
|
|
edecca |
Date: Tue, 28 Aug 2018 12:46:45 +0200
|
|
|
edecca |
Subject: [PATCH] qemu: vnc: switch to tls-creds-x509
|
|
|
edecca |
MIME-Version: 1.0
|
|
|
edecca |
Content-Type: text/plain; charset=UTF-8
|
|
|
edecca |
Content-Transfer-Encoding: 8bit
|
|
|
edecca |
|
|
|
edecca |
The tls, x509 and x509verify options were deprecated in QEMU v2.5.0:
|
|
|
edecca |
|
|
|
edecca |
commit 3e305e4a4752f70c0b5c3cf5b43ec957881714f7
|
|
|
edecca |
Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
edecca |
|
|
|
edecca |
ui: convert VNC server to use QCryptoTLSSession
|
|
|
edecca |
|
|
|
edecca |
Use the tls-creds-x509 object when available.
|
|
|
edecca |
|
|
|
edecca |
https://bugzilla.redhat.com/show_bug.cgi?id=1598167
|
|
|
edecca |
|
|
|
edecca |
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
|
|
edecca |
(cherry picked from commit 17f50c82600c11c0ebcb4fc944b3f38b8e06bcdb)
|
|
|
edecca |
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
|
|
edecca |
|
|
|
edecca |
https: //bugzilla.redhat.com/show_bug.cgi?id=1598167
|
|
|
edecca |
Reviewed-by: Erik Skultety <eskultet@redhat.com>
|
|
|
edecca |
---
|
|
|
edecca |
src/qemu/qemu_command.c | 26 ++++++++++++++-----
|
|
|
edecca |
.../graphics-vnc-tls.x86_64-latest.args | 4 ++-
|
|
|
edecca |
2 files changed, 23 insertions(+), 7 deletions(-)
|
|
|
edecca |
|
|
|
edecca |
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
|
edecca |
index f2b64ed720..5c71abab96 100644
|
|
|
edecca |
--- a/src/qemu/qemu_command.c
|
|
|
edecca |
+++ b/src/qemu/qemu_command.c
|
|
|
edecca |
@@ -7892,13 +7892,27 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
|
|
|
edecca |
virBufferAddLit(&opt, ",password");
|
|
|
edecca |
|
|
|
edecca |
if (cfg->vncTLS) {
|
|
|
edecca |
- virBufferAddLit(&opt, ",tls");
|
|
|
edecca |
- if (cfg->vncTLSx509verify) {
|
|
|
edecca |
- virBufferAddLit(&opt, ",x509verify=");
|
|
|
edecca |
- virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir);
|
|
|
edecca |
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_TLS_CREDS_X509)) {
|
|
|
edecca |
+ const char *alias = "vnc-tls-creds0";
|
|
|
edecca |
+ if (qemuBuildTLSx509CommandLine(cmd,
|
|
|
edecca |
+ cfg->vncTLSx509certdir,
|
|
|
edecca |
+ true,
|
|
|
edecca |
+ cfg->vncTLSx509verify,
|
|
|
edecca |
+ NULL,
|
|
|
edecca |
+ alias,
|
|
|
edecca |
+ qemuCaps) < 0)
|
|
|
edecca |
+ goto error;
|
|
|
edecca |
+
|
|
|
edecca |
+ virBufferAsprintf(&opt, ",tls-creds=%s", alias);
|
|
|
edecca |
} else {
|
|
|
edecca |
- virBufferAddLit(&opt, ",x509=");
|
|
|
edecca |
- virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir);
|
|
|
edecca |
+ virBufferAddLit(&opt, ",tls");
|
|
|
edecca |
+ if (cfg->vncTLSx509verify) {
|
|
|
edecca |
+ virBufferAddLit(&opt, ",x509verify=");
|
|
|
edecca |
+ virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir);
|
|
|
edecca |
+ } else {
|
|
|
edecca |
+ virBufferAddLit(&opt, ",x509=");
|
|
|
edecca |
+ virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir);
|
|
|
edecca |
+ }
|
|
|
edecca |
}
|
|
|
edecca |
}
|
|
|
edecca |
|
|
|
edecca |
diff --git a/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args b/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args
|
|
|
edecca |
index 01743eff2a..97775fad42 100644
|
|
|
edecca |
--- a/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args
|
|
|
edecca |
+++ b/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args
|
|
|
edecca |
@@ -24,7 +24,9 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
|
|
edecca |
-no-acpi \
|
|
|
edecca |
-boot strict=on \
|
|
|
edecca |
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
|
|
|
edecca |
--vnc 127.0.0.1:3,tls,x509verify=/etc/pki/libvirt-vnc,sasl \
|
|
|
edecca |
+-object tls-creds-x509,id=vnc-tls-creds0,dir=/etc/pki/libvirt-vnc,\
|
|
|
edecca |
+endpoint=server,verify-peer=yes \
|
|
|
edecca |
+-vnc 127.0.0.1:3,tls-creds=vnc-tls-creds0,sasl \
|
|
|
edecca |
-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
|
|
|
edecca |
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
|
|
edecca |
resourcecontrol=deny \
|
|
|
edecca |
--
|
|
|
edecca |
2.18.0
|
|
|
edecca |
|