Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EasySFTP/Func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C" int __stdcall MyMessageBoxW(HWND hWnd, LPCWSTR lpszText, LPCWSTR lpsz
lpszText = strText;
}
if (lpszCaption == NULL)
lpszCaption = (LPCWSTR) IDS_APP_TITLE;
lpszCaption = MAKEINTRESOURCEW(IDS_APP_TITLE);
if (HIWORD(lpszCaption) == 0 && lpszCaption != NULL)
{
strCaption.LoadString((UINT) LOWORD(lpszCaption));
Expand Down
24 changes: 12 additions & 12 deletions ShellDLL/Auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ bool CAuthentication::AssignAgentFlags(CAuthSession* pAuthSession)
if (pAuthSession->nPrevFlags == 0)
return false;
// get key type data (in the head of blob data)
DWORD dwKeyTypeLen = ConvertEndian(*((DWORD*)(pAuthSession->lpCurrentKey + 4)));
LPCSTR lpszKeyType = (LPCSTR)(pAuthSession->lpCurrentKey + 8);
DWORD dwKeyTypeLen = ConvertEndian(*reinterpret_cast<DWORD*>(pAuthSession->lpCurrentKey + 4));
LPCSTR lpszKeyType = reinterpret_cast<LPCSTR>(pAuthSession->lpCurrentKey + 8);

if ((dwKeyTypeLen == 7 && memcmp(lpszKeyType, "ssh-rsa", dwKeyTypeLen) == 0) ||
(dwKeyTypeLen == 28 && memcmp(lpszKeyType, "ssh-rsa-cert-v01@openssh.com", dwKeyTypeLen) == 0))
Expand Down Expand Up @@ -431,7 +431,7 @@ AuthReturnType CAuthentication::SSHAuthenticateWithAgent(IEasySFTPAuthentication
pAuthSession->dwSignature = AUTH_SESSION_SIGNATURE;
pAuthSession->pAgent = pAgent;
pAuthSession->lpPageantKeyList = lpKeyList;
pAuthSession->dwKeyCount = ConvertEndian(*((DWORD*)lpKeyList));
pAuthSession->dwKeyCount = ConvertEndian(*reinterpret_cast<DWORD*>(lpKeyList));
pAuthSession->dwKeyIndex = 0;
pAuthSession->lpCurrentKey = lpKeyList + 4;
pAuthSession->nPrevFlags = -1;
Expand All @@ -447,18 +447,18 @@ AuthReturnType CAuthentication::SSHAuthenticateWithAgent(IEasySFTPAuthentication
LPCBYTE pBlob;
size_t nBlobLen;

nBlobLen = (size_t)ConvertEndian(*((DWORD*)p));
nBlobLen = static_cast<size_t>(ConvertEndian(*reinterpret_cast<DWORD*>(p)));
pBlob = (p + 4);
p += nBlobLen + 4;

{
DWORD dwKeyTypeLen = ConvertEndian(*((DWORD*)(pBlob)));
LPCSTR lpszKeyType = (LPCSTR)(pBlob + 4);
DWORD dwKeyTypeLen = ConvertEndian(*reinterpret_cast<const DWORD*>(pBlob));
LPCSTR lpszKeyType = reinterpret_cast<LPCSTR>(pBlob + 4);

// get the comment of key
DWORD dwCommentLen = ConvertEndian(*((DWORD*)p));
CMyStringW str;
str.SetUTF8String((LPCBYTE)(p + 4), static_cast<size_t>(dwCommentLen));
DWORD dwCommentLen = ConvertEndian(*reinterpret_cast<DWORD*>(p));
CMyStringW str;
str.SetUTF8String(reinterpret_cast<LPCBYTE>(p + 4), static_cast<size_t>(dwCommentLen));
p += dwCommentLen + 4;
CMyStringW strType, strDebug;
strType.SetString(lpszKeyType, dwKeyTypeLen);
Expand All @@ -485,7 +485,7 @@ AuthReturnType CAuthentication::SSHAuthenticateWithAgent(IEasySFTPAuthentication
return LIBSSH2_ERROR_AGENT_PROTOCOL;
}
// skip signature length
auto entireLen = ConvertEndian(*((DWORD*)pSignedData));
auto entireLen = ConvertEndian(*reinterpret_cast<DWORD*>(pSignedData));
pSignedData += 4;
nSignedLen -= 4;
// skip signing method
Expand All @@ -494,7 +494,7 @@ AuthReturnType CAuthentication::SSHAuthenticateWithAgent(IEasySFTPAuthentication
free(buff);
return LIBSSH2_ERROR_AGENT_PROTOCOL;
}
auto methodLen = ConvertEndian(*((DWORD*)pSignedData));
auto methodLen = ConvertEndian(*reinterpret_cast<DWORD*>(pSignedData));
pSignedData += 4;
nSignedLen -= 4;
if (nSignedLen < methodLen)
Expand All @@ -511,7 +511,7 @@ AuthReturnType CAuthentication::SSHAuthenticateWithAgent(IEasySFTPAuthentication
free(buff);
return LIBSSH2_ERROR_AGENT_PROTOCOL;
}
auto signatureLen = ConvertEndian(*((DWORD*)pSignedData));
auto signatureLen = ConvertEndian(*reinterpret_cast<DWORD*>(pSignedData));
pSignedData += 4;
nSignedLen -= 4;
if (nSignedLen < signatureLen)
Expand Down
2 changes: 1 addition & 1 deletion ShellDLL/Func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern "C" int __stdcall MyMessageBoxW(HWND hWnd, LPCWSTR lpszText, LPCWSTR lpsz
lpszText = strText;
}
if (lpszCaption == NULL)
lpszCaption = (LPCWSTR) IDS_APP_TITLE;
lpszCaption = MAKEINTRESOURCEW(IDS_APP_TITLE);
if (HIWORD(lpszCaption) == 0 && lpszCaption != NULL)
{
strCaption.LoadString((UINT) LOWORD(lpszCaption));
Expand Down