diff options
| author | Joe Richey joerichey@google.com <joerichey@google.com> | 2017-06-08 10:54:14 -0700 |
|---|---|---|
| committer | Joe Richey joerichey@google.com <joerichey@google.com> | 2017-06-15 22:32:35 -0700 |
| commit | d71b7f248e21f5254c32ecbf752a1dbe940a1177 (patch) | |
| tree | fd28a8f577ead500736cde46d8eb0647ae31415d /crypto | |
| parent | ea3e258610340de0dd585c221f4e18a199f16bca (diff) | |
vendor: update x/sys/unix
This commit updates the vendored x/sys/unix to the current version. This
means that our vendored version of x/sys/unix no longer contains custom
patches. A few changes are needed in InsertPolicyKey() as the final API
differed slightly from our patches.
Change-Id: Ifff31c04e708f9dc4395ab5bfcc94e42fb46dea5
Diffstat (limited to 'crypto')
| -rw-r--r-- | crypto/key.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/key.go b/crypto/key.go index eefe08a..bd69b2d 100644 --- a/crypto/key.go +++ b/crypto/key.go @@ -28,6 +28,7 @@ import ( "log" "os" "runtime" + "unsafe" "golang.org/x/sys/unix" @@ -238,7 +239,7 @@ func addPayloadToSessionKeyring(payload []byte, description string) error { // collected when the process terminates. Instead, we first get the ID // of the KEY_SPEC_SESSION_KEYRING, which will return the user session // keyring if a session keyring does not exist. - keyringID, err := unix.KeyctlGetKeyringID(unix.KEY_SPEC_SESSION_KEYRING, 0) + keyringID, err := unix.KeyctlGetKeyringID(unix.KEY_SPEC_SESSION_KEYRING, false) log.Printf("unix.KeyctlGetKeyringID(KEY_SPEC_SESSION_KEYRING) = %d, %v", keyringID, err) if err != nil { return ErrKeyringLocate @@ -276,7 +277,7 @@ func RemovePolicyKey(descriptor, service string) error { return err } - err = unix.KeyctlUnlink(keyID, unix.KEY_SPEC_SESSION_KEYRING) + _, err = unix.KeyctlInt(unix.KEYCTL_UNLINK, keyID, unix.KEY_SPEC_SESSION_KEYRING, 0, 0) log.Printf("unix.KeyctlUnlink(%d, KEY_SPEC_SESSION_KEYRING) = %v", keyID, err) if err != nil { return ErrKeyringDelete @@ -297,7 +298,7 @@ func InsertPolicyKey(key *Key, descriptor, service string) error { } // Create our payload (containing an FscryptKey) - payload, err := newBlankKey(unix.SizeofFscryptKey) + payload, err := newBlankKey(int(unsafe.Sizeof(unix.FscryptKey{}))) if err != nil { return err } |