|
@@ -48,6 +48,7 @@
|
|
#include "crypto/tlscredsanon.h"
|
|
#include "crypto/tlscredsanon.h"
|
|
#include "crypto/tlscredsx509.h"
|
|
#include "crypto/tlscredsx509.h"
|
|
#include "crypto/random.h"
|
|
#include "crypto/random.h"
|
|
|
|
+#include "crypto/secret_common.h"
|
|
#include "qom/object_interfaces.h"
|
|
#include "qom/object_interfaces.h"
|
|
#include "qemu/cutils.h"
|
|
#include "qemu/cutils.h"
|
|
#include "qemu/help_option.h"
|
|
#include "qemu/help_option.h"
|
|
@@ -3459,6 +3460,9 @@ static QemuOptsList qemu_vnc_opts = {
|
|
},{
|
|
},{
|
|
.name = "password",
|
|
.name = "password",
|
|
.type = QEMU_OPT_BOOL,
|
|
.type = QEMU_OPT_BOOL,
|
|
|
|
+ },{
|
|
|
|
+ .name = "password-secret",
|
|
|
|
+ .type = QEMU_OPT_STRING,
|
|
},{
|
|
},{
|
|
.name = "reverse",
|
|
.name = "reverse",
|
|
.type = QEMU_OPT_BOOL,
|
|
.type = QEMU_OPT_BOOL,
|
|
@@ -3931,6 +3935,7 @@ void vnc_display_open(const char *id, Error **errp)
|
|
int lock_key_sync = 1;
|
|
int lock_key_sync = 1;
|
|
int key_delay_ms;
|
|
int key_delay_ms;
|
|
const char *audiodev;
|
|
const char *audiodev;
|
|
|
|
+ const char *passwordSecret;
|
|
|
|
|
|
if (!vd) {
|
|
if (!vd) {
|
|
error_setg(errp, "VNC display not active");
|
|
error_setg(errp, "VNC display not active");
|
|
@@ -3948,7 +3953,23 @@ void vnc_display_open(const char *id, Error **errp)
|
|
goto fail;
|
|
goto fail;
|
|
}
|
|
}
|
|
|
|
|
|
- password = qemu_opt_get_bool(opts, "password", false);
|
|
|
|
|
|
+
|
|
|
|
+ passwordSecret = qemu_opt_get(opts, "password-secret");
|
|
|
|
+ if (passwordSecret) {
|
|
|
|
+ if (qemu_opt_get(opts, "password")) {
|
|
|
|
+ error_setg(errp,
|
|
|
|
+ "'password' flag is redundant with 'password-secret'");
|
|
|
|
+ goto fail;
|
|
|
|
+ }
|
|
|
|
+ vd->password = qcrypto_secret_lookup_as_utf8(passwordSecret,
|
|
|
|
+ errp);
|
|
|
|
+ if (!vd->password) {
|
|
|
|
+ goto fail;
|
|
|
|
+ }
|
|
|
|
+ password = true;
|
|
|
|
+ } else {
|
|
|
|
+ password = qemu_opt_get_bool(opts, "password", false);
|
|
|
|
+ }
|
|
if (password) {
|
|
if (password) {
|
|
if (fips_get_state()) {
|
|
if (fips_get_state()) {
|
|
error_setg(errp,
|
|
error_setg(errp,
|