35 TRACE(
"%p %p %p\n", phSec, package, realHandle);
37 if (phSec && package && realHandle)
43 *newSec = *realHandle;
67 debugstr_a(pszPackage), fCredentialsUse, pvLogonID, pAuthData, pGetKeyFn,
68 pvGetKeyArgument, phCredential, ptsExpiry);
73 if (package && package->provider)
75 if (package->provider->fnTableA.AcquireCredentialsHandleA)
79 ret = package->provider->fnTableA.AcquireCredentialsHandleA(
80 pszPrincipal, pszPackage, fCredentialsUse, pvLogonID,
81 pAuthData, pGetKeyFn, pvGetKeyArgument, &myCred,
87 package->provider->fnTableW.FreeCredentialsHandle(
113 debugstr_w(pszPackage), fCredentialsUse, pvLogonID, pAuthData, pGetKeyFn,
114 pvGetKeyArgument, phCredential, ptsExpiry);
119 if (package && package->provider)
121 if (package->provider->fnTableW.AcquireCredentialsHandleW)
125 ret = package->provider->fnTableW.AcquireCredentialsHandleW(
126 pszPrincipal, pszPackage, fCredentialsUse, pvLogonID,
127 pAuthData, pGetKeyFn, pvGetKeyArgument, &myCred,
133 package->provider->fnTableW.FreeCredentialsHandle(
156 TRACE(
"%p\n", phCredential);
159 SecurePackage *
package = (SecurePackage *)phCredential->dwUpper;
162 if (package && package->provider &&
163 package->provider->fnTableW.FreeCredentialsHandle)
164 ret = package->provider->fnTableW.FreeCredentialsHandle(cred);
182 TRACE(
"%p %d %p\n", phCredential, ulAttribute,
pBuffer);
185 SecurePackage *
package = (SecurePackage *)phCredential->dwUpper;
188 if (package && package->provider)
190 if (package->provider->fnTableA.QueryCredentialsAttributesA)
191 ret = package->provider->fnTableA.QueryCredentialsAttributesA(
212 TRACE(
"%p %d %p\n", phCredential, ulAttribute,
pBuffer);
215 SecurePackage *
package = (SecurePackage *)phCredential->dwUpper;
218 if (package && package->provider)
220 if (package->provider->fnTableW.QueryCredentialsAttributesW)
221 ret = package->provider->fnTableW.QueryCredentialsAttributesW(
249 TRACE(
"%p %p %s 0x%08x %d %d %p %d %p %p %p %p\n", phCredential, phContext,
251 Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry);
255 package = (SecurePackage *)phContext->dwUpper;
260 package = (SecurePackage *)phCredential->dwUpper;
264 if (package && package->provider)
266 if (package->provider->fnTableA.InitializeSecurityContextA)
277 ret = package->provider->fnTableA.InitializeSecurityContextA(
278 cred, ctxt, pszTargetName, fContextReq,
280 pOutput, pfContextAttr, ptsExpiry);
282 phNewContext && phNewContext != phContext)
287 package->provider->fnTableA.DeleteSecurityContext(&myCtxt);
313 TRACE(
"%p %p %s %d %d %d %p %d %p %p %p %p\n", phCredential, phContext,
315 Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry);
319 package = (SecurePackage *)phContext->dwUpper;
324 package = (SecurePackage *)phCredential->dwUpper;
328 if (package && package->provider)
330 if (package->provider->fnTableW.InitializeSecurityContextW)
341 ret = package->provider->fnTableW.InitializeSecurityContextW(
342 cred, ctxt, pszTargetName, fContextReq,
344 pOutput, pfContextAttr, ptsExpiry);
346 phNewContext && phNewContext != phContext)
351 package->provider->fnTableW.DeleteSecurityContext(&myCtxt);
372 TRACE(
"%p %p %p %d %d %p %p %p %p\n", phCredential, phContext, pInput,
373 fContextReq, TargetDataRep, phNewContext, pOutput, pfContextAttr,
377 SecurePackage *
package = (SecurePackage *)phCredential->dwUpper;
380 if (package && package->provider)
382 if (package->provider->fnTableW.AcceptSecurityContext)
389 TRACE(
"realCtx: %p\n", realCtxt);
394 ret = package->provider->fnTableW.AcceptSecurityContext(
395 cred, phContext ? &myCtxt :
NULL, pInput, fContextReq,
396 TargetDataRep, &myCtxt, pOutput, pfContextAttr, ptsExpiry);
402 package->provider->fnTableW.DeleteSecurityContext(
425 TRACE(
"%p %p\n", phContext, pToken);
428 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
431 if (package && package->provider)
433 if (package->provider->fnTableW.CompleteAuthToken)
434 ret = package->provider->fnTableW.CompleteAuthToken(ctxt,
454 TRACE(
"%p\n", phContext);
457 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
460 if (package && package->provider &&
461 package->provider->fnTableW.DeleteSecurityContext)
462 ret = package->provider->fnTableW.DeleteSecurityContext(ctxt);
480 TRACE(
"%p %p\n", phContext, pInput);
483 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
486 if (package && package->provider)
488 if (package->provider->fnTableW.ApplyControlToken)
489 ret = package->provider->fnTableW.ApplyControlToken(
513 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
516 if (package && package->provider)
518 if (package->provider->fnTableA.QueryContextAttributesA)
519 ret = package->provider->fnTableA.QueryContextAttributesA(
543 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
546 if (package && package->provider)
548 if (package->provider->fnTableW.QueryContextAttributesW)
549 ret = package->provider->fnTableW.QueryContextAttributesW(
569 TRACE(
"%p\n", phContext);
572 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
575 if (package && package->provider)
577 if (package->provider->fnTableW.ImpersonateSecurityContext)
578 ret = package->provider->fnTableW.ImpersonateSecurityContext(
598 TRACE(
"%p\n", phContext);
601 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
604 if (package && package->provider)
606 if (package->provider->fnTableW.RevertSecurityContext)
607 ret = package->provider->fnTableW.RevertSecurityContext(
628 TRACE(
"%p %d %p %d\n", phContext, fQOP, pMessage, MessageSeqNo);
631 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
634 if (package && package->provider)
636 if (package->provider->fnTableW.MakeSignature)
637 ret = package->provider->fnTableW.MakeSignature(
638 ctxt, fQOP, pMessage, MessageSeqNo);
658 TRACE(
"%p %p %d %p\n", phContext, pMessage, MessageSeqNo, pfQOP);
661 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
664 if (package && package->provider)
666 if (package->provider->fnTableW.VerifySignature)
667 ret = package->provider->fnTableW.VerifySignature(
668 ctxt, pMessage, MessageSeqNo, pfQOP);
691 SecurePackage *
package = SECUR32_findPackageA(pszPackageName);
696 int nameLen = 0, commentLen = 0;
698 if (package->infoW.Name)
702 bytesNeeded += nameLen;
704 if (package->infoW.Comment)
708 bytesNeeded += commentLen;
716 memcpy(*ppPackageInfo, &package->infoW,
sizeof(package->infoW));
717 if (package->infoW.Name)
719 (*ppPackageInfo)->Name = nextString;
721 package->infoW.Name, -1, nextString, nameLen,
NULL,
NULL);
724 (*ppPackageInfo)->Name =
NULL;
725 if (package->infoW.Comment)
727 (*ppPackageInfo)->Comment = nextString;
729 package->infoW.Comment, -1, nextString, commentLen,
NULL,
733 (*ppPackageInfo)->Comment =
NULL;
754 SecurePackage *
package = SECUR32_findPackageW(pszPackageName);
760 int nameLen = 0, commentLen = 0;
762 if (package->infoW.Name)
764 nameLen =
lstrlenW(package->infoW.Name) + 1;
765 bytesNeeded += nameLen *
sizeof(
WCHAR);
767 if (package->infoW.Comment)
769 commentLen =
lstrlenW(package->infoW.Comment) + 1;
770 bytesNeeded += commentLen *
sizeof(
WCHAR);
778 **ppPackageInfo = package->infoW;
779 if (package->infoW.Name)
781 (*ppPackageInfo)->
Name = nextString;
782 lstrcpynW(nextString, package->infoW.Name, nameLen);
783 nextString += nameLen;
786 (*ppPackageInfo)->Name =
NULL;
787 if (package->infoW.Comment)
789 (*ppPackageInfo)->Comment = nextString;
790 lstrcpynW(nextString, package->infoW.Comment, commentLen);
793 (*ppPackageInfo)->Comment =
NULL;
812 TRACE(
"%p %d %p %p\n", phContext, fFlags, pPackedContext, pToken);
815 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
818 if (package && package->provider)
820 if (package->provider->fnTableW.ExportSecurityContext)
821 ret = package->provider->fnTableW.ExportSecurityContext(
822 ctxt, fFlags, pPackedContext, pToken);
845 if (package && package->provider)
847 if (package->provider->fnTableA.ImportSecurityContextA)
851 ret = package->provider->fnTableA.ImportSecurityContextA(
852 pszPackage, pPackedContext,
Token, &myCtxt);
857 package->provider->fnTableW.DeleteSecurityContext(&myCtxt);
880 if (package && package->provider)
882 if (package->provider->fnTableW.ImportSecurityContextW)
886 ret = package->provider->fnTableW.ImportSecurityContextW(
887 pszPackage, pPackedContext,
Token, &myCtxt);
892 package->provider->fnTableW.DeleteSecurityContext(&myCtxt);
908 void *pAuthData,
SEC_GET_KEY_FN pGetKeyFn,
void *pvGetKeyArgument,
913 TRACE(
"%p %s %s %d %p %p %p %p\n", hCredentials,
debugstr_a(pszPrincipal),
914 debugstr_a(pszPackage), fCredentialUse, pAuthData, pGetKeyFn,
915 pvGetKeyArgument, ptsExpiry);
918 SecurePackage *
package = (SecurePackage *)hCredentials->dwUpper;
921 if (package && package->provider)
923 if (package->provider->fnTableA.AddCredentialsA)
924 ret = package->provider->fnTableA.AddCredentialsA(
925 cred, pszPrincipal, pszPackage, fCredentialUse, pAuthData,
926 pGetKeyFn, pvGetKeyArgument, ptsExpiry);
943 void *pAuthData,
SEC_GET_KEY_FN pGetKeyFn,
void *pvGetKeyArgument,
948 TRACE(
"%p %s %s %d %p %p %p %p\n", hCredentials,
debugstr_w(pszPrincipal),
949 debugstr_w(pszPackage), fCredentialUse, pAuthData, pGetKeyFn,
950 pvGetKeyArgument, ptsExpiry);
953 SecurePackage *
package = (SecurePackage *)hCredentials->dwUpper;
956 if (package && package->provider)
958 if (package->provider->fnTableW.AddCredentialsW)
959 ret = package->provider->fnTableW.AddCredentialsW(
960 cred, pszPrincipal, pszPackage, fCredentialUse, pAuthData,
961 pGetKeyFn, pvGetKeyArgument, ptsExpiry);
984 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
987 if (package && package->provider)
989 if (package->provider->fnTableW.QuerySecurityContextToken)
990 ret = package->provider->fnTableW.QuerySecurityContextToken(
1011 TRACE(
"%p %d %p %d\n", phContext, fQOP, pMessage, MessageSeqNo);
1014 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
1017 if (package && package->provider)
1019 if (package->provider->fnTableW.EncryptMessage)
1020 ret = package->provider->fnTableW.EncryptMessage(
1021 ctxt, fQOP, pMessage, MessageSeqNo);
1041 TRACE(
"%p %p %d %p\n", phContext, pMessage, MessageSeqNo, pfQOP);
1044 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
1047 if (package && package->provider)
1049 if (package->provider->fnTableW.DecryptMessage)
1050 ret = package->provider->fnTableW.DecryptMessage(
1051 ctxt, pMessage, MessageSeqNo, pfQOP);
1071 TRACE(
"%p %d %p %d\n", phContext, ulAttribute,
pBuffer, cbBuffer);
1074 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
1077 if (package && package->provider)
1079 if (package->provider->fnTableA.SetContextAttributesA)
1080 ret = package->provider->fnTableA.SetContextAttributesA(
1081 ctxt, ulAttribute,
pBuffer, cbBuffer);
1101 TRACE(
"%p %d %p %d\n", phContext, ulAttribute,
pBuffer, cbBuffer);
1104 SecurePackage *
package = (SecurePackage *)phContext->dwUpper;
1107 if (package && package->provider)
1109 if (package->provider->fnTableW.SetContextAttributesW)
1110 ret = package->provider->fnTableW.SetContextAttributesW(
1111 ctxt, ulAttribute,
pBuffer, cbBuffer);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define memcpy(s1, s2, n)
PVOID *typedef PSecBuffer
struct _SecPkgInfoW SecPkgInfoW
struct _SecPkgInfoA SecPkgInfoA
void(SEC_ENTRY * SEC_GET_KEY_FN)(void *Arg, void *Principal, ULONG KeyVer, void **Key, SECURITY_STATUS *Status)
_In_opt_ LPSTR _In_opt_ LPSTR _In_ DWORD _In_ DWORD _Out_opt_ PHANDLE phToken
#define SEC_E_INVALID_HANDLE
#define SEC_E_UNSUPPORTED_FUNCTION
#define SEC_E_SECPKG_NOT_FOUND
#define SEC_E_INSUFFICIENT_MEMORY
#define SEC_I_CONTINUE_NEEDED
SECURITY_STATUS WINAPI EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
SECURITY_STATUS WINAPI MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
SECURITY_STATUS WINAPI AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI ExportSecurityContext(PCtxtHandle phContext, ULONG fFlags, PSecBuffer pPackedContext, void **pToken)
SECURITY_STATUS WINAPI AddCredentialsW(PCredHandle hCredentials, SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI InitializeSecurityContextW(PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken)
SECURITY_STATUS WINAPI ImportSecurityContextA(SEC_CHAR *pszPackage, PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext)
SECURITY_STATUS WINAPI SetContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer)
SECURITY_STATUS WINAPI DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
SECURITY_STATUS WINAPI VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
SECURITY_STATUS WINAPI QueryContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
SECURITY_STATUS WINAPI ApplyControlToken(PCtxtHandle phContext, PSecBufferDesc pInput)
SECURITY_STATUS WINAPI SetContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer)
SECURITY_STATUS WINAPI ImportSecurityContextW(SEC_WCHAR *pszPackage, PSecBuffer pPackedContext, void *Token, PCtxtHandle phContext)
SECURITY_STATUS WINAPI QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
SECURITY_STATUS WINAPI AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI QueryCredentialsAttributesA(PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
SECURITY_STATUS WINAPI InitializeSecurityContextA(PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI DeleteSecurityContext(PCtxtHandle phContext)
SECURITY_STATUS WINAPI QuerySecurityPackageInfoW(SEC_WCHAR *pszPackageName, PSecPkgInfoW *ppPackageInfo)
static SECURITY_STATUS SECUR32_makeSecHandle(PSecHandle phSec, SecurePackage *package, PSecHandle realHandle)
SECURITY_STATUS WINAPI ImpersonateSecurityContext(PCtxtHandle phContext)
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
SECURITY_STATUS WINAPI QuerySecurityPackageInfoA(SEC_CHAR *pszPackageName, PSecPkgInfoA *ppPackageInfo)
SECURITY_STATUS WINAPI RevertSecurityContext(PCtxtHandle phContext)
SECURITY_STATUS WINAPI QuerySecurityContextToken(PCtxtHandle phContext, HANDLE *phToken)
SECURITY_STATUS WINAPI QueryCredentialsAttributesW(PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
SECURITY_STATUS WINAPI AddCredentialsA(PCredHandle hCredentials, SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PTimeStamp ptsExpiry)