[noise] NLS implementation in Go

Gerardo Di Giacomo gedigi at live.com
Thu May 24 04:43:56 PDT 2018


Hello,

While working on the payload management for NoiseLink and NoiseZeroLink I've noticed something a little confusing.

NoiseLink (XX) defines:

message NoiseLinkHandshakePayloadResponse1 {
  repeated string evidence_request_type = 1;
  repeated string evidence_blob_type = 2;
  repeated bytes evidence_blob = 3;
}

message NoiseLinkHandshakePayloadRequest2 {
  repeated string evidence_blob_type = 2;
  repeated bytes evidence_blob = 3;
}

While NoiseZeroLink (IK) defines:

message NoiseZeroLinkHandshakePayloadRequest1 {
  repeated string evidence_request_type = 1;
  repeated string evidence_blob_type = 2;
  repeated bytes evidence_blob = 3;
}

message NoiseZeroLinkHandshakePayloadResponse1 {
  repeated string evidence_blob_type = 2;
  repeated bytes evidence_blob = 3;
}

It is a little confusing to me in which moment of the handshake these should be sent (although there's a little description in paragraph 3.3), and the names don't help. NoiseLinkHandshakePayloadResponse1 contains the evidence_request_type and according to 3.3 it should be sent by a client that wants a blob from the server, yet it's called "Response".

Since they have the same fields, why defining the same two structures twice with different names?

Also, since the first Negotiation protobuf is called NoiseLinkNegotiationDataRequest1, would it be less confusing to call the payload request NoiseZeroLinkHandshakePayloadRequest1 and the response NoiseZeroLinkHandshakePayloadResponse1 for both XX and IK?

Or, for sake of simplicity and to avoid having to parse the same type of data in 4 different situations, would it make sense to have a single structure for payloads (for both XX and IK, and for both requests and responses) that contains all 3 fields? They already share the same NegotiationData structures. 

Thanks, Gerardo


> On May 8, 2018, at 8:45 PM, Gerardo Di Giacomo <gedigi at live.com> wrote:
> 
> Hello,
> 
> I've published an early beta of a NoiseLingoSocket (NoiseLink) implementation in Go. It is based on Alexey's NoiseSocket implementation at https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgo-noisesocket%2Fnoisesocket&data=02%7C01%7C%7Cac91ad187bc3482dea6b08d5b55f497d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636614343209316832&sdata=VDV46ax2XzkRF9vxgqd8ySc9%2BZGo4ViuSFvYwVIWT7U%3D&reserved=0.
> 
> It still misses a few things (like proper payload management) but it supports Switch/Retry/Reject.
> 
> You can see it at https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgedigi%2Fgo-nls%2Ftree%2Fdev&data=02%7C01%7C%7Cac91ad187bc3482dea6b08d5b55f497d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636614343209316832&sdata=k5nThPr0pn2c44hbMnGI77QL9cQzlCxhhoswnuFn0Gg%3D&reserved=0. Still in the dev branch for now, I'll merge it into master when I've at least completed the payload management and cleaned up the code a little bit.
> 
> Feedback and contributions are more than welcome.
> 
> Thanks, Gerardo
> _______________________________________________
> Noise mailing list
> Noise at moderncrypto.org
> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmoderncrypto.org%2Fmailman%2Flistinfo%2Fnoise&data=02%7C01%7C%7Cac91ad187bc3482dea6b08d5b55f497d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636614343209316832&sdata=eppn7J6WMFZpX2gQFS9UGE0%2Bb4SIlhaFUHlmraNCC4E%3D&reserved=0



More information about the Noise mailing list