tordam

A library for peer discovery inside the Tor network
git clone https://git.parazyd.org/tordam
Log | Files | Refs | README | LICENSE

commit 3a9a28e936498bbc49d062d33a9edfa40323ae78
parent 900d82fe49fe9b0984b391bab528e9ec418dd446
Author: parazyd <parazyd@dyne.org>
Date:   Tue, 12 Dec 2017 14:46:36 +0100

Rename Privpath constant to PrivKeyPath

Diffstat:
Mcmd/dam-client/main.go | 8++++----
Mpkg/damlib/config.go | 4++--
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go @@ -107,16 +107,16 @@ func main() { err := os.Chdir(lib.Cwd) lib.CheckError(err) - if _, err := os.Stat(lib.Privpath); os.IsNotExist(err) { + if _, err := os.Stat(lib.PrivKeyPath); os.IsNotExist(err) { key, err := lib.GenRsa(lib.RsaBits) lib.CheckError(err) - _, err = lib.SavePrivRsa(lib.Privpath, key) + _, err = lib.SavePrivRsa(lib.PrivKeyPath, key) lib.CheckError(err) } // Start up the hidden service log.Println("Starting up the hidden service...") - cmd := exec.Command("damhs.py", lib.Privpath) + cmd := exec.Command("damhs.py", lib.PrivKeyPath) stdout, err := cmd.StdoutPipe() lib.CheckError(err) @@ -146,7 +146,7 @@ func main() { } } - key, err := lib.LoadRsaKeyFromFile(lib.Privpath) + key, err := lib.LoadRsaKeyFromFile(lib.PrivKeyPath) lib.CheckError(err) sig, err := lib.SignMsgRsa([]byte(lib.PostMsg), key) diff --git a/pkg/damlib/config.go b/pkg/damlib/config.go @@ -8,8 +8,8 @@ var Cwd = os.Getenv("HOME") + "/.dam" // RsaBits holds the size of our RSA private key. Tor standard is 1024. const RsaBits = 1024 -// Privpath holds the name of where our private key is. -const Privpath = "dam-private.key" +// PrivKeyPath holds the name of where our private key is. +const PrivKeyPath = "dam-private.key" // PostMsg holds the message we are signing with our private key. const PostMsg = "I am a DAM node!"