]> git.pld-linux.org Git - packages/volume_key.git/blob - volume_key-fips-crash.patch
Initial release (with upstream patches)
[packages/volume_key.git] / volume_key-fips-crash.patch
1 This case can be triggered by encrypting in FIPS mode, where the default
2 algorithm is unsupported and gpg crashes in response.
3
4 diff --git a/lib/crypto.c b/lib/crypto.c
5 index 06eb482..905d583 100644
6 --- a/lib/crypto.c
7 +++ b/lib/crypto.c
8 @@ -709,6 +709,12 @@ encrypt_with_passphrase (size_t *res_size, const void *data, size_t size,
9      }
10    gpgme_data_release (src_data);
11    gpgme_res = gpgme_data_release_and_get_mem (dest_data, res_size);
12 +  if (gpgme_res == NULL)
13 +    {
14 +      g_set_error (error, LIBVK_ERROR, LIBVK_ERROR_CRYPTO,
15 +                  _("Unknown error getting encryption result"));
16 +      goto err_ctx;
17 +    }
18    res = g_memdup (gpgme_res, *res_size);
19    gpgme_free (gpgme_res);
20  
21 @@ -759,6 +765,12 @@ decrypt_with_passphrase (size_t *res_size, const void *data, size_t size,
22      }
23    gpgme_data_release (src_data);
24    gpgme_res = gpgme_data_release_and_get_mem (dest_data, res_size);
25 +  if (gpgme_res == NULL)
26 +    {
27 +      g_set_error (error, LIBVK_ERROR, LIBVK_ERROR_CRYPTO,
28 +                  _("Unknown error getting decryption result"));
29 +      goto err_ctx;
30 +    }
31    res = g_memdup (gpgme_res, *res_size);
32    gpgme_free (gpgme_res);
33  
This page took 0.06175 seconds and 3 git commands to generate.