From 5adbbedaa38b2853d751f2e4dbf43521296447f6 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 16 May 2016 21:20:29 +0100 Subject: [PATCH] Replaced CERT_CONTEXT with PCCERT_CONTEXT for the frmMain::UpdateSSLAccountStatus function. --- source/frmMain.cpp | 8 +++++++- source/frmMain.h | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/frmMain.cpp b/source/frmMain.cpp index 9685929..026b9e9 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -2664,10 +2664,16 @@ void frmMain::ResumeAllTimers(){ #elif defined(__WIN32__) -void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, CERT_CONTEXT CertificateContext){ +void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, PCCERT_CONTEXT CertificateContext){ // Delete existing data. + std::map::iterator CertificateIter = AccountCertificateData.find(AccountID); + + if (CertificateIter != AccountCertificateData.end()){ + CertFreeCertificateContext(CertificateIter->second); + } + AccountCertificateData.erase(AccountID); AccountSSLResult.erase(AccountID); diff --git a/source/frmMain.h b/source/frmMain.h index 1c9cddc..8a5ac21 100644 --- a/source/frmMain.h +++ b/source/frmMain.h @@ -130,7 +130,7 @@ class frmMain : public frmMainADT #if defined(__APPLE__) std::map AccountTrustData; #elif defined(__WIN32__) - std::map AccountCertificateData; + std::map AccountCertificateData; #else std::map AccountSSLData; #endif @@ -279,7 +279,7 @@ class frmMain : public frmMainADT #if defined(__APPLE__) void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SecTrustRef SecurityTrustObject); #elif defined(__WIN32__) - void UpdateSSLAccountStatus(int AccountID, int SSLStatus, CERT_CONTEXT CertificateContext); + void UpdateSSLAccountStatus(int AccountID, int SSLStatus, PCCERT_CONTEXT CertificateContext); #else void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollection SSLCertInc); #endif -- 2.39.5