From: Steve Brokenshire Date: Mon, 16 May 2016 20:33:36 +0000 (+0100) Subject: Win32 Support: Added support for displaying the certificate information using the... X-Git-Tag: release-0.13~20 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=57d545b714d1d77e805af3749915c49338fea522;p=xestiaab%2F.git Win32 Support: Added support for displaying the certificate information using the OS provided certificate information dialog. --- diff --git a/source/frmMain.cpp b/source/frmMain.cpp index 026b9e9..fad8469 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -2531,7 +2531,63 @@ void frmMain::ShowSSLCertificates( wxCommandEvent &event ){ AccType.clear(); } - + +#elif defined(__WIN32__) + + std::map::iterator SSLCertificateIter; + + for (int i = 0; i < prefaccounts.GetCount(); i++){ + + SeekAccount.Append(prefaccounts.GetAccountDirectory(i)); + AccType.Append(prefaccounts.GetAccountType(i)); + AccountSSL = prefaccounts.GetAccountSSL(i); + AccTypeLower = AccType.MakeLower(); + SeekAccount.Append(wxT(".")); + SeekAccount.Append(AccTypeLower); + + if (SeekAccount == ActiveAccount){ + + if (AccTypeLower == wxT("local")){ + + return; + + } + + if (AccountSSL == false){ + + return; + + } + + SSLCertificateIter = AccountCertificateData.find(i); + + // Setup and display the form. + + if (SSLCertificateIter->second->pCertInfo == NULL){ + + wxMessageBox("No certificate information is available due to invalid connection details, connection being in progress or invalid certificate data received."); + + } else { + + BOOL ModifiedCertificateData; + CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(SSLCertificateIter->second, (HWND)this->GetHandle()); + + if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)){ + wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog")); + } + + } + + //DisplayCertificate(SSLTrustIter->second); + + } + + SeekAccount.Clear(); + AccTypeLower.Clear(); + AccType.clear(); + + } + #else std::map::iterator SSLColIter;