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