Commit 3ae52bd2 authored by Oleg Korshul's avatar Oleg Korshul

.

parent 227d4f18
......@@ -8,6 +8,7 @@
#define OOXML_HASH_ALG_SHA1 0
#define OOXML_HASH_ALG_INVALID 1
class ICertificate;
class Q_DECL_EXPORT ICertificateSelectDialogOpenSsl
{
public:
......@@ -26,7 +27,7 @@ public:
virtual std::wstring GetKeyPassword() = 0;
virtual bool ShowSelectDialog() = 0;
virtual int ShowCertificate() = 0;
virtual int ShowCertificate(ICertificate* pCert) = 0;
};
class Q_DECL_EXPORT CCertificateInfo
......
......@@ -281,14 +281,41 @@ public:
public:
virtual bool ShowSelectDialog()
{
if (m_pDialog)
return m_pDialog->ShowSelectDialog();
return false;
if (!m_pDialog)
return false;
bool bResult = m_pDialog->ShowSelectDialog();
std::wstring sKeyPath = m_pDialog->GetKeyPath();
std::wstring sKeyPasswordW = m_pDialog->GetKeyPassword();
std::string sKeyPassword = U_TO_UTF8(sKeyPasswordW);
std::wstring sCertPath = m_pDialog->GetCertificatePath();
std::wstring sCertPasswordW = m_pDialog->GetCertificatePassword();
std::string sCertPassword = U_TO_UTF8(sCertPasswordW);
if (sCertPath.empty())
{
sCertPath = sKeyPath;
sCertPassword = sKeyPassword;
}
int nErr = LoadKey(sKeyPath, sKeyPassword, &m_key);
if (nErr != OPEN_SSL_WARNING_OK && nErr != OPEN_SSL_WARNING_ALL_OK)
return false;
nErr = LoadCert(sCertPath, sCertPassword, &m_cert);
if (nErr != OPEN_SSL_WARNING_OK && nErr != OPEN_SSL_WARNING_ALL_OK)
return false;
return true;
}
virtual int ShowCertificate()
{
if (m_pDialog)
return m_pDialog->ShowCertificate();
return m_pDialog->ShowCertificate(this);
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment