aboutsummaryrefslogtreecommitdiff
path: root/actions/protector.go
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2021-12-20 11:14:08 -0600
committerEric Biggers <ebiggers@google.com>2021-12-21 13:00:58 -0600
commitdce50d2a55525ec1309fd60a3c240d243d5f7145 (patch)
tree2fbe4381eae0b234f82671a7d62998e063fa3c8b /actions/protector.go
parent9a8ce15408edae0c92128fd36f50dafa81013266 (diff)
[BROKEN] pam_fscrypt: save unlocked protector keys in root user keyring
Diffstat (limited to 'actions/protector.go')
-rw-r--r--actions/protector.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/actions/protector.go b/actions/protector.go
index 3278e63..7d51f79 100644
--- a/actions/protector.go
+++ b/actions/protector.go
@@ -260,6 +260,16 @@ func (protector *Protector) Unlock(keyFn KeyFunc) (err error) {
return
}
+// RawKey returns the internal key of an unlocked protector.
+func (protector *Protector) InternalKey() *crypto.Key {
+ return protector.key
+}
+
+// UnlockFromRawKey unlocks the protector directly from the internal key.
+func (protector *Protector) UnlockFromInternalKey(key *crypto.Key) {
+ protector.key = key
+}
+
// Lock wipes a Protector's internal Key. It should always be called after using
// an unlocked Protector. This is often done with a defer statement. There is
// no effect if called multiple times.