commit eafdb67c13390a504aca9557c7516d0c27d87787
parent 8c47d16505c8f1a164c683ad90db6de7a22d79da
Author: parazyd <parazyd@dyne.org>
Date: Mon, 11 Dec 2017 22:21:19 +0100
Allow nodetype of either "node" or "directory".
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/cmd/dam-dir/main.go b/cmd/dam-dir/main.go
@@ -86,6 +86,14 @@ func handlePost(rw http.ResponseWriter, request *http.Request) {
len(n.Message) == 0 || len(n.Signature) == 0 {
return
}
+ switch n.Nodetype {
+ case "node":
+ log.Println("Client of type:", n.Nodetype)
+ case "directory":
+ log.Println("Client of type:", n.Nodetype)
+ default:
+ return
+ }
decSig, err := base64.StdEncoding.DecodeString(n.Signature)
if err != nil {
diff --git a/protocol.md b/protocol.md
@@ -35,7 +35,7 @@ to one or more active directories with the format explained below.
N.B. The strings shown in this document might not be valid, but they
represent a correct example.
-* `type` reflects the type of the node (currently just a placeholder)
+* `type` reflects the type of the node (node/directory)
* `address` holds the address of the Tor hidden service
* `message` is the message that has to be signed using the private key
of this same hidden service.
@@ -74,7 +74,7 @@ will then be encoded using base64 and sent back to the client:
The client will try to decode and decrypt this secret, and send it back
to the directory to complete its part of the handshake. The POST request
this time will contain the following data:
-* `type` reflects the type of the node (currently just a placeholder)
+* `type` reflects the type of the node (node/directory)
* `address` holds the address of the Tor hidden service
* `message` is the decrypted and base64 encoded secret that the server
had just sent us.