tordam

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

commit e2ed217643e34fff61eeb660a64c248e7689e8f4
parent 0c8ccaabf122b19a04eb991da71177dbaef6bf2e
Author: parazyd <parazyd@dyne.org>
Date:   Thu,  7 Dec 2017 22:02:17 +0100

Proper signature creation in dam.go

Diffstat:
Mgo/dam/dam.go | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/go/dam/dam.go b/go/dam/dam.go @@ -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) @@ -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": "", }