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

Server does not respect client provided hash algorithm list #137

Closed
ondrap opened this issue Mar 21, 2016 · 10 comments
Closed

Server does not respect client provided hash algorithm list #137

ondrap opened this issue Mar 21, 2016 · 10 comments
Assignees
Labels

Comments

@ondrap
Copy link

ondrap commented Mar 21, 2016

I would like to use some Go client to connect to haskell using TLS, however it seems that the Go client doesn't understand SHA512. It correctly sends this information in Client HELO, yet the server responds with SHA512 in the EC Diffie-Hellman server params. It seems to me that the server doesn't merge client and server supported hash algorithms and just uses what the server has in serverSupported.

I limited it and got "unimplemented RSA signature hash type: HashSHA384", limiting it to SHA256 ultimately solved the problem.

@valpackett
Copy link
Contributor

I'm currently seeing "unimplemented RSA signature hash type: HashSHA384" when connecting to a Go server from a Haskell client!

What is it with Haskell and Go :-(

UPD: sent a PR: #138

@kazu-yamamoto
Copy link
Collaborator

If this is already fixed by #138, please close this issue.

@ondrap
Copy link
Author

ondrap commented Dec 21, 2016

I think #138 doesn't really fix the issue; it adds a SHA384 to the supported ciphers, which mitigates the problem with Go servers (and clients? I haven't tested it - maybe not), however the problem is that the server should check its cipher list against the client provided list and choose a cipher from the intersection of these 2 lists. It seems to me the server doesn't do that.

@kazu-yamamoto
Copy link
Collaborator

I suddenly remembered that I have hit upon the same thing in Warp, too:

yesodweb/wai@1726654

@kazu-yamamoto
Copy link
Collaborator

It correctly sends this information in Client HELO

@ondrap Do you mean the signature algorithm extensions in client hello?
If so, Haskell server should compute intersection between the values of the extension and supportedHashSignatures.

@kazu-yamamoto
Copy link
Collaborator

I would like to have test cases for this. Any volunteers?

@ondrap
Copy link
Author

ondrap commented Dec 21, 2016

Do you mean the signature algorithm extensions in client hello?
If so, Haskell server should compute intersection between the values of the extension and supportedHashSignatures.

Probably... I'm no well versed in tls - I remember I just checked the hs-tls sources and found out it doesn't do that; and I think it should. But I didn't see an obvious way to make a PR.

My test case was connecting the go client (I used the winlogbeats/filebeats from elasticsearch). I could probably try to test it out again.

@kazu-yamamoto kazu-yamamoto self-assigned this Dec 22, 2016
@kazu-yamamoto
Copy link
Collaborator

OK. Now I can reproduce this by reverting the patch above in Warp and h2spec written in Go.

kazu-yamamoto added a commit to kazu-yamamoto/hs-tls that referenced this issue Dec 22, 2016
This patch uses the "signature_algorithms" extension in a client hello
when a server decides a signature hash algorithm for EC(DHE)
parameters to authenticate the server itself.

Problem:
Go tls client tells that it supports SHA256/SHA384 but not SHA512.
Haskell tls server uses SHA512 for EC(DHE).
@kazu-yamamoto
Copy link
Collaborator

#177 should fix this issue.

@kazu-yamamoto
Copy link
Collaborator

This has been fixed.
Let's close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants