Blame SOURCES/volume_key-0.3.9-fips-crash.patch
|
|
eec0cc |
This case can be triggered by encrypting in FIPS mode, where the default
|
|
|
eec0cc |
algorithm is unsupported and gpg crashes in response.
|
|
|
eec0cc |
|
|
|
eec0cc |
diff --git a/lib/crypto.c b/lib/crypto.c
|
|
|
eec0cc |
index 06eb482..905d583 100644
|
|
|
eec0cc |
--- a/lib/crypto.c
|
|
|
eec0cc |
+++ b/lib/crypto.c
|
|
|
eec0cc |
@@ -709,6 +709,12 @@ encrypt_with_passphrase (size_t *res_size, const void *data, size_t size,
|
|
|
eec0cc |
}
|
|
|
eec0cc |
gpgme_data_release (src_data);
|
|
|
eec0cc |
gpgme_res = gpgme_data_release_and_get_mem (dest_data, res_size);
|
|
|
eec0cc |
+ if (gpgme_res == NULL)
|
|
|
eec0cc |
+ {
|
|
|
eec0cc |
+ g_set_error (error, LIBVK_ERROR, LIBVK_ERROR_CRYPTO,
|
|
|
eec0cc |
+ _("Unknown error getting encryption result"));
|
|
|
eec0cc |
+ goto err_ctx;
|
|
|
eec0cc |
+ }
|
|
|
eec0cc |
res = g_memdup (gpgme_res, *res_size);
|
|
|
eec0cc |
gpgme_free (gpgme_res);
|
|
|
eec0cc |
|
|
|
eec0cc |
@@ -759,6 +765,12 @@ decrypt_with_passphrase (size_t *res_size, const void *data, size_t size,
|
|
|
eec0cc |
}
|
|
|
eec0cc |
gpgme_data_release (src_data);
|
|
|
eec0cc |
gpgme_res = gpgme_data_release_and_get_mem (dest_data, res_size);
|
|
|
eec0cc |
+ if (gpgme_res == NULL)
|
|
|
eec0cc |
+ {
|
|
|
eec0cc |
+ g_set_error (error, LIBVK_ERROR, LIBVK_ERROR_CRYPTO,
|
|
|
eec0cc |
+ _("Unknown error getting decryption result"));
|
|
|
eec0cc |
+ goto err_ctx;
|
|
|
eec0cc |
+ }
|
|
|
eec0cc |
res = g_memdup (gpgme_res, *res_size);
|
|
|
eec0cc |
gpgme_free (gpgme_res);
|
|
|
eec0cc |
|