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

Skip to content
Commit 81734875 authored by Barani Muthukumaran's avatar Barani Muthukumaran Committed by Todd Kjos
Browse files

ANDROID: fscrypt: add support for hardware-wrapped keys



To prevent keys from being compromised if an attacker acquires read
access to kernel memory, some inline encryption hardware supports
protecting the keys in hardware without software having access to or the
ability to set the plaintext keys.  Instead, software only sees "wrapped
keys", which may differ on every boot.  The keys can be initially
generated either by software (in which case they need to be imported to
hardware to be wrapped), or directly by the hardware.

Add support for this type of hardware by allowing keys to be flagged as
hardware-wrapped and encryption policies to be flagged as needing a
hardware-wrapped key.  When used, fscrypt will pass the wrapped key
directly to the inline encryption hardware to encrypt file contents.
The hardware is responsible for internally unwrapping the key and
deriving the actual file contents encryption key.

fscrypt also asks the inline encryption hardware to derive a
cryptographically isolated software "secret", which fscrypt then uses as
the master key for all other purposes besides file contents encryption,
e.g. to derive filenames encryption keys and the key identifier.

Bug: 147209885

Change-Id: I7f4cc5c32f130709db3eb9ebdb1ebfff5751ca95
Co-developed-by: default avatarGaurav Kashyap <gaurkash@codeaurora.org>
Signed-off-by: default avatarGaurav Kashyap <gaurkash@codeaurora.org>
Signed-off-by: default avatarBarani Muthukumaran <bmuthuku@codeaurora.org>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
parent 3e8cceb7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment