diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 6aa55939f1..862fb29144 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -56,6 +56,7 @@ #include "internal.h" #include "secret_conf.h" #include "secret_util.h" +#include "vircrypto.h" #include "viruuid.h" #include "virstoragefile.h" #include "storage_backend.h" @@ -1065,6 +1066,12 @@ virStorageBackendCreateQemuImgCheckEncryption(int format, _("no secret provided for luks encryption")); 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 { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("volume encryption unsupported with format %s"), type);