Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow stricter permissions but not looser; Change default permissions to 0400; Correct and improve `unprotected key file' message. #138

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions depot/depot.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func (d *FileDepot) check(tag *Tag) error {
if err != nil {
return err
}
if ^fi.Mode()&tag.perm != 0 {
return errors.New("permission denied")
if fi.Mode()&^tag.perm != 0 {
return errors.New("unprotected key file `" + tag.name + "': file permissions too open")
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions depot/pkix.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const (
)

const (
BranchPerm = 0440
LeafPerm = 0444
BranchPerm = 0400
LeafPerm = 0400
)

// CrtTag returns a tag corresponding to a certificate
Expand Down