From 584531e72e48d4ef1403eaac82fa85be2135f5c7 Mon Sep 17 00:00:00 2001 From: Andrey Markovytch Date: Mon, 8 Jun 2015 14:04:45 +0300 Subject: PFK: new module to work with ecryptfs PFK is a new module that accompanies eCryptfs and enables it to utilize ICE hw encryption engine. Module is responsible for storing encryption/decryption keys inside eCryptfs inodes for each file and loading them to ICE Change-Id: I6e755ca657164919147fe0d9482477e14a4be5eb Signed-off-by: Andrey Markovytch [gbroner@codeaurora.org: fix merge conflicts, adapted LSM hooks and added missing qseecom headers to fix compilation] Signed-off-by: Gilad Broner --- include/linux/pfk.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 include/linux/pfk.h (limited to 'include/linux') diff --git a/include/linux/pfk.h b/include/linux/pfk.h new file mode 100644 index 000000000000..f492d758291e --- /dev/null +++ b/include/linux/pfk.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef PFK_H_ +#define PFK_H_ + +#include + +struct ice_crypto_setting; + +#ifdef CONFIG_PFK + +int pfk_load_key(const struct bio *bio, struct ice_crypto_setting *ice_setting); +int pfk_remove_key(const unsigned char *key, size_t key_size); +bool pfk_allow_merge_bio(struct bio *bio1, struct bio *bio2); + +#else +static inline int pfk_load_key(const struct bio *bio, + struct ice_crypto_setting *ice_setting) +{ + return -ENODEV; +} + +static inline int pfk_remove_key(const unsigned char *key, size_t key_size) +{ + return -ENODEV; +} + +static inline bool pfk_allow_merge_bio(const struct bio *bio1, + const struct bio *bio2) +{ + return true; +} + +static inline void pfk_remove_all_keys(void) +{ +} + +#endif /* CONFIG_PFK */ + +#endif /* PFK_H */ -- cgit v1.2.3