Skip to content

Commit

Permalink
update to openssl 3.3.0 + adaptions for ssl session handling (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
chcg committed Apr 28, 2024
1 parent a9d77fa commit 89242f4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -142,9 +142,9 @@ if (MINGW)
#remove the lib from the generated target lib
SET(CMAKE_SHARED_LIBRARY_PREFIX "")

target_link_libraries (NppFTP comctl32 shlwapi ssh ssl crypto z ws2_32 iphlpapi)
target_link_libraries (NppFTP comctl32 shlwapi ssh ssl crypto crypt32 z ws2_32 iphlpapi)
else (MINGW)
target_link_libraries (NppFTP comctl32 shlwapi ssh libssl libcrypto zlib ws2_32 iphlpapi)
target_link_libraries (NppFTP comctl32 shlwapi ssh libssl libcrypto crypt32 zlib ws2_32 iphlpapi)
endif (MINGW)

# build a CPack driven zip package
Expand Down
2 changes: 1 addition & 1 deletion Makefile.mingw
Expand Up @@ -10,7 +10,7 @@ endif

CXX = $(PREFIX)-g++
CFLAGS = -MMD -Os -O3 -Wall -pedantic -Wformat=2 -Wno-deprecated-declarations -Wno-unused-value -Werror -fexpensive-optimizations -DLIBSSH_STATIC -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE
LFLAGS = -static -L$(OUTDIR)/obj -L$(OUTDIR)/3rdparty/lib -lcomdlg32 -lcomctl32 -luuid -lole32 -lshlwapi -lssh -lssl -lcrypto -lz -lgdi32 -lws2_32 -liphlpapi
LFLAGS = -static -L$(OUTDIR)/obj -L$(OUTDIR)/3rdparty/lib -lcomdlg32 -lcomctl32 -luuid -lole32 -lshlwapi -lssh -lssl -lcrypto -lcrypt32 -lz -lgdi32 -lws2_32 -liphlpapi
INC = -I$(OUTDIR)/3rdparty/include -Isrc -Isrc/Windows -Itinyxml/include -IUTCP/include -I.
RES = $(OUTDIR)/obj/NppFTP.res

Expand Down
6 changes: 6 additions & 0 deletions UTCP/src/ftp_c.cpp
Expand Up @@ -693,6 +693,8 @@ int CUT_FTPClient::ResumeReceiveFilePASV(CUT_DataSource & dest, LPCSTR sourceFil
if (rt == UTE_SUCCESS)
{

m_wsData.SSLSetReuseSession(SSLGetCurrentSession());

// if the file exist then we will send the REST command with the size of the file we have
// otherwise we just call retrieve as we do normally
_snprintf(m_szBuf,sizeof(m_szBuf)-1,"REST %ld\r\n",dest.Seek (0,SEEK_END));
Expand All @@ -708,6 +710,8 @@ int CUT_FTPClient::ResumeReceiveFilePASV(CUT_DataSource & dest, LPCSTR sourceFil
fileType = UTM_OM_APPEND ; // appending
}

m_wsData.SSLSetReuseSession(SSLGetCurrentSession());

//send the RETR command
_snprintf(m_szBuf,sizeof(m_szBuf)-1,"RETR %s\r\n",sourceFile);
Send(m_szBuf);
Expand Down Expand Up @@ -1125,6 +1129,8 @@ int CUT_FTPClient::SendFilePASV(CUT_DataSource & source, LPCSTR destFile) {
return OnError(UTE_ABORTED);
}

m_wsData.SSLSetReuseSession(SSLGetCurrentSession());

//send the store command
_snprintf(m_szBuf,sizeof(m_szBuf)-1,"STOR %s\r\n",destFile);
Send(m_szBuf);
Expand Down
4 changes: 2 additions & 2 deletions build_3rdparty.py
Expand Up @@ -5,8 +5,8 @@
DEPENDENT_LIBS = {
'openssl': {
'order' : 1,
'url' : 'https://www.openssl.org/source/openssl-3.1.5.tar.gz',
'sha1' : 'bae9e00477fb036e28f1c2e9a837fb6992823c57',
'url' : 'https://www.openssl.org/source/openssl-3.3.0.tar.gz',
'sha1' : '34cdf3259fd2af83ab2c92ac30c56f79ff5ad59e',
'target': {
'mingw-w64': {
'result': ['include/openssl/ssl.h', 'lib/libssl.a', 'lib/libcrypto.a'],
Expand Down

0 comments on commit 89242f4

Please sign in to comment.