tProper signature creation in dam.go - tordam - A library for peer discovery inside the Tor network HTML git clone https://git.parazyd.org/tordam DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit e2ed217643e34fff61eeb660a64c248e7689e8f4 DIR parent 0c8ccaabf122b19a04eb991da71177dbaef6bf2e HTML Author: parazyd <parazyd@dyne.org> Date: Thu, 7 Dec 2017 22:02:17 +0100 Proper signature creation in dam.go Diffstat: M go/dam/dam.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- DIR diff --git a/go/dam/dam.go b/go/dam/dam.go t@@ -21,6 +21,9 @@ const Privpath = "private.key" // Pubpath holds the path of where our public key is. const Pubpath = "public.key" +// Postmsg holds the message we are signing with our private key. +const Postmsg = "I am a DECODE node!" + func main() { if _, err := os.Stat("private.key"); os.IsNotExist(err) { key := lib.GenRsa(Bits) t@@ -31,13 +34,13 @@ func main() { key, err := lib.LoadKeyFromFile(Privpath) lib.CheckError(err) - sig := lib.SignMsg([]byte("I am a DECODE node!"), key) + sig := lib.SignMsg([]byte(Postmsg), key) encodedSig := base64.StdEncoding.EncodeToString(sig) vals := map[string]string{ "nodetype": "node", "address": lib.OnionFromPubkey(key.PublicKey), - "message": "I'm a DECODE node!", + "message": Postmsg, "signature": encodedSig, "secret": "", }