mirror of
https://github.com/openharmony/third_party_fsverity-utils.git
synced 2026-07-01 10:05:35 -04:00
f76d01b8ce
Add convenience functions that wrap FS_IOC_ENABLE_VERITY but take a 'struct libfsverity_merkle_tree_params' instead of 'struct fsverity_enable_arg'. This is useful because it allows libfsverity users to deal with one common struct, and also get the default parameter handling that libfsverity_compute_digest() does. Acked-by: Luca Boccassi <luca.boccassi@microsoft.com> Link: https://lore.kernel.org/r/20201116205628.262173-4-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
48 lines
1.3 KiB
C
48 lines
1.3 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Private header for the 'fsverity' program
|
|
*
|
|
* Copyright 2018 Google LLC
|
|
*
|
|
* Use of this source code is governed by an MIT-style
|
|
* license that can be found in the LICENSE file or at
|
|
* https://opensource.org/licenses/MIT.
|
|
*/
|
|
#ifndef PROGRAMS_FSVERITY_H
|
|
#define PROGRAMS_FSVERITY_H
|
|
|
|
#include "utils.h"
|
|
#include "../common/fsverity_uapi.h"
|
|
|
|
/*
|
|
* Largest digest size among all hash algorithms supported by fs-verity.
|
|
* This can be increased if needed.
|
|
*/
|
|
#define FS_VERITY_MAX_DIGEST_SIZE 64
|
|
|
|
struct fsverity_command;
|
|
|
|
/* cmd_digest.c */
|
|
int fsverity_cmd_digest(const struct fsverity_command *cmd,
|
|
int argc, char *argv[]);
|
|
|
|
/* cmd_enable.c */
|
|
int fsverity_cmd_enable(const struct fsverity_command *cmd,
|
|
int argc, char *argv[]);
|
|
|
|
/* cmd_measure.c */
|
|
int fsverity_cmd_measure(const struct fsverity_command *cmd,
|
|
int argc, char *argv[]);
|
|
|
|
/* cmd_sign.c */
|
|
int fsverity_cmd_sign(const struct fsverity_command *cmd,
|
|
int argc, char *argv[]);
|
|
|
|
/* fsverity.c */
|
|
void usage(const struct fsverity_command *cmd, FILE *fp);
|
|
bool parse_hash_alg_option(const char *arg, u32 *alg_ptr);
|
|
bool parse_block_size_option(const char *arg, u32 *size_ptr);
|
|
bool parse_salt_option(const char *arg, u8 **salt_ptr, u32 *salt_size_ptr);
|
|
|
|
#endif /* PROGRAMS_FSVERITY_H */
|