aboutsummaryrefslogtreecommitdiff
path: root/ubifs-utils/libubifs/master.c
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2024-11-11 17:00:54 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-11-11 10:32:45 +0100
commit0e537c08629ec82c0268358073e2e1c30d7590a1 (patch)
treec7b0e5ebe94c586db2e92716379e1810a54f45b4 /ubifs-utils/libubifs/master.c
parent9d41ca357d216faec413e2036162f7ab55057b95 (diff)
ubifs-utils: Adapt master.c in libubifs
Adapt master.c in libubifs, compared with linux kernel implementations: 1. Remove authentication related implementations (eg. mst_node_check_hash), authentication is not supported in fsck for now. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/libubifs/master.c')
-rw-r--r--ubifs-utils/libubifs/master.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/ubifs-utils/libubifs/master.c b/ubifs-utils/libubifs/master.c
index 7adc37c..cce1a41 100644
--- a/ubifs-utils/libubifs/master.c
+++ b/ubifs-utils/libubifs/master.c
@@ -10,7 +10,11 @@
/* This file implements reading and writing the master node */
+#include "linux_err.h"
+#include "kmem.h"
#include "ubifs.h"
+#include "defs.h"
+#include "debug.h"
/**
* ubifs_compare_master_node - compare two UBIFS master nodes
@@ -21,7 +25,7 @@
* This function compares two UBIFS master nodes. Returns 0 if they are equal
* and nonzero if not.
*/
-int ubifs_compare_master_node(struct ubifs_info *c, void *m1, void *m2)
+int ubifs_compare_master_node(__unused struct ubifs_info *c, void *m1, void *m2)
{
int ret;
int behind;
@@ -61,20 +65,11 @@ int ubifs_compare_master_node(struct ubifs_info *c, void *m1, void *m2)
*
* Returns 0 if the hashes are equal, a negative error code otherwise.
*/
-static int mst_node_check_hash(const struct ubifs_info *c,
- const struct ubifs_mst_node *mst,
- const u8 *expected)
+static int mst_node_check_hash(__unused const struct ubifs_info *c,
+ __unused const struct ubifs_mst_node *mst,
+ __unused const u8 *expected)
{
- u8 calc[UBIFS_MAX_HASH_LEN];
- const void *node = mst;
-
- crypto_shash_tfm_digest(c->hash_tfm, node + sizeof(struct ubifs_ch),
- UBIFS_MST_NODE_SZ - sizeof(struct ubifs_ch),
- calc);
-
- if (ubifs_check_hash(c, expected, calc))
- return -EPERM;
-
+ // To be implemented
return 0;
}