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

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