[noise] NLS?

Trevor Perrin trevp at trevp.net
Mon Mar 12 08:45:43 PDT 2018


On Mon, Mar 12, 2018 at 3:27 PM, Gerardo Di Giacomo <gedigi at live.com> wrote:
> Sorry hit enter too soon.
>
>> If the negotiation_data is zero-length, that means the responder
>> accepted the initiator's initial_protocol.  If the negotiation_data is
>> non-zero-length, it contains a NoiseLingoNegotiationDataResponse
>> protobuf, which the initiator parses to determine whether this is a
>> Switch, Retry, or Reject case.
>>
>> Hope that helps?
>
> Ok, so follow-up question:
> - What should be used as init prologue string? The NoiseSocketInit* or NLS(revision1), or both? It's not clear to me from the spec if NLS(revision1) should replace the NoiseSocketInit strings or not.

The specs need to be clearer, but the idea is that "NLS(revision1)" is
an "application prologue" which is appended to the NoiseSocket
prologue, so the entire prologue becomes:

"NoiseSocketInit1" || init_negotiation_data_len ||
init_negotiation_data || "NLS(revision1)"

https://github.com/noiseprotocol/noisesocket_spec/blob/master/output/noisesocket.pdf


> - In case of error (negotiation_data_len != 0) should a noise message be sent?

This needs to be clearer too.  But currently: if something goes wrong
with the handshake, NLS allows the server to return a "rejected" data,
which would be sent in negotiation_data alongside an empty Noise
message.  If an error occurs any other place, you'd just drop the
connection.

Trevor


More information about the Noise mailing list