treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / md / dm-verity-verify-sig.h
blob19b1547aa741ead9d72afd8dd826e4ea6526a2d0
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (C) 2019 Microsoft Corporation.
5 * Author: Jaskaran Singh Khurana <jaskarankhurana@linux.microsoft.com>
7 */
8 #ifndef DM_VERITY_SIG_VERIFICATION_H
9 #define DM_VERITY_SIG_VERIFICATION_H
11 #define DM_VERITY_ROOT_HASH_VERIFICATION "DM Verity Sig Verification"
12 #define DM_VERITY_ROOT_HASH_VERIFICATION_OPT_SIG_KEY "root_hash_sig_key_desc"
14 struct dm_verity_sig_opts {
15 unsigned int sig_size;
16 u8 *sig;
19 #ifdef CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG
21 #define DM_VERITY_ROOT_HASH_VERIFICATION_OPTS 2
23 int verity_verify_root_hash(const void *data, size_t data_len,
24 const void *sig_data, size_t sig_len);
25 bool verity_verify_is_sig_opt_arg(const char *arg_name);
27 int verity_verify_sig_parse_opt_args(struct dm_arg_set *as, struct dm_verity *v,
28 struct dm_verity_sig_opts *sig_opts,
29 unsigned int *argc, const char *arg_name);
31 void verity_verify_sig_opts_cleanup(struct dm_verity_sig_opts *sig_opts);
33 #else
35 #define DM_VERITY_ROOT_HASH_VERIFICATION_OPTS 0
37 int verity_verify_root_hash(const void *data, size_t data_len,
38 const void *sig_data, size_t sig_len)
40 return 0;
43 bool verity_verify_is_sig_opt_arg(const char *arg_name)
45 return false;
48 int verity_verify_sig_parse_opt_args(struct dm_arg_set *as, struct dm_verity *v,
49 struct dm_verity_sig_opts *sig_opts,
50 unsigned int *argc, const char *arg_name)
52 return -EINVAL;
55 void verity_verify_sig_opts_cleanup(struct dm_verity_sig_opts *sig_opts)
59 #endif /* CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG */
60 #endif /* DM_VERITY_SIG_VERIFICATION_H */