-
Notifications
You must be signed in to change notification settings - Fork 99
Out Of Order Messaging Checking #855
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
Conversation
ejohnstown
commented
Dec 9, 2025
- Improved the checking the appropriateness of messages depending on the state.
- Added explicit checking for specific messages when appropriate.
- Added a regression test that checks for specific failure cases.
1. Add macro for logging an expected message. 2. Add an expected message ID to the HandshakeInfo. 3. Add a message ID for "none (0)". 4. Add a check in IsMessageAllowedClient() for the expected message ID. Clear it if successful. 5. The KEXDH messages sent to the server have expected responses. Set them if sending the message is successful. 6. Add the set of message ID ranges and macros for testing if a message ID is in a specific range. 7. Add flags for having sent the kexinit message and received it. Tweak the checks for isKeying and these flags. 8. IsMessageAllowedClient() to check for appropriate messages at the appropriate time during the connect.
1. Updated the checking for the server to be more like the client's checking.
1. Exclude the file regress.c from the Zephyr testing sample. The test is covered in many other environments already. The test needs some retooling to fit in with the Zephyr build, as it is a standalone application with a main() function and it depends on a testing build of libwolfssh. 2. Whitespace.
1. Always set the expected message right before sending. If the send fails, it is either because the socket is closing, or it is wanting to block. If it is wanting to block, we still want to check the next message as expected.
douzzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make check passed with -DWOLFSSH_TEST_INTERNAL under sanitizers on both libwolfssl and wolfssh.
note, needed --enable-opensslextra on libwolfssl (for public FreeDecodedCert()) and -Wno-stringop-truncation on wolfssh for "examples/client/client.c:575:13: error: ‘strncpy’ specified bound 108 equals destination size", both unrelated to this PR.