aboutsummaryrefslogtreecommitdiff
path: root/file.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-04-18 21:44:09 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-04-18 21:44:09 +0200
commit4fbfd1286c60f1041f706355addddf3edb9ed81f (patch)
tree7a6665f5493ff54dfcfcafaff71c2f6c93ed167f /file.go
parent1f6f9ea5c7e59ee711892a800562b57b3c105a7a (diff)
...
Diffstat (limited to 'file.go')
-rw-r--r--file.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/file.go b/file.go
index c0d60ea..6bff903 100644
--- a/file.go
+++ b/file.go
@@ -21,18 +21,21 @@ type File struct {
const (
commentHdr = "untrusted comment:"
verifyWith = "verify with"
- pubKey = "%s public key"
- secKey = "%s secret key"
sigFrom = "signature from %s"
)
+var (
+ ErrCommentSize = errors.New("comment line to long")
+ ErrUntrustedComment = errors.New("expected untrusted comment")
+)
+
func checkComment(comment string) error {
// compatibility with original version
if len(comment) > 1024 {
- return errors.New("comment line to long")
+ return ErrCommentSize
}
if !strings.HasPrefix(comment, commentHdr) {
- return errors.New("expected untrusted comment")
+ return ErrUntrustedComment
}
return nil
}