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

Selecting a cipher based on "signature_algorithms" #193

Merged
merged 6 commits into from
Mar 7, 2017
Merged

Selecting a cipher based on "signature_algorithms" #193

merged 6 commits into from
Mar 7, 2017

Conversation

ocheron
Copy link
Contributor

@ocheron ocheron commented Mar 5, 2017

This extends #177 so that the "signature_algorithms" extension impacts cipher selection as discussed in #191.

I added a new test case specific to TLS 1.2 where handshake can either succeed or fail depending on client and server supportedHashSignatures. This could be further extended to test more TLS 1.2 extensions like "supported_groups" when we implement it.

I also added code for DSA certificates, so that the QuickCheck properties can test more combinations.

Function credentialCanDecrypt allowed a non-RSA credential when
the certificate did not have a key usage.
Now that signature_algorithms extension is used to sign the
ServerKeyXchg, this creates a possibility that client and
server don't agree on the hash algorithm.  When this happens
a cipher with a different key-exchange should have been
selected.

We now skip ciphers when the key-exchange is not possible
because of this reason.
TLS12 -> let -- Build a list of all signature algorithms with at least
-- one hash algorithm common between client and server.
-- May contain duplicates, as it is only used for `elem`.
sigAlgExt = extensionLookup extensionID_SignatureAlgorithms exts >>= extensionDecode False
Copy link
Collaborator

Choose a reason for hiding this comment

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

The code here is a copy-and-paste.
They should be a function to avoid redundancy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you're right. I added that function.

@kazu-yamamoto kazu-yamamoto self-requested a review March 7, 2017 00:24
Copy link
Collaborator

@kazu-yamamoto kazu-yamamoto left a comment

Choose a reason for hiding this comment

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

LGTM now.

@kazu-yamamoto kazu-yamamoto merged commit 2be245c into haskell-tls:master Mar 7, 2017
@kazu-yamamoto
Copy link
Collaborator

I guess that it's time to release a new version.

@ocheron
Copy link
Contributor Author

ocheron commented Mar 7, 2017

Thanks. I created two new issues for things we could continue further, but I don't plan to work on them immediately. Anyone can self-assign.

A new release is a good idea, we have already 70 commits since 1.3.9.

@ocheron ocheron deleted the sigalg-ctd-new branch March 7, 2017 07:47
@kazu-yamamoto
Copy link
Collaborator

@vincenthz Let's release a new version.

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