Blame SOURCES/cryptsetup-2.6.0-Copy-also-integrity-string-in-legacy-mode.patch

c31bd2
From 19c15a652f878458493f0ac335110e2779f3cbe3 Mon Sep 17 00:00:00 2001
c31bd2
From: Ondrej Kozina <okozina@redhat.com>
c31bd2
Date: Wed, 12 Oct 2022 11:59:09 +0200
c31bd2
Subject: [PATCH 4/5] Copy also integrity string in legacy mode.
c31bd2
c31bd2
So that it handles integrity string same as it does
c31bd2
with cipher string.
c31bd2
---
c31bd2
 lib/utils_crypt.c | 9 ++++++++-
c31bd2
 1 file changed, 8 insertions(+), 1 deletion(-)
c31bd2
c31bd2
diff --git a/lib/utils_crypt.c b/lib/utils_crypt.c
c31bd2
index 4f4dbba8..93f846d7 100644
c31bd2
--- a/lib/utils_crypt.c
c31bd2
+++ b/lib/utils_crypt.c
c31bd2
@@ -284,7 +284,14 @@ int crypt_capi_to_cipher(char **org_c, char **org_i, const char *c_dm, const cha
c31bd2
 	if (strncmp(c_dm, "capi:", 4)) {
c31bd2
 		if (!(*org_c = strdup(c_dm)))
c31bd2
 			return -ENOMEM;
c31bd2
-		*org_i = NULL;
c31bd2
+		if (i_dm) {
c31bd2
+			if (!(*org_i = strdup(i_dm))) {
c31bd2
+				free(*org_c);
c31bd2
+				*org_c = NULL;
c31bd2
+				return -ENOMEM;
c31bd2
+			}
c31bd2
+		} else
c31bd2
+			*org_i = NULL;
c31bd2
 		return 0;
c31bd2
 	}
c31bd2
 
c31bd2
-- 
c31bd2
2.38.1
c31bd2