-
Notifications
You must be signed in to change notification settings - Fork 87
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
refactoring for sending and receiving #399
Conversation
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.
Looks fine, I added a few suggestions.
core/Network/TLS/Sending13.hs
Outdated
getChunks len . B.concat <$> mapM (updateHandshake13 ctx) hss | ||
encodePacketContent (Alert13 a) = return [encodeAlerts a] | ||
encodePacketContent (AppData13 x) = return [x] | ||
encodePacketContent ChangeCipherSpec13 = return [encodeChangeCipherSpec] |
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.
packetToFragments
can now be a case expression instead of using an inner function.
As consequence of the refactoring, function encodeHandshakes13
is not used anymore. We can delete it.
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.
Done.
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.
You didn't mention any reason for not removing encodeHandshakes13
, so I delete it too.
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.
Sorry. Just a mistake!
@ocheron Would you review this again? |
refactoring for sending and receiving
Good and merged. The simplifications about handshake encoding and processHandshake are really nice. |
Thank you for reviewing and merging! |
This patches make
Sending
andReceiving
symmetric as described in #392.Also, these reduce unnecessary encodings to calculate transcript hash.