]> git.apps.os.sepia.ceph.com Git - fscrypt.git/log
fscrypt.git
5 years agofilesystem: get correct device for kernel-mounted rootfs
Eric Biggers [Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)]
filesystem: get correct device for kernel-mounted rootfs

A root filesystem mounted via the kernel command line always has a
source of "/dev/root", which isn't a real device node.  This makes
fscrypt think this filesystem doesn't have a source device, which breaks
creating login passphrase-protected directories on other filesystems:

    fscrypt encrypt: filesystem /: no device for mount "/": system error: cannot create filesystem link

This also makes 'fscrypt status' show a blank source device:

    MOUNTPOINT  DEVICE          FILESYSTEM  ENCRYPTION     FSCRYPT
    /                           ext4        supported      Yes

To fix this case, update loadMountInfo() to map the device number to the
device name via sysfs rather than use the mount source field.

5 years agofilesystem: add device number utilities
Eric Biggers [Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)]
filesystem: add device number utilities

Add a utility type and functions for handling device numbers.

5 years agofilesystem: skip unnecessary mountpoint canonicalization
Eric Biggers [Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)]
filesystem: skip unnecessary mountpoint canonicalization

The kernel always shows mountpoints as absolute paths without symlinks,
so there's no need to canonicalize them in userspace.

5 years agofilesystem: switch to using /proc/self/mountinfo
Eric Biggers [Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)]
filesystem: switch to using /proc/self/mountinfo

Change loadMountInfo() to load the mounts directly from
/proc/self/mountinfo, rather than use the mntent.h C library calls.

This is needed for correct handling of bind mounts and of "/dev/root",
since /proc/self/mountinfo has extra fields which show the mounted
subtree and the filesystem's device number.  /proc/mounts lacks these
fields, and the C library calls can't provide them.

To start, this patch just switches to using /proc/self/mountinfo,
without doing anything with the extra fields yet.

As a bonus, this eliminates all C code in mountpoint.go.

5 years agofilesystem: rename getMountInfo() to loadMountInfo()
Eric Biggers [Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)]
filesystem: rename getMountInfo() to loadMountInfo()

Make it clearer that this function loads data into global data
structures, and doesn't return anything.

5 years agofilesystem: remove Mount.Options
Eric Biggers [Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)]
filesystem: remove Mount.Options

fscrypt doesn't currently do anything with the mount options, so remove
them from the Mount structure for now.

5 years agofilesystem: rename Mount.Filesystem to Mount.FilesystemType
Eric Biggers [Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)]
filesystem: rename Mount.Filesystem to Mount.FilesystemType

Make it clear that this refers to a type of filesystem such as "ext4",
rather than to a specific filesystem instance.

