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

Commit c8911a14 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

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

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

Change-Id: I5e2c9841b0c1f967c069d503b9bcf3ef875caa58
parents d5214467 32a79c9c
Loading
Loading
Loading
Loading
+1 −34
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include <errno.h>
#include <fcntl.h>
#include <linux/fsverity.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
@@ -33,40 +34,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 {