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>
This commit is contained in:
Tong Ho 2020-01-09 12:09:58 -08:00 committed by Daniel P. Berrangé
parent 609dd53df5
commit 569644f761

View File

@ -221,6 +221,7 @@ qcrypto_secret_prop_set_loaded(Object *obj,
secret->rawlen = inputlen;
} else {
g_free(secret->rawdata);
secret->rawdata = NULL;
secret->rawlen = 0;
}
}
@ -231,7 +232,7 @@ qcrypto_secret_prop_get_loaded(Object *obj,
Error **errp G_GNUC_UNUSED)
{
QCryptoSecret *secret = QCRYPTO_SECRET(obj);
return secret->data != NULL;
return secret->rawdata != NULL;
}