From f6c49d3e907ce2ea1e1bfdebcc8e6d0160aecaa0 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 20 Jul 2017 00:49:51 +0200 Subject: Rename Enc to Sec --- file/file.go | 2 +- file/names.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'file') 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{ -- cgit v1.2.3