-
Notifications
You must be signed in to change notification settings - Fork 37
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
expose the peer certificates in the connection state #162
expose the peer certificates in the connection state #162
Conversation
e37cc7a
to
1006226
Compare
@ekr, @bifurcation: Any thoughts on this PR? |
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.
Does the validator do path construction? IF so, the list you are supplying here may be incorrect and you might want to instead just return the EE cert.
serverCertChain := make([]*x509.Certificate, len(state.serverCertificate.CertificateList)) | ||
for i, certEntry := range state.serverCertificate.CertificateList { | ||
serverCertChain[i] = certEntry.CertData | ||
} |
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.
Does the certificate authenticator do path construction?
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.
I'm not sure I understand your point. Certificate verification is broken anyway (#161).
conn_test.go
Outdated
if err != nil { | ||
panic(err) | ||
} | ||
clientKey, clientCert, err = genCerts() |
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 probably don't want this to use the server name.
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.
Can you use newSelfSigned()
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.
On Fri, Jan 26, 2018 at 3:08 PM, Marten Seemann ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In client-state-machine.go
<#162 (comment)>:
> @@ -821,6 +822,10 @@ func (state ClientStateWaitCV) Next(hr handshakeMessageReader) (HandshakeState,
} else {
logf(logTypeHandshake, "[ClientStateWaitCV] WARNING: No verification of server certificate")
}
+ serverCertChain := make([]*x509.Certificate, len(state.serverCertificate.CertificateList))
+ for i, certEntry := range state.serverCertificate.CertificateList {
+ serverCertChain[i] = certEntry.CertData
+ }
I'm not sure I understand your point. Certificate verification is broken
anyway (#161 <#161>).
Yes, but eventually it will be fixed, and so it would be good to have the
semantics be correct when that happens.
…-Ekr
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#162 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABD1oQTSNT8nCUT4Ph3fi5zJz54_FLmrks5tOlrVgaJpZM4RaflB>
.
|
Closing in favor of #173 |
The
ConnectionState.PeerCertificates
is now filled with the certificate chain that the peer sent. This works for both the server as well as the client.Note that this PR is unrelated to #161. The certificate chain exposed via
ConnectionState.PeerCertificates
is just what the peer sent.@ekr: This was marked as a TODO for you in the code, so I guess you'll have the most context to review this PR, right?