From 19b47ed6118d26f2e4fc91cf10df577c3b90b996 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Fri, 13 Oct 2023 13:56:41 +0100 Subject: [PATCH] Further clean up Signed-off-by: Gavin Halliday --- system/security/securesocket/securesocket.cpp | 21 +++++++------------ system/security/securesocket/securesocket.hpp | 5 ++--- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/system/security/securesocket/securesocket.cpp b/system/security/securesocket/securesocket.cpp index 16f0c1506c2..9f445e0cc5e 100644 --- a/system/security/securesocket/securesocket.cpp +++ b/system/security/securesocket/securesocket.cpp @@ -1353,13 +1353,6 @@ class CSecureSocketContext : public CInterfaceOf } public: - CSecureSocketContext(SecureSocketType sockettype) - { - initContext(sockettype); - - SSL_CTX_set_mode(m_ctx, SSL_CTX_get_mode(m_ctx) | SSL_MODE_AUTO_RETRY); - } - CSecureSocketContext(const IPropertyTree* config, SecureSocketType sockettype) { initContext(sockettype); @@ -1946,7 +1939,7 @@ extern "C" { SECURESOCKET_API ISecureSocketContext* createSecureSocketContext(SecureSocketType sockettype) { - return new securesocket::CSecureSocketContext(sockettype); + return new securesocket::CSecureSocketContext(nullptr, sockettype); } SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSynced(const ISyncedPropertyTree * config, SecureSocketType sockettype) @@ -1991,12 +1984,6 @@ IPropertyTree * createSecureSocketConfig(const char* certFileOrBuf, const char* return config.getClear(); } -//Legacy factory interfaces -SECURESOCKET_API ISecureSocketContext* createSecureSocketContextEx2(const IPropertyTree* config, SecureSocketType sockettype) -{ - return new securesocket::CSecureSocketContext(config, sockettype); -} - SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSSF(ISmartSocketFactory* ssf) { if (ssf == nullptr || !ssf->queryTlsConfig()) @@ -2005,6 +1992,12 @@ SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSSF(ISmartSocket return createSecureSocketContextSynced(ssf->queryTlsConfig(), ClientSocket); } +//Legacy factory interfaces +SECURESOCKET_API ISecureSocketContext* createSecureSocketContextEx2(const IPropertyTree* config, SecureSocketType sockettype) +{ + return new securesocket::CSecureSocketContext(config, sockettype); +} + SECURESOCKET_API ICertificate *createCertificate() { return new securesocket::CRsaCertificate(); diff --git a/system/security/securesocket/securesocket.hpp b/system/security/securesocket/securesocket.hpp index de4558d24b7..e5a1b643c6c 100644 --- a/system/security/securesocket/securesocket.hpp +++ b/system/security/securesocket/securesocket.hpp @@ -91,15 +91,14 @@ extern "C" { SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSynced(const ISyncedPropertyTree * config, SecureSocketType sockettype); // Will become the primary (only) factory method SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSecret(const char *mtlsSecretName, SecureSocketType); SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSecretSrv(const char *mtlsSecretName, bool requireMtlsConfig); +SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSSF(ISmartSocketFactory* ssf); -//Helper function to aid migration to the functions above +//Helper function to aid migration to the functions above. This should eventually be removed. IPropertyTree * createSecureSocketConfig(const char* certFileOrBuf, const char* privKeyFileOrBuf, const char* passphrase); //Legacy factory methods - should be phased out. SECURESOCKET_API ISecureSocketContext* createSecureSocketContext(SecureSocketType); -SECURESOCKET_API ISecureSocketContext* createSecureSocketContextEx(const char* certFileOrBuf, const char* privKeyFileOrBuf, const char* passphrase, SecureSocketType); SECURESOCKET_API ISecureSocketContext* createSecureSocketContextEx2(const IPropertyTree* config, SecureSocketType); -SECURESOCKET_API ISecureSocketContext* createSecureSocketContextSSF(ISmartSocketFactory* ssf); SECURESOCKET_API ICertificate *createCertificate(); SECURESOCKET_API int signCertificate(const char* csr, const char* ca_certificate, const char* ca_privkey, const char* ca_passphrase, int days, StringBuffer& certificate); };