1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Private header for the 'fsverity' program 4 * 5 * Copyright 2018 Google LLC 6 * 7 * Use of this source code is governed by an MIT-style 8 * license that can be found in the LICENSE file or at 9 * https://opensource.org/licenses/MIT. 10 */ 11 #ifndef PROGRAMS_FSVERITY_H 12 #define PROGRAMS_FSVERITY_H 13 14 #include "utils.h" 15 #include "../common/fsverity_uapi.h" 16 17 /* 18 * Largest digest size among all hash algorithms supported by fs-verity. 19 * This can be increased if needed. 20 */ 21 #define FS_VERITY_MAX_DIGEST_SIZE 64 22 23 enum { 24 OPT_BLOCK_SIZE, 25 OPT_CERT, 26 OPT_COMPACT, 27 OPT_FOR_BUILTIN_SIG, 28 OPT_HASH_ALG, 29 OPT_KEY, 30 OPT_SALT, 31 OPT_SIGNATURE, 32 }; 33 34 struct fsverity_command; 35 36 /* cmd_digest.c */ 37 int fsverity_cmd_digest(const struct fsverity_command *cmd, 38 int argc, char *argv[]); 39 40 /* cmd_enable.c */ 41 int fsverity_cmd_enable(const struct fsverity_command *cmd, 42 int argc, char *argv[]); 43 44 /* cmd_measure.c */ 45 int fsverity_cmd_measure(const struct fsverity_command *cmd, 46 int argc, char *argv[]); 47 48 /* cmd_sign.c */ 49 int fsverity_cmd_sign(const struct fsverity_command *cmd, 50 int argc, char *argv[]); 51 52 /* fsverity.c */ 53 void usage(const struct fsverity_command *cmd, FILE *fp); 54 bool parse_tree_param(int opt_char, const char *arg, 55 struct libfsverity_merkle_tree_params *params); 56 void destroy_tree_params(struct libfsverity_merkle_tree_params *params); 57 58 #endif /* PROGRAMS_FSVERITY_H */ 59