From dce50d2a55525ec1309fd60a3c240d243d5f7145 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 20 Dec 2021 11:14:08 -0600 Subject: [BROKEN] pam_fscrypt: save unlocked protector keys in root user keyring --- actions/protector.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actions') 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. -- cgit v1.2.3