5 years agoManage tool versioning with Go modules (#161)
Joseph Richey [Sat, 26 Oct 2019 00:26:49 +0000 (17:26 -0700)]
Manage tool versioning with Go modules (#161)

See: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module

The tool code is never actually built, but the versions are still lock
in `go.mod` and `go.sum`. We can also simplify the Makefile.

5 years agoDelete vendored code and update CI to Go 1.13 (#158)
Joseph Richey [Sat, 26 Oct 2019 00:15:27 +0000 (17:15 -0700)]
Delete vendored code and update CI to Go 1.13 (#158)

As the Go community transitions to using the modules ecosystem,
we want to only support one way of managing dependencies.
So this change moves to only using Go modules for dependency management.

This means that our effective minimum Go version increases to Go 1.11.
To account for this, we also update:
  - the documentation
  - Makefile
  - CI scripts

5 years agoAdded capacity to slice creation, when capacity is known (#159)
Vivek V [Fri, 25 Oct 2019 08:17:33 +0000 (13:47 +0530)]
Added capacity to slice creation, when capacity is known (#159)

Simple optimization to reduce memory allocations and copying when appending.

5 years agoactions/config: ensure config file is created with mode 0644 (#152)
ebiggers [Thu, 24 Oct 2019 05:18:45 +0000 (22:18 -0700)]
actions/config: ensure config file is created with mode 0644 (#152)

If the user has set a restrictive umask, e.g. 0077, then
/etc/fscrypt.conf would be created without the world-readable bit set.
Fix it by overriding the umask when creating the file.

Resolves https://github.com/google/fscrypt/issues/151

5 years agoMerge pull request #150 from ebiggers/allow-metadata-symlink
Joseph Richey [Thu, 24 Oct 2019 05:11:25 +0000 (22:11 -0700)]
Merge pull request #150 from ebiggers/allow-metadata-symlink

filesystem: allow .fscrypt to be a symlink

5 years agofilesystem: Move test-only code to test files
Joe Richey [Thu, 24 Oct 2019 05:06:13 +0000 (22:06 -0700)]
filesystem: Move test-only code to test files

This makes it easier to understand which code is actually invoked by the
command-line tool.

5 years agofilesystem: allow .fscrypt to be a symlink
Eric Biggers [Tue, 1 Oct 2019 16:43:36 +0000 (09:43 -0700)]
filesystem: allow .fscrypt to be a symlink

Support the case where the user has a read-only root filesystem (e.g.
with OSTree) and had previously created a symlink /.fscrypt pointing to
a writable location, so that login protectors can be created there.

Resolves https://github.com/google/fscrypt/issues/131

6 years agocmd/fscrypt: make 'fscrypt setup' create /.fscrypt (#149)
ebiggers [Tue, 24 Sep 2019 11:04:02 +0000 (04:04 -0700)]
cmd/fscrypt: make 'fscrypt setup' create /.fscrypt (#149)

Make the global setup command also create the metadata directory at
/.fscrypt, since that's where login protectors are placed, even when the
actual encrypted directories are on a different filesystem.

Resolves https://github.com/google/fscrypt/issues/129

6 years agoPrepare v0.2.5 (#147)
Joseph Richey [Thu, 12 Sep 2019 00:00:09 +0000 (17:00 -0700)]
Prepare v0.2.5 (#147)

Also add go version attrubute to go.mod

6 years agocmd/fscrypt: show encryption options with 'fscrypt status DIR' (#145)
ebiggers [Mon, 9 Sep 2019 21:10:11 +0000 (14:10 -0700)]
cmd/fscrypt: show encryption options with 'fscrypt status DIR' (#145)

Show the encryption options when running 'fscrypt status' on a
directory.  E.g.:

Policy:   490515286453d3f7
Options:  padding:32 contents:Adiantum filenames:Adiantum
Unlocked: Yes

6 years agowriteDataAtomic() fixes (#140)
ebiggers [Mon, 9 Sep 2019 20:41:32 +0000 (13:41 -0700)]
writeDataAtomic() fixes (#140)

* filesystem: ensure data is persisted before returning success

Sync the temporary file before renaming it, to ensure that after a
crash, the destination file isn't zero-length or otherwise incomplete.

Also sync the directory after the rename, to ensure the rename has been
persisted before returning success.

* filesystem: don't use fixed temporary file name

Using a fixed temporary file name in a world-writable sticky directory
is problematic since another user can create the file first.

Use ioutil.TempFile() to do it properly.  It uses O_EXCL under the hood
to ensure the file is newly created.

6 years agoFix various typos and grammatical errors (#141)
ebiggers [Mon, 9 Sep 2019 02:46:59 +0000 (19:46 -0700)]
Fix various typos and grammatical errors (#141)

These were found by a combination of manual review and a custom script
that checks for common errors.

Also removed an outdated sentence from the comment for setupBefore().

6 years ago.gitignore: add tags file (#144)
ebiggers [Mon, 9 Sep 2019 02:44:31 +0000 (19:44 -0700)]
.gitignore: add tags file (#144)

Add the tags file to .gitignore, for developers using
https://github.com/jstemmer/gotags.

6 years agoMerge pull request #142 from ebiggers/goimports
Joseph Richey [Thu, 29 Aug 2019 15:59:18 +0000 (08:59 -0700)]
Merge pull request #142 from ebiggers/goimports

Fix 'make format'-related CI failure

6 years agoRun 'make format' with latest version of goimports
Eric Biggers [Thu, 29 Aug 2019 04:22:36 +0000 (23:22 -0500)]
Run 'make format' with latest version of goimports

This fixes a CI failure, caused by goimports changing how it formats the
imports.

6 years agoMakefile: exclude generated files from 'make format'
Eric Biggers [Thu, 29 Aug 2019 04:22:36 +0000 (23:22 -0500)]
Makefile: exclude generated files from 'make format'

Due to a goimports update, 'make format' is now changing metadata.pb.go.
But this fix can't be committed because this file is generated by
'make gen'.

Fix this by not formatting generated files.

6 years agoREADME.md: improve documentation for moving files into encrypted dirs (#138)
ebiggers [Sun, 28 Jul 2019 02:24:19 +0000 (19:24 -0700)]
README.md: improve documentation for moving files into encrypted dirs (#138)

Resolves https://github.com/google/fscrypt/issues/124

6 years agoREADME.md: improve documentation for kernel and filesystem support (#137)
ebiggers [Sat, 27 Jul 2019 22:53:21 +0000 (15:53 -0700)]
README.md: improve documentation for kernel and filesystem support (#137)

Resolves https://github.com/google/fscrypt/issues/117
Resolves https://github.com/google/fscrypt/issues/127

6 years agoREADME.md: improve documentation of GRUB limitation (#136)
ebiggers [Sat, 27 Jul 2019 22:51:42 +0000 (15:51 -0700)]
README.md: improve documentation of GRUB limitation (#136)

Resolves https://github.com/google/fscrypt/issues/58

6 years agocmd/fscrypt: give newly encrypted directories mode 0700 (#134)
ebiggers [Sat, 27 Jul 2019 22:50:47 +0000 (15:50 -0700)]
cmd/fscrypt: give newly encrypted directories mode 0700 (#134)

Resolves https://github.com/google/fscrypt/issues/132

6 years agoUpdate Travis to use Ubuntu 18.04 and Go 1.12 (#135)
Joseph Richey [Sat, 27 Jul 2019 01:08:34 +0000 (18:08 -0700)]
Update Travis to use Ubuntu 18.04 and Go 1.12 (#135)

Fixes CI issues

6 years agoMerge pull request #122 from google/pam
Joseph Richey [Sun, 20 Jan 2019 06:06:54 +0000 (22:06 -0800)]
Merge pull request #122 from google/pam

Install pam modules/configs to the right location

6 years agoUpdate the README with correct install information
Joe Richey [Sun, 20 Jan 2019 06:04:12 +0000 (22:04 -0800)]
Update the README with correct install information

6 years agoInstall pam modules/configs to the right location
Joe Richey [Sun, 20 Jan 2019 03:27:30 +0000 (19:27 -0800)]
Install pam modules/configs to the right location

Per the FHS, manually installed programs should go under /usr/local.
This change also makes it easier to change the global installation
prefix. For example, package managers should set PREFIX=/usr

6 years agoMerge pull request #119 from ebiggers/adiantum
Joseph Richey [Fri, 18 Jan 2019 02:51:05 +0000 (18:51 -0800)]
Merge pull request #119 from ebiggers/adiantum

Add support for the Adiantum encryption mode

6 years agoMerge pull request #120 from google/tools
Joseph Richey [Fri, 18 Jan 2019 02:50:14 +0000 (18:50 -0800)]
Merge pull request #120 from google/tools

Makefile: migrate from megacheck to staticcheck

6 years agoMakefile: migrate from megacheck to staticcheck
Joe Richey joerichey@google.com [Fri, 18 Jan 2019 02:15:12 +0000 (18:15 -0800)]
Makefile: migrate from megacheck to staticcheck

This fixes travis issues as well as moving us off of deprecated tooling

6 years agoAdd support for the Adiantum encryption mode
Eric Biggers [Tue, 15 Jan 2019 02:43:25 +0000 (18:43 -0800)]
Add support for the Adiantum encryption mode

Add Adiantum support to the fscrypt userspace tool.  Supported in the
kernel since v5.0-rc1, Adiantum is a length-preserving encryption mode
based primarily on XChaCha12.  It is fast even on CPUs without AES
instructions.  Unlike XTS it is also a wide-block encryption mode.
Adiantum is supported for both contents and filenames encryption.

For Adiantum encryption policies, also make the fscrypt tool provide the
new DIRECT_KEY flag, which further improves performance by requesting
that all files be encrypted directly with the policy key.  This takes
advantage of Adiantum's support for long tweaks.

See the kernel commit "fscrypt: add Adiantum support"
(https://git.kernel.org/torvalds/c/8094c3ceb21ad938) for more details.

6 years agoMerge pull request #114 from ebiggers/fix-make-gen
Joseph Richey [Tue, 4 Dec 2018 23:10:54 +0000 (15:10 -0800)]
Merge pull request #114 from ebiggers/fix-make-gen

Makefile: use a specific protoc-gen-go version

6 years agoMakefile: use a specific protoc-gen-go version
Eric Biggers [Tue, 4 Dec 2018 22:31:20 +0000 (14:31 -0800)]
Makefile: use a specific protoc-gen-go version

'make gen' no longer works because it uses the git version of
protoc-gen-go, which is no longer compatible with the latest released
version of github.com/golang/protobuf/proto, which we're using.  Freeze
the protoc-gen-go version so that it keeps working.

6 years agoMerge pull request #110 from wjt/patch-1
Joseph Richey [Wed, 21 Nov 2018 02:26:01 +0000 (18:26 -0800)]
Merge pull request #110 from wjt/patch-1

README: fix "Debain" typo

6 years agoREADME: fix "Debain" typo
Will Thompson [Mon, 5 Nov 2018 11:54:08 +0000 (11:54 +0000)]
README: fix "Debain" typo

7 years agoMerge pull request #106 from fristonio/spell-check
Joseph Richey [Thu, 6 Sep 2018 05:49:42 +0000 (22:49 -0700)]
Merge pull request #106 from fristonio/spell-check

feat(spell-check): add make command for spell check.

7 years agofeat(spell-check): add make command for spell check.
Deepesh Pathak [Sat, 1 Sep 2018 19:47:27 +0000 (01:17 +0530)]
feat(spell-check): add make command for spell check.

* Remove spelling mistakes in the repository
* Add travis script to check for typos.
* Add command to Makefile to check for typos.
* Fixes #71

7 years agoMerge pull request #107 from google/mod
Joseph Richey [Thu, 30 Aug 2018 20:41:49 +0000 (13:41 -0700)]
Merge pull request #107 from google/mod

Use Go Modules and support Go 1.11 building

7 years agoUpdate Travis to use go 1.10 and go 1.11
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 20:33:52 +0000 (13:33 -0700)]
Update Travis to use go 1.10 and go 1.11

7 years agoBump Travis Version
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 11:14:57 +0000 (04:14 -0700)]
Bump Travis Version

7 years agoFix golint to not need a special fork
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 10:55:16 +0000 (03:55 -0700)]
Fix golint to not need a special fork

7 years agoGo 1.11 gofmt updatae
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 10:54:52 +0000 (03:54 -0700)]
Go 1.11 gofmt updatae

7 years agoUse proto.Equal instead of reflect.DeepEquals
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 10:54:08 +0000 (03:54 -0700)]
Use proto.Equal instead of reflect.DeepEquals

7 years agoUpdate Protoc Compiler to 3.6.1
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 09:32:37 +0000 (02:32 -0700)]
Update Protoc Compiler to 3.6.1

7 years agoUpdate dependancies to lastest version
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 09:24:33 +0000 (02:24 -0700)]
Update dependancies to lastest version

7 years agoDon't vendor helper tooling
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 09:19:59 +0000 (02:19 -0700)]
Don't vendor helper tooling

7 years agoRemove dep from documentation and travis build
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 08:29:36 +0000 (01:29 -0700)]
Remove dep from documentation and travis build

7 years agoTransition from dep to golang's module system
Joe Richey joerichey@google.com [Thu, 30 Aug 2018 08:26:47 +0000 (01:26 -0700)]
Transition from dep to golang's module system

7 years agoMerge pull request #105 from google/release
Joseph Richey [Thu, 23 Aug 2018 18:10:06 +0000 (11:10 -0700)]
Merge pull request #105 from google/release

Release: v0.2.4

7 years agoRelease: v0.2.4
Joe Richey joerichey@google.com [Thu, 23 Aug 2018 18:07:49 +0000 (11:07 -0700)]
Release: v0.2.4

7 years agoMerge pull request #103 from google/pam
Joseph Richey [Thu, 23 Aug 2018 18:05:39 +0000 (11:05 -0700)]
Merge pull request #103 from google/pam

Cleanup privilege dropping/raising in pam_fscrypt

7 years agoImprove debug and error output for pam_fscrypt
Joe Richey joerichey@google.com [Wed, 22 Aug 2018 12:28:21 +0000 (05:28 -0700)]
Improve debug and error output for pam_fscrypt

7 years agoEnsure keyring privilege changes are reversible
Joe Richey joerichey@google.com [Wed, 22 Aug 2018 12:23:00 +0000 (05:23 -0700)]
Ensure keyring privilege changes are reversible

This change makes sure that, when we set the ruid and euid in order to
get the user keyring linked into the current process keyring, we will
always be able to reverse these changes (using a suid of 0).

This fixes an issue where "su <user>" would result in a system error
when called by an unprivileged user. It also explains exactly how and
why we are making these privilege changes.

7 years agoEnsure setting user privileges is reversible
Joe Richey joerichey@google.com [Wed, 22 Aug 2018 12:17:32 +0000 (05:17 -0700)]
Ensure setting user privileges is reversible

This change makes sure after dropping then elevating privileges for a
process, the euid, guid, and groups are all the same as they were
originally. This significantly simplifies the privilege logic.

This fixes CVE-2018-6558, which allowed an unprivleged user to gain
membership in the root group (gid 0) due to the groups not being
properly reset in the process.

7 years agoMerge pull request #104 from google/travis
Joseph Richey [Thu, 23 Aug 2018 17:59:35 +0000 (10:59 -0700)]
Merge pull request #104 from google/travis

Fix Travis to only use Go 1.10

7 years agoUpdate docs to indicate v1.10 is required
Joe Richey joerichey@google.com [Thu, 23 Aug 2018 17:53:58 +0000 (10:53 -0700)]
Update docs to indicate v1.10 is required

7 years agoFix Travis to only use Go 1.10
Joe Richey joerichey@google.com [Thu, 23 Aug 2018 17:50:17 +0000 (10:50 -0700)]
Fix Travis to only use Go 1.10

7 years agoMerge pull request #102 from google/mips
Joseph Richey [Wed, 22 Aug 2018 12:45:42 +0000 (05:45 -0700)]
Merge pull request #102 from google/mips

Use proper sizes when casting to Go slice

7 years agoUse proper sizes when casting to Go slice
Joe Richey joerichey@google.com [Wed, 22 Aug 2018 06:53:34 +0000 (23:53 -0700)]
Use proper sizes when casting to Go slice

Addresses most of the issues in #101.

The following commands now succeed:
    GOARCH=mips go build github.com/google/fscrypt/util
    GOARCH=mipsle go build github.com/google/fscrypt/util

7 years agoMerge pull request #97 from ebiggers/privileges_fix
Joseph Richey [Thu, 19 Apr 2018 18:14:12 +0000 (11:14 -0700)]
Merge pull request #97 from ebiggers/privileges_fix

security: drop and regain privileges in all threads

7 years agoMerge pull request #96 from ebiggers/unset_item_fix
Joseph Richey [Thu, 19 Apr 2018 18:11:33 +0000 (11:11 -0700)]
Merge pull request #96 from ebiggers/unset_item_fix

pam: return error when PAM info item is unset

7 years agosecurity: drop and regain privileges in all threads
Eric Biggers [Sun, 25 Mar 2018 17:13:26 +0000 (10:13 -0700)]
security: drop and regain privileges in all threads

After enabling pam_fscrypt for "session" and creating a directory
protected with a login protector, I was no longer able to log in as that
user.  The problem is that the Go runtime is creating threads after
pam_fscrypt drops privileges, but pam_fscrypt is not re-acquiring
privileges on those threads because the Go wrappers for setreuid(),
setregid(), and setgroups() in the "sys/unix" package are using the raw
syscalls which operate on the calling thread only.

This violates glibc's assumption that all threads have the same uids and
gids, causing it to abort() the process when a later module in the PAM
stack (pam_mail in my case) tries to drop privileges using the glibc
functions.

Fix it by dropping and regaining privileges using the glibc functions
rather than the "sys/unix" functions.

This also avoids any possibility that privileges could be changed in a
thread other than the "main" one for pam_fscrypt, since the Go runtime
does not guarantee which OS-level thread runs what.

It would be nice to also exit all Go worker threads before returning
from pam_fscrypt, but the Go runtime doesn't seem to support that.

7 years agopam: return error when PAM info item is unset
Eric Biggers [Sun, 25 Mar 2018 06:21:29 +0000 (23:21 -0700)]
pam: return error when PAM info item is unset

pam_fscrypt is crashing with a segfault in copyIntoSecret() when using
Ctrl-C to interrupt a 'sudo' prompt.  It is dereferencing a NULL pointer
that is supposed point to the PAM_AUTHTOK item.  The problem is that the
Go code assumes pam_get_item() returns a non-success status if the item
is unset, when actually it sets the data pointer to NULL and returns
PAM_SUCCESS.

Fix it by making pam.Handle.GetItem() return an error in that case.

7 years agoClarify how to run integration tests
Joseph Richey [Fri, 16 Mar 2018 08:55:04 +0000 (01:55 -0700)]
Clarify how to run integration tests

Also clarifies some other minor points.

7 years agoMakefile: arch command is not portable
Joseph Richey [Wed, 14 Feb 2018 19:20:44 +0000 (11:20 -0800)]
Makefile: arch command is not portable

According to:
https://www.gnu.org/software/coreutils/manual/html_node/arch-invocation.html
the arch command isn't portable, so we switch to uname.

7 years agoMakefile: Go/Protoc don't support arm64 big endian
Joseph Richey [Wed, 14 Feb 2018 03:15:13 +0000 (19:15 -0800)]
Makefile: Go/Protoc don't support arm64 big endian

Protoc: https://github.com/google/protobuf/blob/a711e3d5b4ee1dd7f9d21197dca8432a5819a64e/protoc-artifacts/build-protoc.sh#L82-L83
Go: https://github.com/golang/sys/blob/37707fdb30a5b38865cfb95e5aab41707daec7fd/unix/linux/mkall.go#L43-L79

7 years agoMakefile: Fix archetecture detection
Joseph Richey [Tue, 13 Feb 2018 12:48:14 +0000 (04:48 -0800)]
Makefile: Fix archetecture detection

Using "arch" instead of "go env GOARCH" is more standard and doesn't
generate a warning on "sudo make install".

7 years agoMerge pull request #91 from google/version
Joseph Richey [Mon, 12 Feb 2018 10:10:54 +0000 (02:10 -0800)]
Merge pull request #91 from google/version

Release: v0.2.3

7 years agoRelease: v0.2.3
Joseph Richey [Mon, 12 Feb 2018 10:05:41 +0000 (02:05 -0800)]
Release: v0.2.3

7 years agoMerge pull request #90 from google/travis
Joseph Richey [Mon, 12 Feb 2018 09:54:55 +0000 (01:54 -0800)]
Merge pull request #90 from google/travis

travis: Fix travis bug

7 years agotravis: Fix travis bug
Joseph Richey [Mon, 12 Feb 2018 09:54:14 +0000 (01:54 -0800)]
travis: Fix travis bug

7 years agoMerge pull request #89 from google/proto
Joseph Richey [Mon, 12 Feb 2018 09:34:43 +0000 (01:34 -0800)]
Merge pull request #89 from google/proto

Makefile: bump protoc to most recent version

7 years agometadata: regenerate .pb.go
Joseph Richey [Mon, 12 Feb 2018 09:31:18 +0000 (01:31 -0800)]
metadata: regenerate .pb.go

7 years agoMakefile: bump protoc to most recent version
Joseph Richey [Mon, 12 Feb 2018 09:26:58 +0000 (01:26 -0800)]
Makefile: bump protoc to most recent version

7 years agoMerge pull request #88 from google/key
Joseph Richey [Mon, 12 Feb 2018 08:54:05 +0000 (00:54 -0800)]
Merge pull request #88 from google/key

travis: Upload encrypted API key

7 years agotravis: Upload encrypted API key
Joseph Richey [Mon, 12 Feb 2018 08:47:20 +0000 (00:47 -0800)]
travis: Upload encrypted API key

7 years agoMerge pull request #87 from google/cleanup
Joseph Richey [Mon, 12 Feb 2018 08:06:37 +0000 (00:06 -0800)]
Merge pull request #87 from google/cleanup

Minor fixes and cleanup

7 years agovet: eliminate unnecessary shadowing
Joseph Richey [Mon, 12 Feb 2018 07:56:49 +0000 (23:56 -0800)]
vet: eliminate unnecessary shadowing

Running "go vet -shadow ./..." finds all places where a variable might
be incorrectly or unnecessarily shadowed. This fixes some of them.

7 years agocmd/fscrypt: don't show build time if not set
Joseph Richey [Mon, 12 Feb 2018 07:38:19 +0000 (23:38 -0800)]
cmd/fscrypt: don't show build time if not set

7 years agoMerge pull request #86 from google/docs
Joseph Richey [Mon, 12 Feb 2018 07:30:33 +0000 (23:30 -0800)]
Merge pull request #86 from google/docs

docs: Update CONTRIBUTING.md and README.md

7 years agodocs: Update CONTRIBUTING.md and README.md
Joseph Richey [Mon, 12 Feb 2018 07:11:11 +0000 (23:11 -0800)]
docs: Update CONTRIBUTING.md and README.md

PR #85 failed to update the documentation. This is now fixed with some
additional cleanup.

7 years agoMerge pull request #85 from google/depfix
Joseph Richey [Mon, 12 Feb 2018 05:43:56 +0000 (21:43 -0800)]
Merge pull request #85 from google/depfix

Complete the new Build System

7 years agotravis: use multiple build stages
Joseph Richey [Mon, 12 Feb 2018 05:22:53 +0000 (21:22 -0800)]
travis: use multiple build stages

This change rewrites .travis.yml to use many build stages/jobs. This
allows our build to run faster, as almost all jobs run in containers.

Stage 1: Run on all pushes to all branches
  - Job Build: just runs "make" to make sure everything is OK

Stage 2: Run on all PRs and pushes to master
  - Job Lint: Makes sure dep, "make gen", "make format", and "make lint"
              are all happy.
  - Job Build 1: Make sure "go get" and "make" will work. This job will
                 later run unit tests.
  - Job Build 2: Same as Job Build 1, except with another go version.
  - Job Integeration: Run integration tests (needs sudo, so needs VM)

Stage 3: Run on releases (if other stages pass)
  - Job Deploy: Publishes amd64 binaries to GitHub.

7 years agoMakefile: completly rewrite
Joseph Richey [Mon, 12 Feb 2018 05:06:32 +0000 (21:06 -0800)]
Makefile: completly rewrite

This change is a complete rewrite of fscrypt's Makefile.

The new build rules can be roughly divided into secions:
  Build   - bin/fscrypt and bin/pam_fscrypt
  Linting - gen (for .proto files), format, lint
  Test    - test, test-{setup|teardown}, coverage.out
  Install - install, uninstall, install-{bin|pam}
  Tools   - tools and other bin/* needed for the other rules

As before, "make" builds the binary and pam_module, while "make all"
builds and tests everything (except for integration tests), and "make
clean" removes any generated files.

Also note that this new build system:
  - Doesn't require input_fail.py
  - Properly falis on linter errors
  - Builds everything into the bin/ directory (customizable)
  - Builds all the vendored tools

7 years agogolint: Use fork that respects vendor directory
Joseph Richey [Mon, 12 Feb 2018 04:39:12 +0000 (20:39 -0800)]
golint: Use fork that respects vendor directory

Ideally, we would just use "golint ./..." to check all our our source
files for lint error. However, this does not work because it will
include all packages in the vendor directory. The pull request at:
https://github.com/golang/lint/pull/325
fixes this issue, so we will use it until the PR has been merged.

7 years agovendor: include source for tools
Joseph Richey [Mon, 12 Feb 2018 04:34:07 +0000 (20:34 -0800)]
vendor: include source for tools

This change vendors the source for all our build, formatting, and
linting tools. Generated by running "dep ensure".

7 years agodep: require tools to be vendored
Joseph Richey [Mon, 12 Feb 2018 04:31:27 +0000 (20:31 -0800)]
dep: require tools to be vendored

This change ot Gopkg.toml will make it easier to build the linting and
formatting tools. Vendoring their source also makes sure that updates to
these tools do not break the build.

7 years agovendor: update vendored dependancies
Joseph Richey [Mon, 12 Feb 2018 04:28:41 +0000 (20:28 -0800)]
vendor: update vendored dependancies

This change updates dependancies to be consistent with Gopkg.toml.
This change was generated by running "dep ensure".

7 years agodep: add dependancies to Gopkg.toml
Joseph Richey [Mon, 12 Feb 2018 04:24:21 +0000 (20:24 -0800)]
dep: add dependancies to Gopkg.toml

fscrypt directly depends on 5 repositories (8 packages). This change
adds those dependancies to Gopkg.toml, so that they can be properly
versioned. Note that the golang.org/x repositories do not use semver.

7 years agotest: all packages should have tests
Joseph Richey [Mon, 12 Feb 2018 04:19:36 +0000 (20:19 -0800)]
test: all packages should have tests

The tests added in this change are trivial, but they make sure that
every package has a non-zero number of tests. This is important for
eventually increasing test coverage.

7 years agolint: Remove all build tags
Joseph Richey [Mon, 12 Feb 2018 04:13:01 +0000 (20:13 -0800)]
lint: Remove all build tags

Our current build tags set off the linter. We will later add in more
comprehensive build tags that will be properly formatted.

7 years agoMerge pull request #84 from google/argon2
Joseph Richey [Fri, 9 Feb 2018 12:01:32 +0000 (04:01 -0800)]
Merge pull request #84 from google/argon2

Move to x/crypto/argon2

7 years agodep: Run dep ensure
Joseph Richey [Fri, 9 Feb 2018 11:17:23 +0000 (03:17 -0800)]
dep: Run dep ensure

7 years agodocs/travis: Remove mention of Argon2
Joseph Richey [Fri, 9 Feb 2018 09:51:44 +0000 (01:51 -0800)]
docs/travis: Remove mention of Argon2

Now that Argon2 is simply and implementation detail of the `crypto`
package, and no a build dependancy, we don't need it in Travis or in the
documenation for building fscrypt.

7 years agocrypto: Move from libargon2 -> x/crypto/argon2
Joseph Richey [Thu, 8 Feb 2018 10:37:42 +0000 (02:37 -0800)]
crypto: Move from libargon2 -> x/crypto/argon2

Use the golang library for the hashing function instead of the reference
C implementation. This removes the dependancy on libargon2. As we are no
longer doing our own error checking, we also eliminate those tests.

7 years agoMerge pull request #83 from google/dep
Joseph Richey [Thu, 8 Feb 2018 10:01:29 +0000 (02:01 -0800)]
Merge pull request #83 from google/dep

Start using Dep