Skip to content
Snippets Groups Projects
Commit 1e83ceeb authored by Frederic Danis's avatar Frederic Danis
Browse files

Re-enable libblockdev-crypto


This won't re-introduce warnings in the logs since the needed
libraries will be installed on the images since we need the crypto
backend for encrypted offline updates in apertis-update-manager.

Signed-off-by: default avatarFrédéric Danis <frederic.danis@collabora.com>
parent 56e0d2b8
No related branches found
No related tags found
No related merge requests found
From 91b2ef70030cb0d33f69c1c67206b528ef3118b9 Mon Sep 17 00:00:00 2001
From: Luis Araujo <luis.araujo@collabora.co.uk>
Date: Mon, 9 Mar 2020 18:20:12 +0800
Subject: [PATCH] Remove libblockdev-crypto usage
Signed-off-by: Luis Araujo <luis.araujo@collabora.co.uk>
---
configure.ac | 32 +++++++++++++++----------------
src/udisksdaemon.c | 4 ++--
src/udiskslinuxblock.c | 2 ++
src/udiskslinuxencrypted.c | 18 +++++++++++++++++
src/udiskslinuxencryptedhelpers.c | 3 +++
5 files changed, 41 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0f7b4c6..f8fe384 100644
--- a/configure.ac
+++ b/configure.ac
@@ -631,24 +631,24 @@ if test "x$have_fs" = "xno"; then
fi
# libblockdev crypto
-SAVE_CFLAGS=$CFLAGS
-SAVE_LDFLAGS=$LDFLAGS
-
-CFLAGS="$GLIB_CFLAGS"
-LDFLAGS="$GLIB_LIBS"
-AC_MSG_CHECKING([libblockdev-crypto presence])
-AC_TRY_COMPILE([#include <blockdev/crypto.h>], [],
- [AC_MSG_RESULT([yes])
- have_crypto=yes],
- [AC_MSG_RESULT([no])
- have_crypto=no])
+#SAVE_CFLAGS=$CFLAGS
+#SAVE_LDFLAGS=$LDFLAGS
-CFLAGS=$SAVE_CFLAGS
-LDFLAGS=$SAVE_LDFLAGS
+#CFLAGS="$GLIB_CFLAGS"
+#LDFLAGS="$GLIB_LIBS"
+#AC_MSG_CHECKING([libblockdev-crypto presence])
+#AC_TRY_COMPILE([#include <blockdev/crypto.h>], [],
+# [AC_MSG_RESULT([yes])
+# have_crypto=yes],
+# [AC_MSG_RESULT([no])
+# have_crypto=no])
+#
+#CFLAGS=$SAVE_CFLAGS
+#LDFLAGS=$SAVE_LDFLAGS
-if test "x$have_crypto" = "xno"; then
- AC_MSG_ERROR([BLOCKDEV CRYPTO support requested but header or library not found])
-fi
+#if test "x$have_crypto" = "xno"; then
+# AC_MSG_ERROR([BLOCKDEV CRYPTO support requested but header or library not found])
+#fi
# Internationalization
diff --git a/src/udisksdaemon.c b/src/udisksdaemon.c
index 03f7cf9..4a0a802 100644
--- a/src/udisksdaemon.c
+++ b/src/udisksdaemon.c
@@ -275,13 +275,13 @@ udisks_daemon_constructed (GObject *object)
BDPluginSpec loop_plugin = {BD_PLUGIN_LOOP, NULL};
BDPluginSpec mdraid_plugin = {BD_PLUGIN_MDRAID, NULL};
BDPluginSpec fs_plugin = {BD_PLUGIN_FS, NULL};
- BDPluginSpec crypto_plugin = {BD_PLUGIN_CRYPTO, NULL};
+ /* BDPluginSpec crypto_plugin = {BD_PLUGIN_CRYPTO, NULL}; */
/* The core daemon needs the part, swap, loop, mdraid, fs and crypto plugins.
Additional plugins are required by various modules, but they make sure
plugins are loaded themselves. */
BDPluginSpec *plugins[] = {&swap_plugin, &loop_plugin, &mdraid_plugin,
- &fs_plugin, &crypto_plugin, NULL};
+ &fs_plugin, NULL};
BDPluginSpec **plugin_p = NULL;
error = NULL;
diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c
index 8c233b5..20e958d 100644
--- a/src/udiskslinuxblock.c
+++ b/src/udiskslinuxblock.c
@@ -1231,6 +1231,7 @@ udisks_linux_block_update (UDisksLinuxBlock *block,
udisks_block_set_id (iface, NULL);
}
+#if 0
if (udisks_daemon_get_enable_tcrypt (daemon))
{
seems_encrypted = bd_crypto_device_seems_encrypted (device_file, &error);
@@ -1241,6 +1242,7 @@ udisks_linux_block_update (UDisksLinuxBlock *block,
g_clear_error (&error);
}
}
+#endif
if (seems_encrypted)
{
diff --git a/src/udiskslinuxencrypted.c b/src/udiskslinuxencrypted.c
index 2ff8d4b..dbd0a83 100644
--- a/src/udiskslinuxencrypted.c
+++ b/src/udiskslinuxencrypted.c
@@ -27,7 +27,9 @@
#include <string.h>
#include <stdlib.h>
+#if 0
#include <blockdev/crypto.h>
+#endif
#include <glib/gstdio.h>
@@ -324,6 +326,13 @@ handle_unlock (UDisksEncrypted *encrypted,
const gchar *passphrase,
GVariant *options)
{
+ g_dbus_method_invocation_return_error_literal (invocation,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_FAILED,
+ "Stubbed out to prevent crypto usage");
+ return TRUE;
+
+#if 0
UDisksObject *object = NULL;
UDisksBlock *block;
UDisksDaemon *daemon;
@@ -628,6 +637,7 @@ handle_unlock (UDisksEncrypted *encrypted,
udisks_string_wipe_and_free (effective_passphrase);
return TRUE; /* returning TRUE means that we handled the method invocation */
+#endif
}
/* ---------------------------------------------------------------------------------------------------- */
@@ -966,6 +976,13 @@ handle_resize (UDisksEncrypted *encrypted,
guint64 size,
GVariant *options)
{
+ g_dbus_method_invocation_return_error_literal (invocation,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_FAILED,
+ "Stubbed out to prevent crypto usage");
+ return TRUE;
+
+#if 0
UDisksObject *object = NULL;
UDisksBlock *block;
UDisksObject *cleartext_object = NULL;
@@ -1100,6 +1117,7 @@ handle_resize (UDisksEncrypted *encrypted,
g_clear_error (&error);
udisks_string_wipe_and_free (effective_passphrase);
return TRUE; /* returning TRUE means that we handled the method invocation */
+#endif
}
/* ---------------------------------------------------------------------------------------------------- */
diff --git a/src/udiskslinuxencryptedhelpers.c b/src/udiskslinuxencryptedhelpers.c
index 584537f..45352d6 100644
--- a/src/udiskslinuxencryptedhelpers.c
+++ b/src/udiskslinuxencryptedhelpers.c
@@ -21,7 +21,10 @@
*/
#include <glib.h>
+
+#if 0
#include <blockdev/crypto.h>
+#endif
#include "udisksthreadedjob.h"
#include "udiskslinuxencryptedhelpers.h"
--
2.17.1
......@@ -73,14 +73,14 @@ index 4a0a802..1dfcefb 100644
- BDPluginSpec mdraid_plugin = {BD_PLUGIN_MDRAID, NULL};
+ /* BDPluginSpec mdraid_plugin = {BD_PLUGIN_MDRAID, NULL}; */
BDPluginSpec fs_plugin = {BD_PLUGIN_FS, NULL};
/* BDPluginSpec crypto_plugin = {BD_PLUGIN_CRYPTO, NULL}; */
BDPluginSpec crypto_plugin = {BD_PLUGIN_CRYPTO, NULL};
/* The core daemon needs the part, swap, loop, mdraid, fs and crypto plugins.
Additional plugins are required by various modules, but they make sure
plugins are loaded themselves. */
- BDPluginSpec *plugins[] = {&swap_plugin, &loop_plugin, &mdraid_plugin,
+ BDPluginSpec *plugins[] = {&swap_plugin, &loop_plugin,
&fs_plugin, NULL};
&fs_plugin, &crypto_plugin, NULL};
BDPluginSpec **plugin_p = NULL;
error = NULL;
diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c
......@@ -103,7 +103,7 @@ index 20e958d..bac6da0 100644
/* ---------------------------------------------------------------------------------------------------- */
@@ -1270,7 +1272,9 @@ udisks_linux_block_update (UDisksLinuxBlock *block,
@@ -1268,7 +1270,9 @@ udisks_linux_block_update (UDisksLinuxBlock *block,
#ifdef HAVE_LIBMOUNT
update_userspace_mount_options (block, daemon);
#endif
......
......@@ -2,6 +2,5 @@ Move-D-Bus-policy-file-to-usr-share-dbus-1-system.d.patch
integration-test-Sync-after-creating-our-fake-devices.patch
0001-Hack-disable-blockdev-part-usage.patch
0002-Remove-part-plugin.patch
0003-Remove-libblockdev-crypto-usage.patch
0004-Remove-libblockdev-mdraid-usage.patch
no-space-in-mount.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment