|
|
30e489 |
From 7a0e344d0642f76992c943158621d8ee7e5caea3 Mon Sep 17 00:00:00 2001
|
|
|
30e489 |
From: Vojtech Trefny <vtrefny@redhat.com>
|
|
|
30e489 |
Date: Tue, 15 Nov 2022 13:21:25 +0100
|
|
|
30e489 |
Subject: [PATCH 1/2] crypto: Fix GError overwrite from libvolume_key
|
|
|
30e489 |
|
|
|
30e489 |
---
|
|
|
30e489 |
src/plugins/crypto.c | 7 ++++---
|
|
|
30e489 |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
30e489 |
|
|
|
30e489 |
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
|
|
|
30e489 |
index 35c38410..9064c8e3 100644
|
|
|
30e489 |
--- a/src/plugins/crypto.c
|
|
|
30e489 |
+++ b/src/plugins/crypto.c
|
|
|
30e489 |
@@ -2552,13 +2552,14 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
|
|
|
30e489 |
GIOChannel *out_file = NULL;
|
|
|
30e489 |
GIOStatus status = G_IO_STATUS_ERROR;
|
|
|
30e489 |
gsize bytes_written = 0;
|
|
|
30e489 |
+ GError *l_error = NULL;
|
|
|
30e489 |
|
|
|
30e489 |
packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, secret_type, cert,
|
|
|
30e489 |
- ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, error);
|
|
|
30e489 |
-
|
|
|
30e489 |
+ ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, &l_error);
|
|
|
30e489 |
if (!packet_data) {
|
|
|
30e489 |
g_set_error (error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_ESCROW_FAILED,
|
|
|
30e489 |
- "Failed to get escrow data");
|
|
|
30e489 |
+ "Failed to get escrow data: %s", l_error->message);
|
|
|
30e489 |
+ g_clear_error (&l_error);
|
|
|
30e489 |
libvk_volume_free (volume);
|
|
|
30e489 |
return FALSE;
|
|
|
30e489 |
}
|
|
|
30e489 |
--
|
|
|
30e489 |
2.38.1
|
|
|
30e489 |
|
|
|
30e489 |
|
|
|
30e489 |
From 25bf34c4c03e37eb3782dfccf459b9a3f795ddb3 Mon Sep 17 00:00:00 2001
|
|
|
30e489 |
From: Vojtech Trefny <vtrefny@redhat.com>
|
|
|
30e489 |
Date: Wed, 16 Nov 2022 10:26:06 +0100
|
|
|
30e489 |
Subject: [PATCH 2/2] crypto: Fix double free in write_escrow_data_file
|
|
|
30e489 |
|
|
|
30e489 |
---
|
|
|
30e489 |
src/plugins/crypto.c | 1 -
|
|
|
30e489 |
1 file changed, 1 deletion(-)
|
|
|
30e489 |
|
|
|
30e489 |
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
|
|
|
30e489 |
index 9064c8e3..2086209e 100644
|
|
|
30e489 |
--- a/src/plugins/crypto.c
|
|
|
30e489 |
+++ b/src/plugins/crypto.c
|
|
|
30e489 |
@@ -2560,7 +2560,6 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
|
|
|
30e489 |
g_set_error (error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_ESCROW_FAILED,
|
|
|
30e489 |
"Failed to get escrow data: %s", l_error->message);
|
|
|
30e489 |
g_clear_error (&l_error);
|
|
|
30e489 |
- libvk_volume_free (volume);
|
|
|
30e489 |
return FALSE;
|
|
|
30e489 |
}
|
|
|
30e489 |
|
|
|
30e489 |
--
|
|
|
30e489 |
2.38.1
|
|
|
30e489 |
|