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

Client auth server side #331

Merged
merged 19 commits into from
Jan 13, 2019

Conversation

kazu-yamamoto
Copy link
Collaborator

Passing test cases of client auth and usage.

Interoperability with OpenSSL is confirmed:

% stack exec tls-simpleserver -- -v --key=$SOMEWHERE/serverkey.pem --certificate=$SOMEWHERE/servercert.pem 13443 --tls13 --trust-anchor=$SOMEWHERE/cacert.pem

NG:

% ./opensslwrap.sh s_client 127.0.0.1:13443

OK:

% ./opensslwrap.sh s_client -cert=$SOMEWHERE/clientcert.pem -key=$SOMEWHERE/clientkey.pem 127.0.0.1:13443

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.

Main scenario is here but not all interactions are covered, see my comments.

core/Tests/Tests.hs Show resolved Hide resolved
core/Network/TLS/Handshake/Common13.hs Outdated Show resolved Hide resolved
-- Remember cert chain for later use.
--
usingHState ctx $ setClientCertChain certs
clientCertificate sparams ctx certs
Copy link
Contributor

Choose a reason for hiding this comment

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

The FIXME comment just below should probably be part of the function too.

core/Network/TLS/Handshake/Server.hs Outdated Show resolved Hide resolved
core/Network/TLS/Handshake/Server.hs Outdated Show resolved Hide resolved
core/Network/TLS/Handshake/Server.hs Outdated Show resolved Hide resolved
@kazu-yamamoto
Copy link
Collaborator Author

I'm now inactive since I'm on winter vacation. I will take care of this on 7th Jan.

@kazu-yamamoto
Copy link
Collaborator Author

Popping the action will work but it's not a very clean solution. Can't we just not use pending actions instead? From a user perspective it may be confusing to have invocation of callbacks and possible authentication failures transferred from handshake to recvData based on the client version. Since it is not post-handshake authentication.

Right. I have implemented this using recvHandshake13postUpdate.

Note that I dropped one commit and rebased this branch onto master and pushed -f.

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.

A bit more complex that I anticipated regarding the transcript. I think it can be simplified further by just giving the previous transcript as argument to the actions.

But this is already quite clean and provides what we need, thanks!

@ocheron ocheron merged commit d690792 into haskell-tls:master Jan 13, 2019
ocheron added a commit that referenced this pull request Jan 13, 2019
@kazu-yamamoto kazu-yamamoto deleted the client-auth-server-side branch January 13, 2019 22:47
@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.

2 participants