diff options
| author | Joe Richey <joerichey@google.com> | 2017-08-30 17:57:38 -0700 |
|---|---|---|
| committer | Joe Richey <joerichey@google.com> | 2017-08-30 17:57:38 -0700 |
| commit | d685f6b232485a0dc0cc8b915561b9be37d32722 (patch) | |
| tree | 2b10098a5d26c4aa9cae6a074bdf62dea75ce198 /crypto/key.go | |
| parent | 70efc397db81f3ad170e54114f3ad0a97f2ed7d0 (diff) | |
crypto: Updated to include user parameter
Diffstat (limited to 'crypto/key.go')
| -rw-r--r-- | crypto/key.go | 5 |
1 files changed, 3 insertions, 2 deletions
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 ( |