Fix compilation of atom/browser/api/atom_api_app.cc
Refactor client cert private key handling. https://codereview.chromium.org/2898573002
This commit is contained in:
parent
8c40854983
commit
1073c9b1ed
1 changed files with 12 additions and 6 deletions
|
@ -425,14 +425,14 @@ void OnClientCertificateSelected(
|
||||||
std::shared_ptr<content::ClientCertificateDelegate> delegate,
|
std::shared_ptr<content::ClientCertificateDelegate> delegate,
|
||||||
mate::Arguments* args) {
|
mate::Arguments* args) {
|
||||||
if (args->Length() == 2) {
|
if (args->Length() == 2) {
|
||||||
delegate->ContinueWithCertificate(nullptr);
|
delegate->ContinueWithCertificate(nullptr, nullptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::Local<v8::Value> val;
|
v8::Local<v8::Value> val;
|
||||||
args->GetNext(&val);
|
args->GetNext(&val);
|
||||||
if (val->IsNull()) {
|
if (val->IsNull()) {
|
||||||
delegate->ContinueWithCertificate(nullptr);
|
delegate->ContinueWithCertificate(nullptr, nullptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,8 +448,11 @@ void OnClientCertificateSelected(
|
||||||
|
|
||||||
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
|
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
|
||||||
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
|
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
|
||||||
if (!certs.empty())
|
if (!certs.empty()) {
|
||||||
delegate->ContinueWithCertificate(certs[0].get());
|
scoped_refptr<net::X509Certificate> cert(certs[0].get());
|
||||||
|
// FIXME: Pass private key as a second argument.
|
||||||
|
delegate->ContinueWithCertificate(cert, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
|
void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
|
||||||
|
@ -720,8 +723,11 @@ void App::SelectClientCertificate(
|
||||||
shared_delegate));
|
shared_delegate));
|
||||||
|
|
||||||
// Default to first certificate from the platform store.
|
// Default to first certificate from the platform store.
|
||||||
if (!prevent_default)
|
if (!prevent_default) {
|
||||||
shared_delegate->ContinueWithCertificate(client_certs[0].get());
|
scoped_refptr<net::X509Certificate> cert = identities[0]->certificate();
|
||||||
|
// FIXME: Pass private key as a second argument.
|
||||||
|
shared_delegate->ContinueWithCertificate(cert, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
|
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
|
||||||
|
|
Loading…
Reference in a new issue