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

refactoring for sending and receiving #399

Merged
merged 22 commits into from
Oct 29, 2019

Conversation

kazu-yamamoto
Copy link
Collaborator

This patches make Sending and Receiving symmetric as described in #392.
Also, these reduce unnecessary encodings to calculate transcript hash.

Copy link
Contributor

@ocheron ocheron left a 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/Sending.hs Outdated Show resolved Hide resolved
getChunks len . B.concat <$> mapM (updateHandshake13 ctx) hss
encodePacketContent (Alert13 a) = return [encodeAlerts a]
encodePacketContent (AppData13 x) = return [x]
encodePacketContent ChangeCipherSpec13 = return [encodeChangeCipherSpec]
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Just a mistake!

core/Network/TLS/Sending.hs Show resolved Hide resolved
core/Network/TLS/Sending13.hs Show resolved Hide resolved
core/Network/TLS/Sending.hs Outdated Show resolved Hide resolved
core/Network/TLS/IO.hs Show resolved Hide resolved
core/Network/TLS/Receiving.hs Outdated Show resolved Hide resolved
@kazu-yamamoto
Copy link
Collaborator Author

@ocheron Would you review this again?

ocheron added a commit that referenced this pull request Oct 29, 2019
refactoring for sending and receiving
@ocheron ocheron merged commit 1b54258 into haskell-tls:master Oct 29, 2019
@ocheron
Copy link
Contributor

ocheron commented Oct 29, 2019

Good and merged. The simplifications about handshake encoding and processHandshake are really nice.

@kazu-yamamoto kazu-yamamoto deleted the send-recv branch October 30, 2019 00:53
@kazu-yamamoto
Copy link
Collaborator Author

Thank you for reviewing and merging!

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

Successfully merging this pull request may close these issues.

None yet

2 participants