Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-fallback handshake roles are not preserved #26

Open
nazar-pc opened this issue Sep 3, 2017 · 0 comments
Open

Pre-fallback handshake roles are not preserved #26

nazar-pc opened this issue Sep 3, 2017 · 0 comments

Comments

@nazar-pc
Copy link
Contributor

nazar-pc commented Sep 3, 2017

http://noiseprotocol.org/noise.html#fallback-patterns:

The initiator and responder roles from the pre-fallback handshake are preserved in the fallback handshake. Thus, the responder sends the first message in a fallback handshake.

However:

/* Fallback on the responder side */
compare(noise_handshakestate_fallback(responder), NOISE_ERROR_NONE);
compare(noise_handshakestate_get_role(initiator), NOISE_ROLE_INITIATOR);
compare(noise_handshakestate_get_role(responder), NOISE_ROLE_INITIATOR);

/* Fallback on the initiator side */
compare(noise_handshakestate_fallback(initiator), NOISE_ERROR_NONE);
compare(noise_handshakestate_get_role(initiator), NOISE_ROLE_RESPONDER);
compare(noise_handshakestate_get_role(responder), NOISE_ROLE_INITIATOR);

You can argue that this is an implementation detail, but still it would be better to not confuse those who use this library after reading the spec and introduce separate entity to indicate that fallback protocol is used.

UPD: I saw This function reverses the roles of initiator and responder., but this conflicts with the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant