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