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

fix: make intermediates work with 'select-client-certificate' #29570

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions shell/browser/api/electron_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,16 @@ void OnClientCertificateSelected(
if (!certs.empty()) {
scoped_refptr<net::X509Certificate> cert(certs[0].get());
for (auto& identity : *identities) {
if (cert->EqualsExcludingChain(identity->certificate())) {
scoped_refptr<net::X509Certificate> identity_cert =
identity->certificate();
// Since |cert| was recreated from |data|, it won't include any
// intermediates. That's fine for checking equality, but once a match is
// found then |identity_cert| should be used since it will include the
// intermediates which would otherwise be lost.
if (cert->EqualsExcludingChain(identity_cert.get())) {
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move(identity),
base::BindRepeating(&GotPrivateKey, delegate, std::move(cert)));
std::move(identity), base::BindRepeating(&GotPrivateKey, delegate,
std::move(identity_cert)));
break;
}
}
Expand Down