From d685f6b232485a0dc0cc8b915561b9be37d32722 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Wed, 30 Aug 2017 17:57:38 -0700 Subject: crypto: Updated to include user parameter --- crypto/key.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crypto/key.go') diff --git a/crypto/key.go b/crypto/key.go index ec37330..9bf9098 100644 --- a/crypto/key.go +++ b/crypto/key.go @@ -33,6 +33,7 @@ import ( "io" "log" "os" + "os/user" "runtime" "unsafe" @@ -247,7 +248,7 @@ func NewFixedLengthKeyFromReader(reader io.Reader, length int) (*Key, error) { // InsertPolicyKey puts the provided policy key into the kernel keyring with the // provided description, and type logon. The key must be a policy key. -func InsertPolicyKey(key *Key, description string) error { +func InsertPolicyKey(key *Key, description string, target *user.User) error { if err := util.CheckValidLength(metadata.PolicyKeyLen, key.Len()); err != nil { return errors.Wrap(err, "policy key") } @@ -266,7 +267,7 @@ func InsertPolicyKey(key *Key, description string) error { fscryptKey.Size = metadata.PolicyKeyLen copy(fscryptKey.Raw[:], key.data) - return security.InsertKey(payload.data, description) + return security.InsertKey(payload.data, description, target) } var ( -- cgit v1.2.3