-
Notifications
You must be signed in to change notification settings - Fork 92
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
Issue with no_hmac_verify flag #54
Comments
(#52) |
What difference does it make to reject incorrectly-signed packets? On a side note, my code e314264 is probably wrong. The name |
The issue is that correctly-signed packets are rejected. I have the feeling to have said everything, but I can try to explain differently. Let's given 3 kinds of nodes:
We expects that:
#35 verifies the above 3 cases. The hmac branch of jech/babeld (91a9259) fails for case 2. Otherwise, what would be the purpose of the discussed flag if it's not to provide a way to do a smooth upgrade to using HMAC ?
Oops, I didn't notice that #52 has more commits than the hmac branch of jech/babeld. We use the latter. About e314264 I don't see any code initializing hmac_verify to the default value of true. |
Nodes with default mac-verify would not accept packets from nodes with non-default mac-verify. Closes jech#54. Co-authored-by: Julien Muchembled <jm@jmuchemb.eu>
I'm sorry if I'm daft, Julien, but I still don't understand. The intent of the old code is that no HMAC verification is made at all if NO_HMAC_VERIFY is set. In other words, HMACs are ignored on reception, unconditionally. This is a simple semantics, and one that's easy to explain. It looks like the code is buggy; that's possible, in which case I'll be grateful for a bugfix. Your patch, however, changes the logic: now unsigned packets are accepted, but incorrectly signed packets (e.g. packets signed with an obsolete key) are rejected. This is a complicated semantics, one that is not easy to explain, and one that I don't feel is useful. Would you be willing to provide a fix for the bug without changing the intent of the code? |
The flag is now called Please let me know if there's still something missing. |
When starting from a network that does not use the HMAC that is in development, we consider that a proper way to enable it is to do it in 2 steps, so that all nodes don't need to restart with the new configuration at the same time.
The intermediate state is to have a network that is made of 2 kinds to nodes: those with initial configuration (no hmac settings at all), and other that sign packets but accept unsigned packets. For that, no_hmac_verify works.
Then, once all nodes use the intermediate configuration, we want nodes to restart without the no_hmac_verify settings. We started with a single node and found that it couldn't communicate with neighbours. babeld.log is full of _Received wrong PC or failed the challenge. _ messages.
This whole scenario worked with #35. Here is a patch that adapts this PR for the current hmac branch:
But
no_hmac_verify
does not even seem to be a good name. I have a preference for the name we chose in #35: the goal is not to skip checking but rather ignore when there's no HMAC.The text was updated successfully, but these errors were encountered: