mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-14 15:05:35 +02:00
fixed a crash on WinCE; code cleanup
This commit is contained in:
@@ -27,6 +27,13 @@
|
||||
#include "Poco/Net/InvalidCertificateHandler.h"
|
||||
#include "Poco/BasicEvent.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include <wincrypt.h>
|
||||
#include <schannel.h>
|
||||
#ifndef SECURITY_WIN32
|
||||
#define SECURITY_WIN32
|
||||
#endif
|
||||
#include <security.h>
|
||||
#include <sspi.h>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -184,6 +191,9 @@ public:
|
||||
static const std::string CFG_SERVER_PREFIX;
|
||||
static const std::string CFG_CLIENT_PREFIX;
|
||||
|
||||
protected:
|
||||
SecurityFunctionTableW& securityFunctions();
|
||||
|
||||
private:
|
||||
SSLManager();
|
||||
/// Creates the SSLManager.
|
||||
@@ -200,6 +210,15 @@ private:
|
||||
void initCertificateHandler(bool server);
|
||||
/// Inits the certificate handler.
|
||||
|
||||
void loadSecurityLibrary();
|
||||
/// Loads the Windows security DLL.
|
||||
|
||||
void unloadSecurityLibrary();
|
||||
/// Unloads the Windows security DLL.
|
||||
|
||||
HMODULE _hSecurityModule;
|
||||
SecurityFunctionTableW _securityFunctions;
|
||||
|
||||
CertificateHandlerFactoryMgr _certHandlerFactoryMgr;
|
||||
Context::Ptr _ptrDefaultServerContext;
|
||||
InvalidCertificateHandlerPtr _ptrServerCertificateHandler;
|
||||
@@ -232,6 +251,7 @@ private:
|
||||
static const std::string CFG_REQUIRE_TLSV1_2;
|
||||
|
||||
friend class Poco::SingletonHolder<SSLManager>;
|
||||
friend class SecureSocketImpl;
|
||||
};
|
||||
|
||||
|
||||
@@ -244,6 +264,12 @@ inline CertificateHandlerFactoryMgr& SSLManager::certificateHandlerFactoryMgr()
|
||||
}
|
||||
|
||||
|
||||
inline SecurityFunctionTableW& SSLManager::securityFunctions()
|
||||
{
|
||||
return _securityFunctions;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user