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

Commit a9170837 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Include linux/fsverity.h and remove inlined definition"

parents 65943dbc e2e7470e
Loading
Loading
Loading
Loading
+1 −34
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

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

#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;

namespace android {