Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32a79c9c authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Include linux/fsverity.h and remove inlined definition" am: a9170837 am: 1043c0ce

Change-Id: I47d7f5a4e45691f2cb53647541ba379e93c05c6e
parents 81b66fc0 1043c0ce
Loading
Loading
Loading
Loading
+1 −34
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@


#include <errno.h>
#include <errno.h>
#include <fcntl.h>
#include <fcntl.h>
#include <linux/fsverity.h>
#include <string.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/stat.h>
@@ -31,40 +32,6 @@


#include <android-base/unique_fd.h>
#include <android-base/unique_fd.h>


// TODO(112037636): Always include once fsverity.h is upstreamed.
#if __has_include(<linux/fsverity.h>)
#include <linux/fsverity.h>
#else

#include <linux/limits.h>
#include <linux/ioctl.h>
#include <linux/types.h>

#define FS_VERITY_HASH_ALG_SHA256	1

struct fsverity_enable_arg {
	__u32 version;
	__u32 hash_algorithm;
	__u32 block_size;
	__u32 salt_size;
	__u64 salt_ptr;
	__u32 sig_size;
	__u32 __reserved1;
	__u64 sig_ptr;
	__u64 __reserved2[11];
};

struct fsverity_digest {
    __u16 digest_algorithm;
    __u16 digest_size; /* input/output */
    __u8 digest[];
};

#define FS_IOC_ENABLE_VERITY	_IOW('f', 133, struct fsverity_enable_arg)
#define FS_IOC_MEASURE_VERITY	_IOWR('f', 134, struct fsverity_digest)

#endif

const int kSha256Bytes = 32;
const int kSha256Bytes = 32;


namespace android {
namespace android {