summaryrefslogtreecommitdiffstats
path: root/crypto/ext4crypt/KeyStorage4.h
diff options
context:
space:
mode:
authorPeter Cai <peter@typeblog.net>2019-05-23 10:32:22 +0200
committerbig biff <bigbiff@teamw.in>2019-09-01 19:33:30 +0200
commit90edd2e867b238e71ee198e3460e289cd7dee54c (patch)
tree3febcf7620a3ee3bb2043d91c981f9e7a1b635ff /crypto/ext4crypt/KeyStorage4.h
parentMerge "fix build error in 9.0 with TW_NO_EXFAT_FUSE:=true" into android-9.0 (diff)
downloadandroid_bootable_recovery-90edd2e867b238e71ee198e3460e289cd7dee54c.tar
android_bootable_recovery-90edd2e867b238e71ee198e3460e289cd7dee54c.tar.gz
android_bootable_recovery-90edd2e867b238e71ee198e3460e289cd7dee54c.tar.bz2
android_bootable_recovery-90edd2e867b238e71ee198e3460e289cd7dee54c.tar.lz
android_bootable_recovery-90edd2e867b238e71ee198e3460e289cd7dee54c.tar.xz
android_bootable_recovery-90edd2e867b238e71ee198e3460e289cd7dee54c.tar.zst
android_bootable_recovery-90edd2e867b238e71ee198e3460e289cd7dee54c.zip
Diffstat (limited to 'crypto/ext4crypt/KeyStorage4.h')
-rw-r--r--crypto/ext4crypt/KeyStorage4.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/ext4crypt/KeyStorage4.h b/crypto/ext4crypt/KeyStorage4.h
index 35ff65e63..f74865f8d 100644
--- a/crypto/ext4crypt/KeyStorage4.h
+++ b/crypto/ext4crypt/KeyStorage4.h
@@ -17,13 +17,17 @@
#ifndef ANDROID_TWRP_KEYSTORAGE_H
#define ANDROID_TWRP_KEYSTORAGE_H
+#include "Keymaster4.h"
#include "KeyBuffer.h"
+#include <ext4_utils/ext4_crypt.h>
#include <string>
namespace android {
namespace vold {
+namespace km = ::android::hardware::keymaster::V4_0;
+
// Represents the information needed to decrypt a disk encryption key.
// If "token" is nonempty, it is passed in as a required Gatekeeper auth token.
// If "token" and "secret" are nonempty, "secret" is appended to the application-specific
@@ -39,6 +43,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.
@@ -67,6 +77,9 @@ 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