Skip to content

Commit

Permalink
force null expiration in InitializeSecurityContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Moreau committed Dec 19, 2024
1 parent 667d377 commit ffbd28b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dll/Sspi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,31 @@ static SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(
}
}

ptsExpiry = NULL; // force passing null expiration

status = Real_InitializeSecurityContextW(
phCredential, phContext, pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput,
Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry);

MsRdpEx_LogPrint(DEBUG, "sspi_InitializeSecurityContextW(pszTargetName: %s fContextReq: 0x%08X phCredential=%p,%p), status: 0x%08X",
pszTargetNameA ? pszTargetNameA : "", fContextReq, (void*)phCredential->dwLower, (void*)phCredential->dwUpper, status);

if (ptsExpiry) {
FILETIME fileTime;
SYSTEMTIME systemTime;
fileTime.dwLowDateTime = ptsExpiry->LowPart;
fileTime.dwHighDateTime = ptsExpiry->HighPart;

MsRdpEx_LogPrint(DEBUG, "ptsExpiry: lo: 0x%08X hi: 0x%08X",
ptsExpiry->LowPart, ptsExpiry->HighPart);

if (FileTimeToSystemTime(&fileTime, &systemTime)) {
MsRdpEx_LogPrint(DEBUG, "ptsExpiry: %04d-%02d-%02d %02d:%02d:%02d",
systemTime.wYear, systemTime.wMonth, systemTime.wDay,
systemTime.wHour, systemTime.wMinute, systemTime.wSecond);
}
}

if (pOutput) {
for (iBuffer = 0; iBuffer < pOutput->cBuffers; iBuffer++) {
pSecBuffer = &pOutput->pBuffers[iBuffer];
Expand Down

0 comments on commit ffbd28b

Please sign in to comment.