• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
4  * Author: Dai Shili <daisl.fnst@cn.fujitsu.com>
5  */
6 #ifndef LAPI_FSVERITY_H__
7 #define LAPI_FSVERITY_H__
8 
9 #include "config.h"
10 #include <stdint.h>
11 #include <sys/ioctl.h>
12 
13 #ifdef HAVE_LINUX_FSVERITY_H
14 #include <linux/fsverity.h>
15 #endif
16 
17 #ifndef FS_VERITY_HASH_ALG_SHA256
18 # define FS_VERITY_HASH_ALG_SHA256       1
19 #endif
20 
21 #ifndef HAVE_STRUCT_FSVERITY_ENABLE_ARG
22 struct fsverity_enable_arg {
23 	uint32_t version;
24 	uint32_t hash_algorithm;
25 	uint32_t block_size;
26 	uint32_t salt_size;
27 	uint64_t salt_ptr;
28 	uint32_t sig_size;
29 	uint32_t __reserved1;
30 	uint64_t sig_ptr;
31 	uint64_t __reserved2[11];
32 };
33 #endif
34 
35 #ifndef FS_IOC_ENABLE_VERITY
36 # define FS_IOC_ENABLE_VERITY    _IOW('f', 133, struct fsverity_enable_arg)
37 #endif
38 
39 #endif
40