12#define NEGOSSP_NAME_W L"Negotiate"
27namespace openmsx::sspiutils {
29const unsigned STREAM_ERROR = 0xffffffff;
34 virtual uint32_t Read (
void* buffer, uint32_t cb) = 0;
35 virtual uint32_t Write(
void* buffer, uint32_t cb) = 0;
44 StreamWrapper& stream;
45 const unsigned int cbMaxTokenSize;
47 SspiPackageBase(StreamWrapper& stream,
const SEC_WCHAR* securityPackage);
52const DWORD ACCESS_READ = 0x1;
53const DWORD ACCESS_WRITE = 0x2;
54const DWORD ACCESS_EXECUTE = 0x4;
55const DWORD ACCESS_ALL = ACCESS_READ | ACCESS_WRITE | ACCESS_EXECUTE;
57const GENERIC_MAPPING mapping = {
58 ACCESS_READ, ACCESS_WRITE, ACCESS_EXECUTE, ACCESS_ALL
60void InitTokenContextBuffer(PSecBufferDesc pSecBufferDesc, PSecBuffer pSecBuffer);
61void ClearContextBuffers(PSecBufferDesc pSecBufferDesc);
62void DebugPrintSecurityStatus(
const char* context, SECURITY_STATUS ss);
63void DebugPrintSecurityBool(
const char* context, BOOL ret);
64void DebugPrintSecurityPackageName(PCtxtHandle phContext);
65void DebugPrintSecurityPrincipalName(PCtxtHandle phContext);
66void DebugPrintSecurityDescriptor(PSECURITY_DESCRIPTOR psd);
67PSECURITY_DESCRIPTOR CreateCurrentUserSecurityDescriptor();
68unsigned long GetPackageMaxTokenSize(
const SEC_WCHAR* package);
70bool SendChunk(StreamWrapper& stream,
void* buffer, uint32_t cb);
71bool RecvChunk(StreamWrapper& stream, std::vector<char>& buffer, uint32_t cbMaxSize);