SECURITY_STATUS SecurityStatus = SEC_E_OK;
static DWORD cbMaxToken = 0;
-static PVOID pClientBuf = NULL;
-static PVOID pServerBuf = NULL;
+static uint8_t * pClientBuf = NULL;
+static uint8_t * pServerBuf = NULL;
static AUTH_SEQ NTLM_asServer = {0};
_FreeContextBuffer(pSPI);
/* Allocate buffers for client and server messages */
- pClientBuf = xcalloc(cbMaxToken, sizeof(char));
- pServerBuf = xcalloc(cbMaxToken, sizeof(char));
+ pClientBuf = static_cast<uint8_t *>(xcalloc(cbMaxToken, sizeof(char)));
+ pServerBuf = static_cast<uint8_t *>(xcalloc(cbMaxToken, sizeof(char)));
SSP_Package_InUse = xstrdup(SSP_Package);
return hModule;
const char * WINAPI SSP_MakeChallenge(PVOID PNegotiateBuf, int NegotiateLen)
{
BOOL fDone = FALSE;
- PVOID fResult = NULL;
+ uint8_t * fResult = NULL;
DWORD cbOut = 0;
DWORD cbIn = 0;
ntlm_challenge * challenge;
NTLM_LocalCall = NTLM_NEGOTIATE_THIS_IS_LOCAL_CALL & challenge->flags;
struct base64_encode_ctx ctx;
base64_encode_init(&ctx);
- static uint8_t encoded[8192];
- size_t dstLen = base64_encode_update(&ctx, encoded, cbOut, reinterpret_cast<const uint8_t*>(fResult));
+ static char encoded[8192];
+ size_t dstLen = base64_encode_update(&ctx, encoded, cbOut, fResult);
assert(dstLen < sizeof(encoded));
dstLen += base64_encode_final(&ctx, encoded+dstLen);
assert(dstLen < sizeof(encoded));
if (pServerBuf != NULL && cbOut > 0) {
struct base64_encode_ctx ctx;
base64_encode_init(&ctx);
- static uint8_t encoded[8192];
- size_t dstLen = base64_encode_update(&ctx, encoded, cbOut, reinterpret_cast<const uint8_t*>(pServerBuf));
+ static char encoded[8192];
+ size_t dstLen = base64_encode_update(&ctx, encoded, cbOut, pServerBuf);
assert(dstLen < sizeof(encoded));
dstLen += base64_encode_final(&ctx, encoded+dstLen);
assert(dstLen < sizeof(encoded));
if (pServerBuf != NULL && cbOut > 0) {
struct base64_encode_ctx ctx;
base64_encode_init(&ctx);
- static uint8_t encoded[8192];
- size_t dstLen = base64_encode_update(&ctx, encoded, cbOut, reinterpret_cast<const uint8_t*>(pServerBuf));
+ static char encoded[8192];
+ size_t dstLen = base64_encode_update(&ctx, encoded, cbOut, pServerBuf);
assert(dstLen < sizeof(encoded));
dstLen += base64_encode_final(&ctx, encoded+dstLen);
assert(dstLen < sizeof(encoded));
File::open(const FileOpeningConfig &cfg)
{
#if _SQUID_WINDOWS_
- fd_ = CreateFile(TEXT(name_.c_str()), desiredAccess, shareMode, nullptr, creationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr);
+ fd_ = CreateFile(TEXT(name_.c_str()), cfg.desiredAccess, cfg.shareMode, nullptr, cfg.creationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr);
if (fd_ == InvalidHandle) {
const auto savedError = GetLastError();
throw TexcHere(sysCallFailure("CreateFile", WindowsErrorMessage(savedError).c_str()));
#if _SQUID_WINDOWS_
if (!CloseHandle(fd_)) {
const auto savedError = GetLastError();
- debugs(54, DBG_IMPORTANT, sysCallFailure("CloseHandle", WindowsErrorMessage(savedError)));
+ debugs(54, DBG_IMPORTANT, sysCallFailure("CloseHandle", WindowsErrorMessage(savedError).c_str()));
}
#else
if (::close(fd_) != 0) {
return sysCallFailure(callName, xstrerr(savedErrno));
}
+#if _SQUID_WINDOWS_
+const HANDLE File::InvalidHandle = INVALID_HANDLE_VALUE;
+#endif /* _SQUID_WINDOWS_ */