Issue with TLS credentials panel resetting PAP credentials in TTLS fixed

This commit is contained in:
Simon Rozman 2016-08-15 14:04:50 +02:00
parent e807336e7b
commit 217c3dd090
3 changed files with 9 additions and 8 deletions

View File

@ -486,11 +486,11 @@ protected:
/// \endcond
protected:
const eap::config_provider &m_prov; ///< Provider configuration
const eap::config_provider &m_prov; ///< Provider configuration
const eap::config_method_with_cred &m_cfg; ///< Method configuration
_Tcred &m_cred; ///< Credentials
winstd::tstring m_target; ///< Credential Manager target
bool m_is_config; ///< Is this a configuration dialog?
_Tcred &m_cred; ///< Credentials
winstd::tstring m_target; ///< Credential Manager target
bool m_is_config; ///< Is this a configuration dialog?
};

View File

@ -365,13 +365,13 @@ bool wxTLSCredentialsPanel::TransferDataToWindow()
bool wxTLSCredentialsPanel::TransferDataFromWindow()
{
if (m_cert_none->GetValue())
m_cred.clear();
m_cred.m_cert.free();
else {
const wxCertificateClientData *data = dynamic_cast<const wxCertificateClientData*>(m_cert_select_val->GetClientObject(m_cert_select_val->GetSelection()));
if (data)
m_cred.m_cert.attach_duplicated(data->m_cert);
else
m_cred.clear();
m_cred.m_cert.free();
}
// Inherited TransferDataFromWindow() calls m_cred.store().

View File

@ -227,8 +227,9 @@ wxTTLSCredentialsPanel::wxTTLSCredentialsPanel(const eap::config_provider &prov,
assert(m_cfg.m_inner);
const eap::config_method_pap *cfg_inner_pap = dynamic_cast<const eap::config_method_pap*>(m_cfg.m_inner.get());
if (cfg_inner_pap) {
if (!((eap::credentials_ttls&)cred).m_inner) ((eap::credentials_ttls&)cred).m_inner.reset(new eap::credentials_pap(cred.m_module));
m_inner_cred = new wxPAPCredentialsPanel(m_prov, *cfg_inner_pap, *(eap::credentials_pap*)((eap::credentials_ttls&)cred).m_inner.get(), pszCredTarget, this, is_config);
eap::credentials_ttls &cred_ttls = (eap::credentials_ttls&)cred;
if (!cred_ttls.m_inner) cred_ttls.m_inner.reset(new eap::credentials_pap(cred.m_module));
m_inner_cred = new wxPAPCredentialsPanel(m_prov, *cfg_inner_pap, *(eap::credentials_pap*)cred_ttls.m_inner.get(), pszCredTarget, this, is_config);
sb_content->Add(m_inner_cred, 0, wxALL|wxEXPAND, 5);
} else
assert(0); // Unsupported inner authentication method type.