提交 30d27f24 编写于 作者: J John Ferlan

storage: Add extra failure condition for luks volume creation

Commit id '5e46d7d6' did not take into account that usage of a luks
volume will require usage of the master key encrypted passphrase for
a QEMU environment.  So rather than allow creation of something that
won't be usable, just fail the creation.
上级 a53349e6
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "internal.h" #include "internal.h"
#include "secret_conf.h" #include "secret_conf.h"
#include "secret_util.h" #include "secret_util.h"
#include "vircrypto.h"
#include "viruuid.h" #include "viruuid.h"
#include "virstoragefile.h" #include "virstoragefile.h"
#include "storage_backend.h" #include "storage_backend.h"
...@@ -1065,6 +1066,12 @@ virStorageBackendCreateQemuImgCheckEncryption(int format, ...@@ -1065,6 +1066,12 @@ virStorageBackendCreateQemuImgCheckEncryption(int format,
_("no secret provided for luks encryption")); _("no secret provided for luks encryption"));
return -1; return -1;
} }
if (!virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("luks encryption usage requires encrypted "
"secret generation to be supported"));
return -1;
}
} else { } else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("volume encryption unsupported with format %s"), type); _("volume encryption unsupported with format %s"), type);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册