Missing credential storage added
This commit is contained in:
parent
7b3ecda484
commit
3267b7f53d
@ -137,11 +137,13 @@ protected:
|
||||
virtual void OnInitDialog(wxInitDialogEvent& event);
|
||||
/// \endcond
|
||||
|
||||
public:
|
||||
wxTLSCredentialsPanel *m_outer_cred; ///< Outer credentials panel
|
||||
wxPanel *m_inner_cred; ///< Inner credentials panel
|
||||
|
||||
protected:
|
||||
const eap::config_provider &m_prov; ///< EAP provider
|
||||
const eap::config_method_ttls &m_cfg; ///< TTLS configuration
|
||||
wxStaticText *m_outer_title; ///< Outer authentication title
|
||||
wxTLSCredentialsPanel *m_outer_cred; ///< Outer credentials panel
|
||||
wxStaticText *m_inner_title; ///< Inner authentication title
|
||||
wxPanel *m_inner_cred; ///< Inner credentials panel
|
||||
};
|
||||
|
@ -196,6 +196,29 @@ void eap::peer_ttls_ui::invoke_identity_ui(
|
||||
dlg.AddContents((wxPanel**)&panel, 1);
|
||||
dlg.Centre(wxBOTH);
|
||||
result = dlg.ShowModal();
|
||||
if (result == wxID_OK) {
|
||||
// Write credentials to credential manager.
|
||||
if (panel->m_outer_cred->GetRememberValue()) {
|
||||
try {
|
||||
cred_out.credentials_tls::store(cfg_prov.m_id.c_str());
|
||||
} catch (winstd::win_runtime_error &err) {
|
||||
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
||||
} catch (...) {
|
||||
wxLogError(_("Writing credentials failed."));
|
||||
}
|
||||
}
|
||||
|
||||
wxPAPCredentialsPanel *panel_inner_cred_pap = dynamic_cast<wxPAPCredentialsPanel*>(panel->m_inner_cred);
|
||||
if (panel_inner_cred_pap && panel_inner_cred_pap->GetRememberValue()) {
|
||||
try {
|
||||
cred_out.m_inner->store(cfg_prov.m_id.c_str());
|
||||
} catch (winstd::win_runtime_error &err) {
|
||||
wxLogError(winstd::tstring_printf(_("Error writing credentials to Credential Manager: %hs (error %u)"), err.what(), err.number()).c_str());
|
||||
} catch (...) {
|
||||
wxLogError(_("Writing credentials failed."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxTopLevelWindows.DeleteObject(&parent);
|
||||
parent.SetHWND((WXHWND)NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user