fscrypt: Wrapped key support for FBE

Commit imported from:

https: //github.com/LineageOS/android_system_vold/commit/ce024f07c23d0649635a336fff389332b9806f48
Change-Id: I924a9fcbac7d790609fbafcf8c12654fdb267e32
This commit is contained in:
mauronofrio matarrese
2020-06-23 14:43:17 +00:00
committed by bigbiff
parent 86fabbe4d0
commit 7982032fcd
8 changed files with 262 additions and 20 deletions
+10 -1
View File
@@ -17,8 +17,9 @@
#ifndef ANDROID_VOLD_KEYSTORAGE_H
#define ANDROID_VOLD_KEYSTORAGE_H
#include "Keymaster.h"
#include "KeyBuffer.h"
#include <cutils/multiuser.h>
#include <string>
namespace android {
@@ -39,6 +40,12 @@ class KeyAuthentication {
const std::string secret;
};
enum class KeyType {
DE_SYS,
DE_USER,
CE_USER
};
extern const KeyAuthentication kEmptyAuthentication;
// Checks if path "path" exists.
@@ -68,6 +75,8 @@ bool retrieveKey(const std::string& dir, const KeyAuthentication& auth, KeyBuffe
bool destroyKey(const std::string& dir);
bool runSecdiscardSingle(const std::string& file);
bool generateWrappedKey(userid_t user_id, KeyType key_type, KeyBuffer* key);
bool getEphemeralWrappedKey(km::KeyFormat format, KeyBuffer& kmKey, KeyBuffer* key);
} // namespace vold
} // namespace android