aboutsummaryrefslogtreecommitdiff
path: root/metadata/config.go
AgeCommit message (Collapse)Author
2017-07-18metadata: Remove "go generate" and regenerateJoe Richey joerichey@google.com
2017-05-31metadata: reorganize and add consistency checksJoe Richey joerichey@google.com
This commit adds in IsValid() checks for the metadata structures that let us enforce stronger invariants than those imposed by the protobuf package. The main uses of this will be to check that metadata is valid before writing it to the filesystem, and to check that the filesystem contains valid metadata before returning it to the user. These functions also will log the exact reason if the validity checks fail. To have these checks in the metadata package, all of the various constants have been moved to a single metadata/constants.go file. The uses of these constants were changed accordingly. Finally, this commit standardizes our use of errors so that they always begin with an appropriate prefix. Change-Id: I99008e2ee803ebe5f6236eb8d83fc83efcd22718
2017-05-02metadata: get and set policies from goJoe Richey
This commit adds in the ability to get and set policy data from go using the GetPolicy and SetPolicy functions. This is done via a patch of the x/sys/unix package that exposes the filesystem encryption structures. Note that not all the fields of the PolicyData protocol buffer are needed to get and set policies. The wrapped_policy_keys are not used and will be written and read by other components of fscrypt. To run the policy tests, the environment variable BASE_TEST_DIR must be set to a directory for testing on a filesystem that supports encryption. Change-Id: I13b1d983356845f3ffc1945cedf53234218f32e5
2017-05-02metadata: introduce protobuf structuresJoe Richey
This commit adds in the metadata package. The primary purpose of this package is to provide the on-disk metadata structures in the form of protocol buffers. This includes: - Policy metadata structure - Protector metadata structure - Config file structure - All necessary sub-structures (wrapped keys, parameters, etc) This commit also adds in an example usage of the Config structure, which represents the structure of the global config file. All the package does at this point is convert between the Config structure and a JSON representation. Here we introduce govendor, which is described more in the README. This means we will have all of our Go dependencies in the vendor subdirectory. This means we will have no Go source dependencies, only dependencies on the build tools (Go and govendor). The README describes this in detail. Note that we commit the generated files. see: https://blog.golang.org/generate Change-Id: Iaacd46666b5d3e4e865a0f4045dd63ed7e3d6f96