OSDN Git Service

ubifs: Create functions to embed a HMAC in a node
authorSascha Hauer <s.hauer@pengutronix.de>
Fri, 7 Sep 2018 12:36:33 +0000 (14:36 +0200)
committerRichard Weinberger <richard@nod.at>
Tue, 23 Oct 2018 11:48:37 +0000 (13:48 +0200)
commita384b47e4954a0f834749fcbe1c096c40ff5eb35
tree512ccd678b77a62ad99a674e309204437fa5bf04
parent49525e5eecca5e1b4a83ac217868e8d8b843539f
ubifs: Create functions to embed a HMAC in a node

With authentication support some nodes (master node, super block node)
get a HMAC embedded into them. This patch adds functions to prepare and
write such a node.
The difficulty is that besides the HMAC the nodes also have a CRC which
must stay valid. This means we first have to initialize all fields in
the node, then calculate the HMAC (not covering the CRC) and finally
calculate the CRC.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/io.c
fs/ubifs/ubifs.h