diff options
| -rw-r--r-- | .github/workflows/ci.yml | 8 | ||||
| -rw-r--r-- | CONTRIBUTING.md | 2 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | actions/config.go | 5 | ||||
| -rw-r--r-- | actions/policy.go | 2 | ||||
| -rw-r--r-- | actions/recovery.go | 6 | ||||
| -rw-r--r-- | cli-tests/t_encrypt.out | 4 | ||||
| -rw-r--r-- | cli-tests/t_encrypt_custom.out | 4 | ||||
| -rw-r--r-- | cli-tests/t_encrypt_login.out | 10 | ||||
| -rw-r--r-- | cli-tests/t_encrypt_raw_key.out | 6 | ||||
| -rw-r--r-- | cli-tests/t_lock.out | 8 | ||||
| -rw-r--r-- | cli-tests/t_not_enabled.out | 2 | ||||
| -rw-r--r-- | cli-tests/t_setup.out | 4 | ||||
| -rw-r--r-- | cli-tests/t_unlock.out | 12 | ||||
| -rw-r--r-- | cli-tests/t_v1_policy.out | 14 | ||||
| -rw-r--r-- | cli-tests/t_v1_policy_fs_keyring.out | 6 | ||||
| -rw-r--r-- | cmd/fscrypt/errors.go | 4 | ||||
| -rw-r--r-- | cmd/fscrypt/flags.go | 8 | ||||
| -rw-r--r-- | filesystem/filesystem.go | 2 | ||||
| -rw-r--r-- | filesystem/filesystem_test.go | 2 | ||||
| -rw-r--r-- | go.mod | 18 | ||||
| -rw-r--r-- | go.sum | 91 | ||||
| -rw-r--r-- | metadata/checks.go | 2 | ||||
| -rw-r--r-- | metadata/config.go | 35 | ||||
| -rw-r--r-- | metadata/config_test.go | 2 | ||||
| -rw-r--r-- | metadata/metadata.pb.go | 1068 | ||||
| -rw-r--r-- | metadata/metadata.proto | 2 | ||||
| -rw-r--r-- | metadata/policy_test.go | 2 | ||||
| -rw-r--r-- | tools.go | 4 |
29 files changed, 860 insertions, 477 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a10d117..ae33ce2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 + with: + go-version: '1.18' - name: Install dependencies run: | sudo dpkg --add-architecture i386 @@ -62,6 +64,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 + with: + go-version: '1.18' - name: Install dependencies run: | sudo apt-get update @@ -109,6 +113,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 + with: + go-version: '1.18' - name: Install dependencies run: | sudo apt-get update @@ -122,6 +128,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 + with: + go-version: '1.18' - name: Install dependencies run: | sudo apt-get update diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5772c1..df57d8b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -150,7 +150,7 @@ your code. - Downloads [`protoc`](https://github.com/google/protobuf) to compile the `.proto` files. - Turns each `.proto` file into a matching `.pb.go` file using - [`protoc-gen-go`](https://github.com/golang/protobuf/tree/master/protoc-gen-go). + [`protoc-gen-go`](https://go.googlesource.com/protobuf/+/refs/heads/master/cmd/protoc-gen-go). `make format` runs: - [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports) @@ -98,7 +98,7 @@ $(PAM_MODULE): $(GO_FILES) $(C_FILES) rm -f $(BIN)/$(PAM_NAME).h gen: $(BIN)/protoc $(BIN)/protoc-gen-go $(PROTO_FILES) - protoc --go_out=. $(PROTO_FILES) + protoc --go_out=. --go_opt=paths=source_relative $(PROTO_FILES) format: $(BIN)/goimports goimports -w $(GO_NONGEN_FILES) @@ -203,7 +203,7 @@ tools: $(TOOLS) $(BIN)/golint: go build -o $@ golang.org/x/lint/golint $(BIN)/protoc-gen-go: - go build -o $@ github.com/golang/protobuf/protoc-gen-go + go build -o $@ google.golang.org/protobuf/cmd/protoc-gen-go $(BIN)/goimports: go build -o $@ golang.org/x/tools/cmd/goimports $(BIN)/staticcheck: diff --git a/actions/config.go b/actions/config.go index a8eb029..03d6b04 100644 --- a/actions/config.go +++ b/actions/config.go @@ -29,6 +29,7 @@ import ( "time" "golang.org/x/sys/unix" + "google.golang.org/protobuf/proto" "github.com/google/fscrypt/crypto" "github.com/google/fscrypt/filesystem" @@ -210,7 +211,7 @@ func getHashingCosts(target time.Duration) (*metadata.HashingCosts, error) { memoryKiBLimit := memoryBytesLimit() / 1024 for { // Store a copy of the previous costs - costsPrev := *costs + costsPrev := proto.Clone(costs).(*metadata.HashingCosts) tPrev := t // Double the memory up to the max, then double the time. @@ -223,7 +224,7 @@ func getHashingCosts(target time.Duration) (*metadata.HashingCosts, error) { // If our hashing failed, return the last good set of costs. if t, err = timeHashingCosts(costs); err != nil { log.Printf("Hashing with costs={%v} failed: %v\n", costs, err) - return &costsPrev, nil + return costsPrev, nil } log.Printf("Costs={%v}\t-> %v\n", costs, t) diff --git a/actions/policy.go b/actions/policy.go index 3b20176..c621725 100644 --- a/actions/policy.go +++ b/actions/policy.go @@ -25,8 +25,8 @@ import ( "os" "os/user" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/google/fscrypt/crypto" "github.com/google/fscrypt/filesystem" diff --git a/actions/recovery.go b/actions/recovery.go index 8a769cc..2bb8a23 100644 --- a/actions/recovery.go +++ b/actions/recovery.go @@ -23,6 +23,8 @@ import ( "os" "strconv" + "google.golang.org/protobuf/proto" + "github.com/google/fscrypt/crypto" "github.com/google/fscrypt/metadata" "github.com/google/fscrypt/util" @@ -31,10 +33,10 @@ import ( // modifiedContextWithSource returns a copy of ctx with the protector source // replaced by source. func modifiedContextWithSource(ctx *Context, source metadata.SourceType) *Context { - modifiedConfig := *ctx.Config + modifiedConfig := proto.Clone(ctx.Config).(*metadata.Config) modifiedConfig.Source = source modifiedCtx := *ctx - modifiedCtx.Config = &modifiedConfig + modifiedCtx.Config = modifiedConfig return &modifiedCtx } diff --git a/cli-tests/t_encrypt.out b/cli-tests/t_encrypt.out index ecdc46b..4de05e4 100644 --- a/cli-tests/t_encrypt.out +++ b/cli-tests/t_encrypt.out @@ -65,7 +65,7 @@ desc2 Yes desc1 "MNT/dir" is encrypted with fscrypt. Policy: desc2 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -82,7 +82,7 @@ desc2 Yes desc1 "MNT/dir" is encrypted with fscrypt. Policy: desc2 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: diff --git a/cli-tests/t_encrypt_custom.out b/cli-tests/t_encrypt_custom.out index ac53d6f..2f1c03c 100644 --- a/cli-tests/t_encrypt_custom.out +++ b/cli-tests/t_encrypt_custom.out @@ -11,7 +11,7 @@ desc2 Yes desc1 "MNT/dir" is encrypted with fscrypt. Policy: desc2 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -40,7 +40,7 @@ desc7 Yes desc6 "MNT/dir" is encrypted with fscrypt. Policy: desc7 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: diff --git a/cli-tests/t_encrypt_login.out b/cli-tests/t_encrypt_login.out index bb91a46..b1f6c82 100644 --- a/cli-tests/t_encrypt_login.out +++ b/cli-tests/t_encrypt_login.out @@ -24,7 +24,7 @@ desc1 No login protector for fscrypt-test-user "MNT/dir" is encrypted with fscrypt. Policy: desc3 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 2 protectors: @@ -76,7 +76,7 @@ desc10 No login protector for fscrypt-test-user "MNT/dir" is encrypted with fscrypt. Policy: desc12 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 2 protectors: @@ -109,7 +109,7 @@ desc19 No login protector for fscrypt-test-user "MNT/dir" is encrypted with fscrypt. Policy: desc21 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 2 protectors: @@ -138,7 +138,7 @@ desc28 No login protector for fscrypt-test-user "MNT/dir" is encrypted with fscrypt. Policy: desc29 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -149,7 +149,7 @@ desc28 Yes (MNT_ROOT) login protector for fscrypt-test-user "MNT_ROOT/dir" is encrypted with fscrypt. Policy: desc34 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: diff --git a/cli-tests/t_encrypt_raw_key.out b/cli-tests/t_encrypt_raw_key.out index 4cfc050..78aa0b7 100644 --- a/cli-tests/t_encrypt_raw_key.out +++ b/cli-tests/t_encrypt_raw_key.out @@ -11,7 +11,7 @@ desc2 Yes desc1 "MNT/dir" is encrypted with fscrypt. Policy: desc2 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -30,7 +30,7 @@ desc7 Yes desc6 "MNT/dir" is encrypted with fscrypt. Policy: desc7 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -66,7 +66,7 @@ desc12 Yes desc11 "MNT/dir" is encrypted with fscrypt. Policy: desc12 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: diff --git a/cli-tests/t_lock.out b/cli-tests/t_lock.out index 0da8964..d630e74 100644 --- a/cli-tests/t_lock.out +++ b/cli-tests/t_lock.out @@ -3,7 +3,7 @@ "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -24,7 +24,7 @@ Enter custom passphrase for protector "prot": "MNT/dir" is now unlocked and read "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -48,7 +48,7 @@ Then re-run: "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Partially (incompletely locked) Protected with 1 protector: @@ -66,7 +66,7 @@ bash: MNT/dir/file2: Required key not available "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: No Protected with 1 protector: diff --git a/cli-tests/t_not_enabled.out b/cli-tests/t_not_enabled.out index 4553891..07c9aa3 100644 --- a/cli-tests/t_not_enabled.out +++ b/cli-tests/t_not_enabled.out @@ -55,7 +55,7 @@ for more details. "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: diff --git a/cli-tests/t_setup.out b/cli-tests/t_setup.out index 6ea03e3..ab0052c 100644 --- a/cli-tests/t_setup.out +++ b/cli-tests/t_setup.out @@ -45,7 +45,7 @@ https://github.com/google/fscrypt#setting-up-fscrypt-on-a-filesystem) [y/N] Meta Run "sudo fscrypt setup" to create this file. # bad config file -[ERROR] fscrypt setup: "FSCRYPT_CONF" is invalid: invalid - character 'b' looking for beginning of value +[ERROR] fscrypt setup: "FSCRYPT_CONF" is invalid: proto: + syntax error (line 1:1): invalid value bad Either fix this file manually, or run "sudo fscrypt setup" to recreate it. diff --git a/cli-tests/t_unlock.out b/cli-tests/t_unlock.out index 25430a0..b3c9b2a 100644 --- a/cli-tests/t_unlock.out +++ b/cli-tests/t_unlock.out @@ -5,7 +5,7 @@ "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: No Protected with 1 protector: @@ -23,7 +23,7 @@ Enter custom passphrase for protector "prot": "MNT/dir" is now unlocked and read "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -39,7 +39,7 @@ desc1 Yes desc2 "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: No Protected with 1 protector: @@ -55,7 +55,7 @@ desc1 No desc2 "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: No Protected with 1 protector: @@ -69,7 +69,7 @@ Enter custom passphrase for protector "prot": "MNT/dir" is now unlocked and read "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 Unlocked: Yes Protected with 1 protector: @@ -83,7 +83,7 @@ desc1 Yes desc2 # Try to unlock with corrupt policy metadata [ERROR] fscrypt unlock: fscrypt metadata file at "MNT/.fscrypt/policies/desc1" - is corrupt: unexpected EOF + is corrupt: proto: cannot parse invalid wire-format data # Try to unlock with missing policy metadata [ERROR] fscrypt unlock: filesystem "MNT" does not contain diff --git a/cli-tests/t_v1_policy.out b/cli-tests/t_v1_policy.out index 2353527..f14f357 100644 --- a/cli-tests/t_v1_policy.out +++ b/cli-tests/t_v1_policy.out @@ -30,7 +30,7 @@ problem in your PAM stack, enable pam_keyinit.so, or run "keyctl link @u @s". "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: Yes Protected with 1 protector: @@ -41,7 +41,7 @@ desc2 No custom protector "prot" "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: Partially (incompletely locked, or unlocked by another user) Protected with 1 protector: @@ -59,7 +59,7 @@ directories in an accessible state). "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: Yes Protected with 1 protector: @@ -77,7 +77,7 @@ use --user=root. "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: Yes Protected with 1 protector: @@ -90,7 +90,7 @@ Encrypted data removed from filesystem cache. "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: No Protected with 1 protector: @@ -114,7 +114,7 @@ Then re-run: "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: Partially (incompletely locked, or unlocked by another user) Protected with 1 protector: @@ -135,7 +135,7 @@ Encrypted data removed from filesystem cache. "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: No Protected with 1 protector: diff --git a/cli-tests/t_v1_policy_fs_keyring.out b/cli-tests/t_v1_policy_fs_keyring.out index cfc8f7c..9f0f0ab 100644 --- a/cli-tests/t_v1_policy_fs_keyring.out +++ b/cli-tests/t_v1_policy_fs_keyring.out @@ -17,7 +17,7 @@ re-create your encrypted directories using v2 encryption policies rather than v1 "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: No Protected with 1 protector: @@ -40,7 +40,7 @@ Enter custom passphrase for protector "prot": "MNT/dir" is now unlocked and read "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: Yes Protected with 1 protector: @@ -63,7 +63,7 @@ cat: MNT/dir/file: No such file or directory "MNT/dir" is encrypted with fscrypt. Policy: desc1 -Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 +Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:1 Unlocked: No Protected with 1 protector: diff --git a/cmd/fscrypt/errors.go b/cmd/fscrypt/errors.go index 2d76792..1e9c39a 100644 --- a/cmd/fscrypt/errors.go +++ b/cmd/fscrypt/errors.go @@ -71,8 +71,8 @@ type ErrDirFilesOpen struct { } func (err *ErrDirFilesOpen) Error() string { - return fmt.Sprintf(`Directory was incompletely locked because some files - are still open. These files remain accessible.`) + return `Directory was incompletely locked because some files are still + open. These files remain accessible.` } // ErrDirUnlockedByOtherUsers indicates that a directory can't be locked because diff --git a/cmd/fscrypt/flags.go b/cmd/fscrypt/flags.go index 1b41839..7285133 100644 --- a/cmd/fscrypt/flags.go +++ b/cmd/fscrypt/flags.go @@ -144,10 +144,10 @@ var ( } forceFlag = &boolFlag{ Name: "force", - Usage: fmt.Sprintf(`Suppresses all confirmation prompts and - warnings, causing any action to automatically proceed. - WARNING: This bypasses confirmations for protective - operations, use with care.`), + Usage: `Suppresses all confirmation prompts and warnings, + causing any action to automatically proceed. WARNING: + This bypasses confirmations for protective operations, + use with care.`, } skipUnlockFlag = &boolFlag{ Name: "skip-unlock", diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index fcff574..7852abb 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -45,9 +45,9 @@ import ( "syscall" "time" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" "golang.org/x/sys/unix" + "google.golang.org/protobuf/proto" "github.com/google/fscrypt/metadata" "github.com/google/fscrypt/util" diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go index 0e15256..79fb133 100644 --- a/filesystem/filesystem_test.go +++ b/filesystem/filesystem_test.go @@ -27,8 +27,8 @@ import ( "syscall" "testing" - "github.com/golang/protobuf/proto" "golang.org/x/sys/unix" + "google.golang.org/protobuf/proto" "github.com/google/fscrypt/crypto" "github.com/google/fscrypt/metadata" @@ -4,14 +4,14 @@ go 1.16 require ( github.com/client9/misspell v0.3.4 - github.com/golang/protobuf v1.2.0 - github.com/pkg/errors v0.8.0 - github.com/urfave/cli v1.20.0 + github.com/pkg/errors v0.9.1 + github.com/urfave/cli v1.22.5 github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad - golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 - golang.org/x/lint v0.0.0-20190930215403-16217165b5de - golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 - golang.org/x/term v0.0.0-20210422114643-f5beecf764ed - golang.org/x/tools v0.0.0-20191025023517-2077df36852e - honnef.co/go/tools v0.0.1-2019.2.3 + golang.org/x/crypto v0.0.0-20220408190544-5352b0902921 + golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 + golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 + golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a + google.golang.org/protobuf v1.28.0 + honnef.co/go/tools v0.3.0 ) @@ -1,45 +1,74 @@ -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= +github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= +github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 h1:iMGN4xG0cnqj3t+zOM8wUB0BiPKHEwSxEZCvzcbZuvk= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220408190544-5352b0902921 h1:iU7T1X1J6yxDr0rda54sWGkHgOp5XJrqm79gcNlC2VM= +golang.org/x/crypto v0.0.0-20220408190544-5352b0902921/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM= +golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20210422114643-f5beecf764ed h1:Ei4bQjjpYUsS4efOUz+5Nz++IVkHk87n2zBA0NxBWc0= -golang.org/x/term v0.0.0-20210422114643-f5beecf764ed/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f h1:8w7RhxzTVgUzw/AH/9mUV5q0vMgy40SQRursCcfmkCw= +golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191025023517-2077df36852e h1:ejUPpxsbZzyShOEURCSvFIT0ltnmBW92Vsc3i8QRcw8= -golang.org/x/tools v0.0.0-20191025023517-2077df36852e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a h1:ofrrl6c6NG5/IOSx/R1cyiQxxjqlur0h/TvbUhkH0II= +golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.3.0 h1:2LdYUZ7CIxnYgskbUZfY7FPggmqnh6shBqfWa8Tn3XU= +honnef.co/go/tools v0.3.0/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= diff --git a/metadata/checks.go b/metadata/checks.go index 84fd208..bddc8a7 100644 --- a/metadata/checks.go +++ b/metadata/checks.go @@ -20,8 +20,8 @@ package metadata import ( - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/google/fscrypt/util" ) diff --git a/metadata/config.go b/metadata/config.go index b3c8726..d9d694f 100644 --- a/metadata/config.go +++ b/metadata/config.go @@ -28,32 +28,41 @@ package metadata import ( "io" + "io/ioutil" - "github.com/golang/protobuf/jsonpb" + "google.golang.org/protobuf/encoding/protojson" ) // WriteConfig outputs the Config data as nicely formatted JSON func WriteConfig(config *Config, out io.Writer) error { - m := jsonpb.Marshaler{ - EmitDefaults: true, - EnumsAsInts: false, - Indent: "\t", - OrigName: true, + m := protojson.MarshalOptions{ + Multiline: true, + Indent: "\t", + UseProtoNames: true, + UseEnumNumbers: false, + EmitUnpopulated: true, } - if err := m.Marshal(out, config); err != nil { + bytes, err := m.Marshal(config) + if err != nil { return err } - - _, err := out.Write([]byte{'\n'}) + if _, err = out.Write(bytes); err != nil { + return err + } + _, err = out.Write([]byte{'\n'}) return err } // ReadConfig writes the JSON data into the config structure func ReadConfig(in io.Reader) (*Config, error) { + bytes, err := ioutil.ReadAll(in) + if err != nil { + return nil, err + } config := new(Config) - // Allow (and ignore) unknown fields for forwards compatibility. - u := jsonpb.Unmarshaler{ - AllowUnknownFields: true, + // Discard unknown fields for forwards compatibility. + u := protojson.UnmarshalOptions{ + DiscardUnknown: true, } - return config, u.Unmarshal(in, config) + return config, u.Unmarshal(bytes, config) } diff --git a/metadata/config_test.go b/metadata/config_test.go index 2874bb8..c68dc2e 100644 --- a/metadata/config_test.go +++ b/metadata/config_test.go @@ -23,7 +23,7 @@ import ( "bytes" "testing" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) var testConfig = &Config{ diff --git a/metadata/metadata.pb.go b/metadata/metadata.pb.go index 6709804..a5c58aa 100644 --- a/metadata/metadata.pb.go +++ b/metadata/metadata.pb.go @@ -1,22 +1,46 @@ +// +// metadata.proto - File which contains all of the metadata structures which we +// write to metadata files. Must be compiled with protoc to use the library. +// Compilation can be invoked with go generate. +// +// Copyright 2017 Google Inc. +// Author: Joe Richey (joerichey@google.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +// If you modify this file, be sure to run "go generate" on this package. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.6.1 // source: metadata/metadata.proto package metadata -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // Specifies the method in which an outside secret is obtained for a Protector type SourceType int32 @@ -28,24 +52,47 @@ const ( SourceType_raw_key SourceType = 3 ) -var SourceType_name = map[int32]string{ - 0: "default", - 1: "pam_passphrase", - 2: "custom_passphrase", - 3: "raw_key", -} -var SourceType_value = map[string]int32{ - "default": 0, - "pam_passphrase": 1, - "custom_passphrase": 2, - "raw_key": 3, +// Enum value maps for SourceType. +var ( + SourceType_name = map[int32]string{ + 0: "default", + 1: "pam_passphrase", + 2: "custom_passphrase", + 3: "raw_key", + } + SourceType_value = map[string]int32{ + "default": 0, + "pam_passphrase": 1, + "custom_passphrase": 2, + "raw_key": 3, + } +) + +func (x SourceType) Enum() *SourceType { + p := new(SourceType) + *p = x + return p } func (x SourceType) String() string { - return proto.EnumName(SourceType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SourceType) Descriptor() protoreflect.EnumDescriptor { + return file_metadata_metadata_proto_enumTypes[0].Descriptor() } + +func (SourceType) Type() protoreflect.EnumType { + return &file_metadata_metadata_proto_enumTypes[0] +} + +func (x SourceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SourceType.Descriptor instead. func (SourceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{0} + return file_metadata_metadata_proto_rawDescGZIP(), []int{0} } // Type of encryption; should match declarations of unix.FSCRYPT_MODE @@ -62,528 +109,811 @@ const ( EncryptionOptions_Adiantum EncryptionOptions_Mode = 9 ) -var EncryptionOptions_Mode_name = map[int32]string{ - 0: "default", - 1: "AES_256_XTS", - 2: "AES_256_GCM", - 3: "AES_256_CBC", - 4: "AES_256_CTS", - 5: "AES_128_CBC", - 6: "AES_128_CTS", - 9: "Adiantum", -} -var EncryptionOptions_Mode_value = map[string]int32{ - "default": 0, - "AES_256_XTS": 1, - "AES_256_GCM": 2, - "AES_256_CBC": 3, - "AES_256_CTS": 4, - "AES_128_CBC": 5, - "AES_128_CTS": 6, - "Adiantum": 9, +// Enum value maps for EncryptionOptions_Mode. +var ( + EncryptionOptions_Mode_name = map[int32]string{ + 0: "default", + 1: "AES_256_XTS", + 2: "AES_256_GCM", + 3: "AES_256_CBC", + 4: "AES_256_CTS", + 5: "AES_128_CBC", + 6: "AES_128_CTS", + 9: "Adiantum", + } + EncryptionOptions_Mode_value = map[string]int32{ + "default": 0, + "AES_256_XTS": 1, + "AES_256_GCM": 2, + "AES_256_CBC": 3, + "AES_256_CTS": 4, + "AES_128_CBC": 5, + "AES_128_CTS": 6, + "Adiantum": 9, + } +) + +func (x EncryptionOptions_Mode) Enum() *EncryptionOptions_Mode { + p := new(EncryptionOptions_Mode) + *p = x + return p } func (x EncryptionOptions_Mode) String() string { - return proto.EnumName(EncryptionOptions_Mode_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (EncryptionOptions_Mode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{3, 0} + +func (EncryptionOptions_Mode) Descriptor() protoreflect.EnumDescriptor { + return file_metadata_metadata_proto_enumTypes[1].Descriptor() } -// Cost parameters to be used in our hashing functions. -type HashingCosts struct { - Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"` - Memory int64 `protobuf:"varint,3,opt,name=memory,proto3" json:"memory,omitempty"` - Parallelism int64 `protobuf:"varint,4,opt,name=parallelism,proto3" json:"parallelism,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (EncryptionOptions_Mode) Type() protoreflect.EnumType { + return &file_metadata_metadata_proto_enumTypes[1] } -func (m *HashingCosts) Reset() { *m = HashingCosts{} } -func (m *HashingCosts) String() string { return proto.CompactTextString(m) } -func (*HashingCosts) ProtoMessage() {} -func (*HashingCosts) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{0} +func (x EncryptionOptions_Mode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *HashingCosts) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HashingCosts.Unmarshal(m, b) + +// Deprecated: Use EncryptionOptions_Mode.Descriptor instead. +func (EncryptionOptions_Mode) EnumDescriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{3, 0} } -func (m *HashingCosts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HashingCosts.Marshal(b, m, deterministic) + +// Cost parameters to be used in our hashing functions. +type HashingCosts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"` + Memory int64 `protobuf:"varint,3,opt,name=memory,proto3" json:"memory,omitempty"` + Parallelism int64 `protobuf:"varint,4,opt,name=parallelism,proto3" json:"parallelism,omitempty"` } -func (dst *HashingCosts) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashingCosts.Merge(dst, src) + +func (x *HashingCosts) Reset() { + *x = HashingCosts{} + if protoimpl.UnsafeEnabled { + mi := &file_metadata_metadata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *HashingCosts) XXX_Size() int { - return xxx_messageInfo_HashingCosts.Size(m) + +func (x *HashingCosts) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *HashingCosts) XXX_DiscardUnknown() { - xxx_messageInfo_HashingCosts.DiscardUnknown(m) + +func (*HashingCosts) ProtoMessage() {} + +func (x *HashingCosts) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadata_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_HashingCosts proto.InternalMessageInfo +// Deprecated: Use HashingCosts.ProtoReflect.Descriptor instead. +func (*HashingCosts) Descriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{0} +} -func (m *HashingCosts) GetTime() int64 { - if m != nil { - return m.Time +func (x *HashingCosts) GetTime() int64 { + if x != nil { + return x.Time } return 0 } -func (m *HashingCosts) GetMemory() int64 { - if m != nil { - return m.Memory +func (x *HashingCosts) GetMemory() int64 { + if x != nil { + return x.Memory } return 0 } -func (m *HashingCosts) GetParallelism() int64 { - if m != nil { - return m.Parallelism +func (x *HashingCosts) GetParallelism() int64 { + if x != nil { + return x.Parallelism } return 0 } // This structure is used for our authenticated wrapping/unwrapping of keys. type WrappedKeyData struct { - IV []byte `protobuf:"bytes,1,opt,name=IV,proto3" json:"IV,omitempty"` - EncryptedKey []byte `protobuf:"bytes,2,opt,name=encrypted_key,json=encryptedKey,proto3" json:"encrypted_key,omitempty"` - Hmac []byte `protobuf:"bytes,3,opt,name=hmac,proto3" json:"hmac,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *WrappedKeyData) Reset() { *m = WrappedKeyData{} } -func (m *WrappedKeyData) String() string { return proto.CompactTextString(m) } -func (*WrappedKeyData) ProtoMessage() {} -func (*WrappedKeyData) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{1} -} -func (m *WrappedKeyData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WrappedKeyData.Unmarshal(m, b) -} -func (m *WrappedKeyData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WrappedKeyData.Marshal(b, m, deterministic) + IV []byte `protobuf:"bytes,1,opt,name=IV,proto3" json:"IV,omitempty"` + EncryptedKey []byte `protobuf:"bytes,2,opt,name=encrypted_key,json=encryptedKey,proto3" json:"encrypted_key,omitempty"` + Hmac []byte `protobuf:"bytes,3,opt,name=hmac,proto3" json:"hmac,omitempty"` } -func (dst *WrappedKeyData) XXX_Merge(src proto.Message) { - xxx_messageInfo_WrappedKeyData.Merge(dst, src) + +func (x *WrappedKeyData) Reset() { + *x = WrappedKeyData{} + if protoimpl.UnsafeEnabled { + mi := &file_metadata_metadata_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *WrappedKeyData) XXX_Size() int { - return xxx_messageInfo_WrappedKeyData.Size(m) + +func (x *WrappedKeyData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WrappedKeyData) XXX_DiscardUnknown() { - xxx_messageInfo_WrappedKeyData.DiscardUnknown(m) + +func (*WrappedKeyData) ProtoMessage() {} + +func (x *WrappedKeyData) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadata_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_WrappedKeyData proto.InternalMessageInfo +// Deprecated: Use WrappedKeyData.ProtoReflect.Descriptor instead. +func (*WrappedKeyData) Descriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{1} +} -func (m *WrappedKeyData) GetIV() []byte { - if m != nil { - return m.IV +func (x *WrappedKeyData) GetIV() []byte { + if x != nil { + return x.IV } return nil } -func (m *WrappedKeyData) GetEncryptedKey() []byte { - if m != nil { - return m.EncryptedKey +func (x *WrappedKeyData) GetEncryptedKey() []byte { + if x != nil { + return x.EncryptedKey } return nil } -func (m *WrappedKeyData) GetHmac() []byte { - if m != nil { - return m.Hmac +func (x *WrappedKeyData) GetHmac() []byte { + if x != nil { + return x.Hmac } return nil } // The associated data for each protector type ProtectorData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + ProtectorDescriptor string `protobuf:"bytes,1,opt,name=protector_descriptor,json=protectorDescriptor,proto3" json:"protector_descriptor,omitempty"` Source SourceType `protobuf:"varint,2,opt,name=source,proto3,enum=metadata.SourceType" json:"source,omitempty"` // These are only used by some of the protector types - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Costs *HashingCosts `protobuf:"bytes,4,opt,name=costs,proto3" json:"costs,omitempty"` - Salt []byte `protobuf:"bytes,5,opt,name=salt,proto3" json:"salt,omitempty"` - Uid int64 `protobuf:"varint,6,opt,name=uid,proto3" json:"uid,omitempty"` - WrappedKey *WrappedKeyData `protobuf:"bytes,7,opt,name=wrapped_key,json=wrappedKey,proto3" json:"wrapped_key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProtectorData) Reset() { *m = ProtectorData{} } -func (m *ProtectorData) String() string { return proto.CompactTextString(m) } -func (*ProtectorData) ProtoMessage() {} -func (*ProtectorData) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{2} -} -func (m *ProtectorData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProtectorData.Unmarshal(m, b) -} -func (m *ProtectorData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProtectorData.Marshal(b, m, deterministic) -} -func (dst *ProtectorData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtectorData.Merge(dst, src) + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Costs *HashingCosts `protobuf:"bytes,4,opt,name=costs,proto3" json:"costs,omitempty"` + Salt []byte `protobuf:"bytes,5,opt,name=salt,proto3" json:"salt,omitempty"` + Uid int64 `protobuf:"varint,6,opt,name=uid,proto3" json:"uid,omitempty"` + WrappedKey *WrappedKeyData `protobuf:"bytes,7,opt,name=wrapped_key,json=wrappedKey,proto3" json:"wrapped_key,omitempty"` +} + +func (x *ProtectorData) Reset() { + *x = ProtectorData{} + if protoimpl.UnsafeEnabled { + mi := &file_metadata_metadata_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ProtectorData) XXX_Size() int { - return xxx_messageInfo_ProtectorData.Size(m) + +func (x *ProtectorData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ProtectorData) XXX_DiscardUnknown() { - xxx_messageInfo_ProtectorData.DiscardUnknown(m) + +func (*ProtectorData) ProtoMessage() {} + +func (x *ProtectorData) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadata_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ProtectorData proto.InternalMessageInfo +// Deprecated: Use ProtectorData.ProtoReflect.Descriptor instead. +func (*ProtectorData) Descriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{2} +} -func (m *ProtectorData) GetProtectorDescriptor() string { - if m != nil { - return m.ProtectorDescriptor +func (x *ProtectorData) GetProtectorDescriptor() string { + if x != nil { + return x.ProtectorDescriptor } return "" } -func (m *ProtectorData) GetSource() SourceType { - if m != nil { - return m.Source +func (x *ProtectorData) GetSource() SourceType { + if x != nil { + return x.Source } return SourceType_default } -func (m *ProtectorData) GetName() string { - if m != nil { - return m.Name +func (x *ProtectorData) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *ProtectorData) GetCosts() *HashingCosts { - if m != nil { - return m.Costs +func (x *ProtectorData) GetCosts() *HashingCosts { + if x != nil { + return x.Costs } return nil } -func (m *ProtectorData) GetSalt() []byte { - if m != nil { - return m.Salt +func (x *ProtectorData) GetSalt() []byte { + if x != nil { + return x.Salt } return nil } -func (m *ProtectorData) GetUid() int64 { - if m != nil { - return m.Uid +func (x *ProtectorData) GetUid() int64 { + if x != nil { + return x.Uid } return 0 } -func (m *ProtectorData) GetWrappedKey() *WrappedKeyData { - if m != nil { - return m.WrappedKey +func (x *ProtectorData) GetWrappedKey() *WrappedKeyData { + if x != nil { + return x.WrappedKey } return nil } // Encryption policy specifics, corresponds to the fscrypt_policy struct type EncryptionOptions struct { - Padding int64 `protobuf:"varint,1,opt,name=padding,proto3" json:"padding,omitempty"` - Contents EncryptionOptions_Mode `protobuf:"varint,2,opt,name=contents,proto3,enum=metadata.EncryptionOptions_Mode" json:"contents,omitempty"` - Filenames EncryptionOptions_Mode `protobuf:"varint,3,opt,name=filenames,proto3,enum=metadata.EncryptionOptions_Mode" json:"filenames,omitempty"` - PolicyVersion int64 `protobuf:"varint,4,opt,name=policy_version,json=policyVersion,proto3" json:"policy_version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EncryptionOptions) Reset() { *m = EncryptionOptions{} } -func (m *EncryptionOptions) String() string { return proto.CompactTextString(m) } -func (*EncryptionOptions) ProtoMessage() {} -func (*EncryptionOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{3} -} -func (m *EncryptionOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EncryptionOptions.Unmarshal(m, b) -} -func (m *EncryptionOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EncryptionOptions.Marshal(b, m, deterministic) -} -func (dst *EncryptionOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptionOptions.Merge(dst, src) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Padding int64 `protobuf:"varint,1,opt,name=padding,proto3" json:"padding,omitempty"` + Contents EncryptionOptions_Mode `protobuf:"varint,2,opt,name=contents,proto3,enum=metadata.EncryptionOptions_Mode" json:"contents,omitempty"` + Filenames EncryptionOptions_Mode `protobuf:"varint,3,opt,name=filenames,proto3,enum=metadata.EncryptionOptions_Mode" json:"filenames,omitempty"` + PolicyVersion int64 `protobuf:"varint,4,opt,name=policy_version,json=policyVersion,proto3" json:"policy_version,omitempty"` +} + +func (x *EncryptionOptions) Reset() { + *x = EncryptionOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_metadata_metadata_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *EncryptionOptions) XXX_Size() int { - return xxx_messageInfo_EncryptionOptions.Size(m) + +func (x *EncryptionOptions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EncryptionOptions) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptionOptions.DiscardUnknown(m) + +func (*EncryptionOptions) ProtoMessage() {} + +func (x *EncryptionOptions) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadata_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_EncryptionOptions proto.InternalMessageInfo +// Deprecated: Use EncryptionOptions.ProtoReflect.Descriptor instead. +func (*EncryptionOptions) Descriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{3} +} -func (m *EncryptionOptions) GetPadding() int64 { - if m != nil { - return m.Padding +func (x *EncryptionOptions) GetPadding() int64 { + if x != nil { + return x.Padding } return 0 } -func (m *EncryptionOptions) GetContents() EncryptionOptions_Mode { - if m != nil { - return m.Contents +func (x *EncryptionOptions) GetContents() EncryptionOptions_Mode { + if x != nil { + return x.Contents } return EncryptionOptions_default } -func (m *EncryptionOptions) GetFilenames() EncryptionOptions_Mode { - if m != nil { - return m.Filenames +func (x *EncryptionOptions) GetFilenames() EncryptionOptions_Mode { + if x != nil { + return x.Filenames } return EncryptionOptions_default } -func (m *EncryptionOptions) GetPolicyVersion() int64 { - if m != nil { - return m.PolicyVersion +func (x *EncryptionOptions) GetPolicyVersion() int64 { + if x != nil { + return x.PolicyVersion } return 0 } type WrappedPolicyKey struct { - ProtectorDescriptor string `protobuf:"bytes,1,opt,name=protector_descriptor,json=protectorDescriptor,proto3" json:"protector_descriptor,omitempty"` - WrappedKey *WrappedKeyData `protobuf:"bytes,2,opt,name=wrapped_key,json=wrappedKey,proto3" json:"wrapped_key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *WrappedPolicyKey) Reset() { *m = WrappedPolicyKey{} } -func (m *WrappedPolicyKey) String() string { return proto.CompactTextString(m) } -func (*WrappedPolicyKey) ProtoMessage() {} -func (*WrappedPolicyKey) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{4} + ProtectorDescriptor string `protobuf:"bytes,1,opt,name=protector_descriptor,json=protectorDescriptor,proto3" json:"protector_descriptor,omitempty"` + WrappedKey *WrappedKeyData `protobuf:"bytes,2,opt,name=wrapped_key,json=wrappedKey,proto3" json:"wrapped_key,omitempty"` } -func (m *WrappedPolicyKey) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WrappedPolicyKey.Unmarshal(m, b) -} -func (m *WrappedPolicyKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WrappedPolicyKey.Marshal(b, m, deterministic) -} -func (dst *WrappedPolicyKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_WrappedPolicyKey.Merge(dst, src) + +func (x *WrappedPolicyKey) Reset() { + *x = WrappedPolicyKey{} + if protoimpl.UnsafeEnabled { + mi := &file_metadata_metadata_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *WrappedPolicyKey) XXX_Size() int { - return xxx_messageInfo_WrappedPolicyKey.Size(m) + +func (x *WrappedPolicyKey) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WrappedPolicyKey) XXX_DiscardUnknown() { - xxx_messageInfo_WrappedPolicyKey.DiscardUnknown(m) + +func (*WrappedPolicyKey) ProtoMessage() {} + +func (x *WrappedPolicyKey) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadata_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_WrappedPolicyKey proto.InternalMessageInfo +// Deprecated: Use WrappedPolicyKey.ProtoReflect.Descriptor instead. +func (*WrappedPolicyKey) Descriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{4} +} -func (m *WrappedPolicyKey) GetProtectorDescriptor() string { - if m != nil { - return m.ProtectorDescriptor +func (x *WrappedPolicyKey) GetProtectorDescriptor() string { + if x != nil { + return x.ProtectorDescriptor } return "" } -func (m *WrappedPolicyKey) GetWrappedKey() *WrappedKeyData { - if m != nil { - return m.WrappedKey +func (x *WrappedPolicyKey) GetWrappedKey() *WrappedKeyData { + if x != nil { + return x.WrappedKey } return nil } // The associated data for each policy type PolicyData struct { - KeyDescriptor string `protobuf:"bytes,1,opt,name=key_descriptor,json=keyDescriptor,proto3" json:"key_descriptor,omitempty"` - Options *EncryptionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - WrappedPolicyKeys []*WrappedPolicyKey `protobuf:"bytes,3,rep,name=wrapped_policy_keys,json=wrappedPolicyKeys,proto3" json:"wrapped_policy_keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PolicyData) Reset() { *m = PolicyData{} } -func (m *PolicyData) String() string { return proto.CompactTextString(m) } -func (*PolicyData) ProtoMessage() {} -func (*PolicyData) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{5} -} -func (m *PolicyData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PolicyData.Unmarshal(m, b) -} -func (m *PolicyData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PolicyData.Marshal(b, m, deterministic) + KeyDescriptor string `protobuf:"bytes,1,opt,name=key_descriptor,json=keyDescriptor,proto3" json:"key_descriptor,omitempty"` + Options *EncryptionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + WrappedPolicyKeys []*WrappedPolicyKey `protobuf:"bytes,3,rep,name=wrapped_policy_keys,json=wrappedPolicyKeys,proto3" json:"wrapped_policy_keys,omitempty"` } -func (dst *PolicyData) XXX_Merge(src proto.Message) { - xxx_messageInfo_PolicyData.Merge(dst, src) + +func (x *PolicyData) Reset() { + *x = PolicyData{} + if protoimpl.UnsafeEnabled { + mi := &file_metadata_metadata_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PolicyData) XXX_Size() int { - return xxx_messageInfo_PolicyData.Size(m) + +func (x *PolicyData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PolicyData) XXX_DiscardUnknown() { - xxx_messageInfo_PolicyData.DiscardUnknown(m) + +func (*PolicyData) ProtoMessage() {} + +func (x *PolicyData) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadata_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PolicyData proto.InternalMessageInfo +// Deprecated: Use PolicyData.ProtoReflect.Descriptor instead. +func (*PolicyData) Descriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{5} +} -func (m *PolicyData) GetKeyDescriptor() string { - if m != nil { - return m.KeyDescriptor +func (x *PolicyData) GetKeyDescriptor() string { + if x != nil { + return x.KeyDescriptor } return "" } -func (m *PolicyData) GetOptions() *EncryptionOptions { - if m != nil { - return m.Options +func (x *PolicyData) GetOptions() *EncryptionOptions { + if x != nil { + return x.Options } return nil } -func (m *PolicyData) GetWrappedPolicyKeys() []*WrappedPolicyKey { - if m != nil { - return m.WrappedPolicyKeys +func (x *PolicyData) GetWrappedPolicyKeys() []*WrappedPolicyKey { + if x != nil { + return x.WrappedPolicyKeys } return nil } // Data stored in the config file type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Source SourceType `protobuf:"varint,1,opt,name=source,proto3,enum=metadata.SourceType" json:"source,omitempty"` HashCosts *HashingCosts `protobuf:"bytes,2,opt,name=hash_costs,json=hashCosts,proto3" json:"hash_costs,omitempty"` Options *EncryptionOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` UseFsKeyringForV1Policies bool `protobuf:"varint,5,opt,name=use_fs_keyring_for_v1_policies,json=useFsKeyringForV1Policies,proto3" json:"use_fs_keyring_for_v1_policies,omitempty"` AllowCrossUserMetadata bool `protobuf:"varint,6,opt,name=allow_cross_user_metadata,json=allowCrossUserMetadata,proto3" json:"allow_cross_user_metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Config) Reset() { *m = Config{} } -func (m *Config) String() string { return proto.CompactTextString(m) } -func (*Config) ProtoMessage() {} -func (*Config) Descriptor() ([]byte, []int) { - return fileDescriptor_metadata_31965d2849cb292a, []int{6} -} -func (m *Config) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Config.Unmarshal(m, b) -} -func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Config.Marshal(b, m, deterministic) -} -func (dst *Config) XXX_Merge(src proto.Message) { - xxx_messageInfo_Config.Merge(dst, src) +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_metadata_metadata_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Config) XXX_Size() int { - return xxx_messageInfo_Config.Size(m) + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Config) XXX_DiscardUnknown() { - xxx_messageInfo_Config.DiscardUnknown(m) + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_metadata_metadata_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Config proto.InternalMessageInfo +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_metadata_metadata_proto_rawDescGZIP(), []int{6} +} -func (m *Config) GetSource() SourceType { - if m != nil { - return m.Source +func (x *Config) GetSource() SourceType { + if x != nil { + return x.Source } return SourceType_default } -func (m *Config) GetHashCosts() *HashingCosts { - if m != nil { - return m.HashCosts +func (x *Config) GetHashCosts() *HashingCosts { + if x != nil { + return x.HashCosts } return nil } -func (m *Config) GetOptions() *EncryptionOptions { - if m != nil { - return m.Options +func (x *Config) GetOptions() *EncryptionOptions { + if x != nil { + return x.Options } return nil } -func (m *Config) GetUseFsKeyringForV1Policies() bool { - if m != nil { - return m.UseFsKeyringForV1Policies +func (x *Config) GetUseFsKeyringForV1Policies() bool { + if x != nil { + return x.UseFsKeyringForV1Policies } return false } -func (m *Config) GetAllowCrossUserMetadata() bool { - if m != nil { - return m.AllowCrossUserMetadata +func (x *Config) GetAllowCrossUserMetadata() bool { + if x != nil { + return x.AllowCrossUserMetadata } return false } -func init() { - proto.RegisterType((*HashingCosts)(nil), "metadata.HashingCosts") - proto.RegisterType((*WrappedKeyData)(nil), "metadata.WrappedKeyData") - proto.RegisterType((*ProtectorData)(nil), "metadata.ProtectorData") - proto.RegisterType((*EncryptionOptions)(nil), "metadata.EncryptionOptions") - proto.RegisterType((*WrappedPolicyKey)(nil), "metadata.WrappedPolicyKey") - proto.RegisterType((*PolicyData)(nil), "metadata.PolicyData") - proto.RegisterType((*Config)(nil), "metadata.Config") - proto.RegisterEnum("metadata.SourceType", SourceType_name, SourceType_value) - proto.RegisterEnum("metadata.EncryptionOptions_Mode", EncryptionOptions_Mode_name, EncryptionOptions_Mode_value) -} - -func init() { proto.RegisterFile("metadata/metadata.proto", fileDescriptor_metadata_31965d2849cb292a) } - -var fileDescriptor_metadata_31965d2849cb292a = []byte{ - // 748 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdb, 0x6a, 0xf3, 0x46, - 0x10, 0xae, 0x24, 0xc7, 0x87, 0xf1, 0xa1, 0xca, 0xfe, 0x69, 0xaa, 0xb4, 0x50, 0x8c, 0x4b, 0x20, - 0x94, 0x90, 0x62, 0x97, 0x94, 0x06, 0x4a, 0x21, 0x75, 0x92, 0x36, 0x09, 0xa1, 0xe9, 0xda, 0x75, - 0x5b, 0x28, 0x88, 0x8d, 0xb4, 0xb6, 0x17, 0x4b, 0x5a, 0xb1, 0xbb, 0x8a, 0xd1, 0x5d, 0xef, 0xfa, - 0x00, 0x7d, 0x97, 0xf6, 0x65, 0xfa, 0x30, 0x45, 0x2b, 0xc9, 0x87, 0x04, 0x42, 0xf2, 0xdf, 0x98, - 0xd9, 0x6f, 0x67, 0xe6, 0x9b, 0xf9, 0x66, 0xc7, 0x82, 0x8f, 0x43, 0xaa, 0x88, 0x4f, 0x14, 0xf9, - 0xb2, 0x34, 0x4e, 0x62, 0xc1, 0x15, 0x47, 0xf5, 0xf2, 0xdc, 0xfb, 0x03, 0x5a, 0x3f, 0x12, 0x39, - 0x67, 0xd1, 0x6c, 0xc8, 0xa5, 0x92, 0x08, 0x41, 0x45, 0xb1, 0x90, 0x3a, 0x66, 0xd7, 0x38, 0xb2, - 0xb0, 0xb6, 0xd1, 0x3e, 0x54, 0x43, 0x1a, 0x72, 0x91, 0x3a, 0x96, 0x46, 0x8b, 0x13, 0xea, 0x42, - 0x33, 0x26, 0x82, 0x04, 0x01, 0x0d, 0x98, 0x0c, 0x9d, 0x8a, 0xbe, 0xdc, 0x84, 0x7a, 0xbf, 0x43, - 0xe7, 0x57, 0x41, 0xe2, 0x98, 0xfa, 0xb7, 0x34, 0xbd, 0x20, 0x8a, 0xa0, 0x0e, 0x98, 0xd7, 0x13, - 0xc7, 0xe8, 0x1a, 0x47, 0x2d, 0x6c, 0x5e, 0x4f, 0xd0, 0xe7, 0xd0, 0xa6, 0x91, 0x27, 0xd2, 0x58, - 0x51, 0xdf, 0x5d, 0xd0, 0x54, 0x13, 0xb7, 0x70, 0x6b, 0x05, 0xde, 0xd2, 0x34, 0x2b, 0x6a, 0x1e, - 0x12, 0x4f, 0xd3, 0xb7, 0xb0, 0xb6, 0x7b, 0x7f, 0x9b, 0xd0, 0xbe, 0x17, 0x5c, 0x51, 0x4f, 0x71, - 0xa1, 0x53, 0xf7, 0x61, 0x2f, 0x2e, 0x01, 0xd7, 0xa7, 0xd2, 0x13, 0x2c, 0x56, 0x5c, 0x68, 0xb2, - 0x06, 0x7e, 0xb7, 0xba, 0xbb, 0x58, 0x5d, 0xa1, 0x63, 0xa8, 0x4a, 0x9e, 0x08, 0x2f, 0xef, 0xb7, - 0x33, 0xd8, 0x3b, 0x59, 0x09, 0x35, 0xd2, 0xf8, 0x38, 0x8d, 0x29, 0x2e, 0x7c, 0xb2, 0x32, 0x22, - 0x12, 0x52, 0x5d, 0x46, 0x03, 0x6b, 0x1b, 0x1d, 0xc3, 0x8e, 0x97, 0x09, 0xa7, 0xbb, 0x6f, 0x0e, - 0xf6, 0xd7, 0x09, 0x36, 0x65, 0xc5, 0xb9, 0x53, 0x96, 0x41, 0x92, 0x40, 0x39, 0x3b, 0x79, 0x23, - 0x99, 0x8d, 0x6c, 0xb0, 0x12, 0xe6, 0x3b, 0x55, 0xad, 0x5e, 0x66, 0xa2, 0x33, 0x68, 0x2e, 0x73, - 0xd5, 0xb4, 0x22, 0x35, 0x9d, 0xd9, 0x59, 0x67, 0xde, 0x96, 0x14, 0xc3, 0x72, 0x75, 0xee, 0xfd, - 0x67, 0xc2, 0xee, 0x65, 0x2e, 0x1d, 0xe3, 0xd1, 0x4f, 0xfa, 0x57, 0x22, 0x07, 0x6a, 0x31, 0xf1, - 0x7d, 0x16, 0xcd, 0xb4, 0x18, 0x16, 0x2e, 0x8f, 0xe8, 0x5b, 0xa8, 0x7b, 0x3c, 0x52, 0x34, 0x52, - 0xb2, 0x90, 0xa0, 0xbb, 0xe6, 0x79, 0x96, 0xe8, 0xe4, 0x8e, 0xfb, 0x14, 0xaf, 0x22, 0xd0, 0x77, - 0xd0, 0x98, 0xb2, 0x80, 0x66, 0x42, 0x48, 0xad, 0xca, 0x6b, 0xc2, 0xd7, 0x21, 0xe8, 0x10, 0x3a, - 0x31, 0x0f, 0x98, 0x97, 0xba, 0x8f, 0x54, 0x48, 0xc6, 0xa3, 0xe2, 0x0d, 0xb5, 0x73, 0x74, 0x92, - 0x83, 0xbd, 0xbf, 0x0c, 0xa8, 0x64, 0xa1, 0xa8, 0x09, 0x35, 0x9f, 0x4e, 0x49, 0x12, 0x28, 0xfb, - 0x03, 0xf4, 0x21, 0x34, 0xcf, 0x2f, 0x47, 0xee, 0xe0, 0xf4, 0x6b, 0xf7, 0xb7, 0xf1, 0xc8, 0x36, - 0x36, 0x81, 0x1f, 0x86, 0x77, 0xb6, 0xb9, 0x09, 0x0c, 0xbf, 0x1f, 0xda, 0xd6, 0x16, 0x30, 0x1e, - 0xd9, 0x95, 0x12, 0xe8, 0x0f, 0xbe, 0xd1, 0x1e, 0x3b, 0x5b, 0xc0, 0x78, 0x64, 0x57, 0x51, 0x0b, - 0xea, 0xe7, 0x3e, 0x23, 0x91, 0x4a, 0x42, 0xbb, 0xd1, 0xfb, 0xd3, 0x00, 0xbb, 0x50, 0xff, 0x5e, - 0x97, 0x98, 0xbd, 0xce, 0xf7, 0x78, 0x77, 0x4f, 0x26, 0x6c, 0xbe, 0x61, 0xc2, 0xff, 0x18, 0x00, - 0x39, 0xb7, 0x7e, 0xf4, 0x87, 0xd0, 0x59, 0xd0, 0xf4, 0x39, 0x6d, 0x7b, 0x41, 0xd3, 0x0d, 0xc2, - 0x53, 0xa8, 0xf1, 0x7c, 0x08, 0x05, 0xd9, 0xa7, 0x2f, 0xcc, 0x09, 0x97, 0xbe, 0xe8, 0x06, 0xde, - 0x95, 0x75, 0x16, 0x83, 0x5a, 0xd0, 0x34, 0x1b, 0xb5, 0x75, 0xd4, 0x1c, 0x7c, 0xf2, 0xac, 0xde, - 0x95, 0x26, 0x78, 0x77, 0xf9, 0x04, 0x91, 0xbd, 0x7f, 0x4d, 0xa8, 0x0e, 0x79, 0x34, 0x65, 0xb3, - 0x8d, 0xb5, 0x33, 0x5e, 0xb1, 0x76, 0xa7, 0x00, 0x73, 0x22, 0xe7, 0x6e, 0xbe, 0x67, 0xe6, 0x8b, - 0x7b, 0xd6, 0xc8, 0x3c, 0xf3, 0x7f, 0xb2, 0x8d, 0x96, 0x2b, 0x6f, 0x68, 0xf9, 0x1c, 0x3e, 0x4b, - 0x24, 0x75, 0xa7, 0x32, 0x6b, 0x55, 0xb0, 0x68, 0xe6, 0x4e, 0xb9, 0x70, 0x1f, 0xfb, 0xb9, 0x00, - 0x8c, 0x4a, 0xbd, 0xbc, 0x75, 0x7c, 0x90, 0x48, 0x7a, 0x25, 0x6f, 0x73, 0x9f, 0x2b, 0x2e, 0x26, - 0xfd, 0xfb, 0xc2, 0x01, 0x9d, 0xc1, 0x01, 0x09, 0x02, 0xbe, 0x74, 0x3d, 0xc1, 0xa5, 0x74, 0x13, - 0x49, 0x85, 0x5b, 0x52, 0xeb, 0x3d, 0xaf, 0xe3, 0x7d, 0xed, 0x30, 0xcc, 0xee, 0x7f, 0x91, 0x54, - 0xdc, 0x15, 0xb7, 0x37, 0x95, 0xba, 0x65, 0x57, 0x70, 0xdb, 0xe3, 0x61, 0x4c, 0x14, 0x7b, 0x60, - 0x01, 0x53, 0xe9, 0x17, 0x3f, 0x03, 0xac, 0x65, 0xd9, 0x5e, 0x02, 0x04, 0x9d, 0x98, 0x84, 0x6e, - 0x4c, 0xa4, 0x8c, 0xe7, 0x82, 0x48, 0x6a, 0x1b, 0xe8, 0x23, 0xd8, 0xf5, 0x12, 0xa9, 0xf8, 0x16, - 0x6c, 0x66, 0x71, 0x82, 0x2c, 0xb3, 0xae, 0x6c, 0xeb, 0xa1, 0xaa, 0xbf, 0x03, 0x5f, 0xfd, 0x1f, - 0x00, 0x00, 0xff, 0xff, 0xe2, 0x78, 0x9e, 0x2e, 0x22, 0x06, 0x00, 0x00, +var File_metadata_metadata_proto protoreflect.FileDescriptor + +var file_metadata_metadata_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x22, 0x5c, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x43, 0x6f, + 0x73, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, + 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x69, 0x73, 0x6d, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x69, 0x73, + 0x6d, 0x22, 0x59, 0x0a, 0x0e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x56, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x02, 0x49, 0x56, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6d, 0x61, 0x63, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x6d, 0x61, 0x63, 0x22, 0x93, 0x02, 0x0a, + 0x0d, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x31, + 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x72, + 0x6f, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x63, 0x6f, 0x73, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x48, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x73, 0x74, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x73, 0x74, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0b, 0x77, 0x72, 0x61, 0x70, 0x70, + 0x65, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x4b, + 0x65, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x4b, + 0x65, 0x79, 0x22, 0xdc, 0x02, 0x0a, 0x11, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, + 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, + 0x6e, 0x67, 0x12, 0x3c, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x3e, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x87, 0x01, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x10, 0x00, 0x12, 0x0f, 0x0a, + 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x58, 0x54, 0x53, 0x10, 0x01, 0x12, 0x0f, + 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x02, 0x12, + 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x43, 0x42, 0x43, 0x10, 0x03, + 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x43, 0x54, 0x53, 0x10, + 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x43, 0x42, 0x43, + 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x43, 0x54, + 0x53, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x64, 0x69, 0x61, 0x6e, 0x74, 0x75, 0x6d, 0x10, + 0x09, 0x22, 0x80, 0x01, 0x0a, 0x10, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x0b, 0x77, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x4b, 0x65, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x4b, 0x65, 0x79, 0x22, 0xb6, 0x01, 0x0a, 0x0a, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6b, 0x65, 0x79, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x35, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x4a, 0x0a, 0x13, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4b, 0x65, 0x79, 0x52, 0x11, 0x77, 0x72, 0x61, 0x70, + 0x70, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4b, 0x65, 0x79, 0x73, 0x22, 0xb7, 0x02, + 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x63, + 0x6f, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x73, + 0x74, 0x73, 0x52, 0x09, 0x68, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x73, 0x74, 0x73, 0x12, 0x35, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x1e, 0x75, 0x73, 0x65, 0x5f, 0x66, 0x73, 0x5f, 0x6b, + 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x76, 0x31, 0x5f, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x75, 0x73, + 0x65, 0x46, 0x73, 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x56, 0x31, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x5f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, + 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2a, 0x51, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x70, 0x61, 0x6d, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, + 0x72, 0x61, 0x73, 0x65, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x10, 0x02, 0x12, 0x0b, 0x0a, + 0x07, 0x72, 0x61, 0x77, 0x5f, 0x6b, 0x65, 0x79, 0x10, 0x03, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x66, 0x73, 0x63, 0x72, 0x79, 0x70, 0x74, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_metadata_metadata_proto_rawDescOnce sync.Once + file_metadata_metadata_proto_rawDescData = file_metadata_metadata_proto_rawDesc +) + +func file_metadata_metadata_proto_rawDescGZIP() []byte { + file_metadata_metadata_proto_rawDescOnce.Do(func() { + file_metadata_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_metadata_metadata_proto_rawDescData) + }) + return file_metadata_metadata_proto_rawDescData +} + +var file_metadata_metadata_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_metadata_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_metadata_metadata_proto_goTypes = []interface{}{ + (SourceType)(0), // 0: metadata.SourceType + (EncryptionOptions_Mode)(0), // 1: metadata.EncryptionOptions.Mode + (*HashingCosts)(nil), // 2: metadata.HashingCosts + (*WrappedKeyData)(nil), // 3: metadata.WrappedKeyData + (*ProtectorData)(nil), // 4: metadata.ProtectorData + (*EncryptionOptions)(nil), // 5: metadata.EncryptionOptions + (*WrappedPolicyKey)(nil), // 6: metadata.WrappedPolicyKey + (*PolicyData)(nil), // 7: metadata.PolicyData + (*Config)(nil), // 8: metadata.Config +} +var file_metadata_metadata_proto_depIdxs = []int32{ + 0, // 0: metadata.ProtectorData.source:type_name -> metadata.SourceType + 2, // 1: metadata.ProtectorData.costs:type_name -> metadata.HashingCosts + 3, // 2: metadata.ProtectorData.wrapped_key:type_name -> metadata.WrappedKeyData + 1, // 3: metadata.EncryptionOptions.contents:type_name -> metadata.EncryptionOptions.Mode + 1, // 4: metadata.EncryptionOptions.filenames:type_name -> metadata.EncryptionOptions.Mode + 3, // 5: metadata.WrappedPolicyKey.wrapped_key:type_name -> metadata.WrappedKeyData + 5, // 6: metadata.PolicyData.options:type_name -> metadata.EncryptionOptions + 6, // 7: metadata.PolicyData.wrapped_policy_keys:type_name -> metadata.WrappedPolicyKey + 0, // 8: metadata.Config.source:type_name -> metadata.SourceType + 2, // 9: metadata.Config.hash_costs:type_name -> metadata.HashingCosts + 5, // 10: metadata.Config.options:type_name -> metadata.EncryptionOptions + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_metadata_metadata_proto_init() } +func file_metadata_metadata_proto_init() { + if File_metadata_metadata_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_metadata_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HashingCosts); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metadata_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WrappedKeyData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metadata_metadata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtectorData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metadata_metadata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptionOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metadata_metadata_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WrappedPolicyKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metadata_metadata_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PolicyData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metadata_metadata_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_metadata_metadata_proto_rawDesc, + NumEnums: 2, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_metadata_metadata_proto_goTypes, + DependencyIndexes: file_metadata_metadata_proto_depIdxs, + EnumInfos: file_metadata_metadata_proto_enumTypes, + MessageInfos: file_metadata_metadata_proto_msgTypes, + }.Build() + File_metadata_metadata_proto = out.File + file_metadata_metadata_proto_rawDesc = nil + file_metadata_metadata_proto_goTypes = nil + file_metadata_metadata_proto_depIdxs = nil } diff --git a/metadata/metadata.proto b/metadata/metadata.proto index 84245e0..429e8c7 100644 --- a/metadata/metadata.proto +++ b/metadata/metadata.proto @@ -23,6 +23,8 @@ syntax = "proto3"; package metadata; +option go_package = "github.com/google/fscrypt/metadata"; + // Cost parameters to be used in our hashing functions. message HashingCosts { int64 time = 2; diff --git a/metadata/policy_test.go b/metadata/policy_test.go index 3c0704a..7fe2841 100644 --- a/metadata/policy_test.go +++ b/metadata/policy_test.go @@ -25,8 +25,8 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" "golang.org/x/sys/unix" + "google.golang.org/protobuf/proto" "github.com/google/fscrypt/util" ) @@ -1,13 +1,15 @@ +//go:build tools // +build tools + // Never compiled, just used to manage tool dependencies package tools import ( _ "github.com/client9/misspell/cmd/misspell" - _ "github.com/golang/protobuf/protoc-gen-go" _ "github.com/wadey/gocovmerge" _ "golang.org/x/lint/golint" _ "golang.org/x/tools/cmd/goimports" + _ "google.golang.org/protobuf/cmd/protoc-gen-go" _ "honnef.co/go/tools/cmd/staticcheck" ) |