mirror of https://github.com/proxmox/mirror_qemu
crypto: fix getter of a QCryptoSecret's property
This fixes the condition-check done by the "loaded" property getter, such that the property returns true even when the secret is loaded by the 'file' option. Signed-off-by: Tong Ho <tong.ho@xilinx.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>master
parent
609dd53df5
commit
569644f761
|
@ -221,6 +221,7 @@ qcrypto_secret_prop_set_loaded(Object *obj,
|
||||||
secret->rawlen = inputlen;
|
secret->rawlen = inputlen;
|
||||||
} else {
|
} else {
|
||||||
g_free(secret->rawdata);
|
g_free(secret->rawdata);
|
||||||
|
secret->rawdata = NULL;
|
||||||
secret->rawlen = 0;
|
secret->rawlen = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,7 +232,7 @@ qcrypto_secret_prop_get_loaded(Object *obj,
|
||||||
Error **errp G_GNUC_UNUSED)
|
Error **errp G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
QCryptoSecret *secret = QCRYPTO_SECRET(obj);
|
QCryptoSecret *secret = QCRYPTO_SECRET(obj);
|
||||||
return secret->data != NULL;
|
return secret->rawdata != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue