Blame SOURCES/cryptsetup-2.6.0-Fix-cipher-convert-routines-naming-confusion.patch

c31bd2
From 3616da631f83a004a13a575a54df8123f0d65c29 Mon Sep 17 00:00:00 2001
c31bd2
From: Ondrej Kozina <okozina@redhat.com>
c31bd2
Date: Mon, 17 Oct 2022 15:18:42 +0200
c31bd2
Subject: [PATCH 1/5] Fix cipher convert routines naming confusion.
c31bd2
c31bd2
The function names were in fact swaped.
c31bd2
---
c31bd2
 lib/libdevmapper.c | 8 ++++----
c31bd2
 1 file changed, 4 insertions(+), 4 deletions(-)
c31bd2
c31bd2
diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c
c31bd2
index 6c2eab78..0e45a789 100644
c31bd2
--- a/lib/libdevmapper.c
c31bd2
+++ b/lib/libdevmapper.c
c31bd2
@@ -481,7 +481,7 @@ static size_t int_log10(uint64_t x)
c31bd2
 #define CAPIL  144   /* should be enough to fit whole capi string */
c31bd2
 #define CAPIS "143"  /* for sscanf of crypto API string + 16  + \0 */
c31bd2
 
c31bd2
-static int cipher_c2dm(const char *org_c, const char *org_i, unsigned tag_size,
c31bd2
+static int cipher_dm2c(const char *org_c, const char *org_i, unsigned tag_size,
c31bd2
 		       char *c_dm, int c_dm_size,
c31bd2
 		       char *i_dm, int i_dm_size)
c31bd2
 {
c31bd2
@@ -543,7 +543,7 @@ static int cipher_c2dm(const char *org_c, const char *org_i, unsigned tag_size,
c31bd2
 	return 0;
c31bd2
 }
c31bd2
 
c31bd2
-static int cipher_dm2c(char **org_c, char **org_i, const char *c_dm, const char *i_dm)
c31bd2
+static int cipher_c2dm(char **org_c, char **org_i, const char *c_dm, const char *i_dm)
c31bd2
 {
c31bd2
 	char cipher[CLEN], mode[CLEN], iv[CLEN], auth[CLEN];
c31bd2
 	char tmp[CAPIL], dmcrypt_tmp[CAPIL*2], capi[CAPIL+1];
c31bd2
@@ -629,7 +629,7 @@ static char *get_dm_crypt_params(const struct dm_target *tgt, uint32_t flags)
c31bd2
 	if (!tgt)
c31bd2
 		return NULL;
c31bd2
 
c31bd2
-	r = cipher_c2dm(tgt->u.crypt.cipher, tgt->u.crypt.integrity, tgt->u.crypt.tag_size,
c31bd2
+	r = cipher_dm2c(tgt->u.crypt.cipher, tgt->u.crypt.integrity, tgt->u.crypt.tag_size,
c31bd2
 			cipher_dm, sizeof(cipher_dm), integrity_dm, sizeof(integrity_dm));
c31bd2
 	if (r < 0)
c31bd2
 		return NULL;
c31bd2
@@ -2066,7 +2066,7 @@ static int _dm_target_query_crypt(struct crypt_device *cd, uint32_t get_flags,
c31bd2
 
c31bd2
 	/* cipher */
c31bd2
 	if (get_flags & DM_ACTIVE_CRYPT_CIPHER) {
c31bd2
-		r = cipher_dm2c(CONST_CAST(char**)&cipher,
c31bd2
+		r = cipher_c2dm(CONST_CAST(char**)&cipher,
c31bd2
 				CONST_CAST(char**)&integrity,
c31bd2
 				rcipher, rintegrity);
c31bd2
 		if (r < 0)
c31bd2
-- 
c31bd2
2.38.1
c31bd2