| 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_LENGTH, |
| 31 |
OPT_OFFSET, |
| 32 |
OPT_OUT_DESCRIPTOR, |
| 33 |
OPT_OUT_MERKLE_TREE, |
| 34 |
OPT_PKCS11_ENGINE, |
| 35 |
OPT_PKCS11_KEYID, |
| 36 |
OPT_PKCS11_MODULE, |
| 37 |
OPT_SALT, |
| 38 |
OPT_SIGNATURE, |
| 39 |
}; |
| 40 |
|
| 41 |
struct fsverity_command; |
| 42 |
|
| 43 |
/* cmd_digest.c */ |
| 44 |
int fsverity_cmd_digest(const struct fsverity_command *cmd, |
| 45 |
int argc, char *argv[]); |
| 46 |
|
| 47 |
/* cmd_dump_metadata.c */ |
| 48 |
int fsverity_cmd_dump_metadata(const struct fsverity_command *cmd, |
| 49 |
int argc, char *argv[]); |
| 50 |
|
| 51 |
/* cmd_enable.c */ |
| 52 |
int fsverity_cmd_enable(const struct fsverity_command *cmd, |
| 53 |
int argc, char *argv[]); |
| 54 |
|
| 55 |
/* cmd_measure.c */ |
| 56 |
int fsverity_cmd_measure(const struct fsverity_command *cmd, |
| 57 |
int argc, char *argv[]); |
| 58 |
|
| 59 |
/* cmd_sign.c */ |
| 60 |
int fsverity_cmd_sign(const struct fsverity_command *cmd, |
| 61 |
int argc, char *argv[]); |
| 62 |
|
| 63 |
/* fsverity.c */ |
| 64 |
void usage(const struct fsverity_command *cmd, FILE *fp); |
| 65 |
bool parse_tree_param(int opt_char, const char *arg, |
| 66 |
struct libfsverity_merkle_tree_params *params); |
| 67 |
bool destroy_tree_params(struct libfsverity_merkle_tree_params *params); |
| 68 |
|
| 69 |
#endif /* PROGRAMS_FSVERITY_H */ |