aboutsummaryrefslogtreecommitdiff
path: root/file
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-07-20 00:49:51 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-07-20 00:49:51 +0200
commitf6c49d3e907ce2ea1e1bfdebcc8e6d0160aecaa0 (patch)
treef60c6e4181a2ef8ba039546857468640323b011d /file
parent7d81c334c35b33f853edd7a7909e749ef277ae38 (diff)
Rename Enc to Sec
Diffstat (limited to 'file')
-rw-r--r--file/file.go2
-rw-r--r--file/names.go18
2 files changed, 10 insertions, 10 deletions
diff --git a/file/file.go b/file/file.go
index 0a3ad42..334fdca 100644
--- a/file/file.go
+++ b/file/file.go
@@ -13,7 +13,7 @@ import (
)
const (
- ModeEnc os.FileMode = 0600
+ ModeSec os.FileMode = 0600
ModePub os.FileMode = 0644
ModeSig os.FileMode = 0644
untrusted = "untrusted comment:"
diff --git a/file/names.go b/file/names.go
index 8ed4a36..11310b4 100644
--- a/file/names.go
+++ b/file/names.go
@@ -12,7 +12,7 @@ var ErrNames = errors.New("please use naming scheme of keyname.pub and keyname.s
const (
extPub = ".pub"
- extEnc = ".sec"
+ extSec = ".sec"
extSig = ".sig"
verifyWith = "verify with "
)
@@ -23,18 +23,18 @@ func splitNameExt(fname string) (string, string) {
return file[:len(file)-len(ext)], ext
}
-func ValidateNames(pubFile, encFile string) error {
+func ValidateNames(pubFile, secFile string) error {
pubName, pubExt := splitNameExt(pubFile)
- encName, encExt := splitNameExt(encFile)
- if pubExt != extPub || encExt != extEnc || pubName != encName {
+ secName, secExt := splitNameExt(secFile)
+ if pubExt != extPub || secExt != extSec || pubName != secName {
return ErrNames
}
return nil
}
-func PubName(encFile string) string {
- ext := filepath.Ext(encFile)
- return filepath.Base(encFile[:len(ext)-1] + extPub)
+func PubName(secFile string) string {
+ ext := filepath.Ext(secFile)
+ return filepath.Base(secFile[:len(ext)-1] + extPub)
}
func SigName(msgFile string) string {
@@ -51,8 +51,8 @@ func PubFile(comment string) (string, bool) {
return "", false
}
-func VerifyWith(encFile string) string {
- return verifyWith + PubName(encFile)
+func VerifyWith(secFile string) string {
+ return verifyWith + PubName(secFile)
}
var safePath = []string{