rpcrt4: Implement RpcBindingSetAuthInfoExW based on the implementation for RpcBindingSetAuthInfoExA.
This commit is contained in:
parent
4cd5be2637
commit
63b66b95f9
|
@ -1088,9 +1088,68 @@ RpcBindingSetAuthInfoExW( RPC_BINDING_HANDLE Binding, unsigned short *ServerPrin
|
||||||
unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvr,
|
unsigned long AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, unsigned long AuthzSvr,
|
||||||
RPC_SECURITY_QOS *SecurityQos )
|
RPC_SECURITY_QOS *SecurityQos )
|
||||||
{
|
{
|
||||||
FIXME("%p %s %lu %lu %p %lu %p\n", Binding, debugstr_w((const WCHAR*)ServerPrincName),
|
RpcBinding* bind = (RpcBinding*)Binding;
|
||||||
AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos);
|
SECURITY_STATUS r;
|
||||||
|
CredHandle cred;
|
||||||
|
TimeStamp exp;
|
||||||
|
ULONG package_count;
|
||||||
|
ULONG i;
|
||||||
|
PSecPkgInfoW packages;
|
||||||
|
|
||||||
|
TRACE("%p %s %lu %lu %p %lu %p\n", Binding, debugstr_w((const WCHAR*)ServerPrincName),
|
||||||
|
AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos);
|
||||||
|
|
||||||
|
if (AuthnLevel != RPC_C_AUTHN_LEVEL_CONNECT)
|
||||||
|
{
|
||||||
|
FIXME("unsupported AuthnLevel %lu\n", AuthnLevel);
|
||||||
|
return RPC_S_UNKNOWN_AUTHN_LEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AuthzSvr)
|
||||||
|
{
|
||||||
|
FIXME("unsupported AuthzSvr %lu\n", AuthzSvr);
|
||||||
|
return RPC_S_UNKNOWN_AUTHZ_SERVICE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SecurityQos)
|
||||||
|
FIXME("SecurityQos ignored\n");
|
||||||
|
|
||||||
|
r = EnumerateSecurityPackagesW(&package_count, &packages);
|
||||||
|
if (r != SEC_E_OK)
|
||||||
|
{
|
||||||
|
ERR("EnumerateSecurityPackagesA failed with error 0x%08lx\n", r);
|
||||||
|
return RPC_S_SEC_PKG_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < package_count; i++)
|
||||||
|
if (packages[i].wRPCID == AuthnSvc)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (i == package_count)
|
||||||
|
{
|
||||||
|
FIXME("unsupported AuthnSvc %lu\n", AuthnSvc);
|
||||||
|
FreeContextBuffer(packages);
|
||||||
|
return RPC_S_UNKNOWN_AUTHN_SERVICE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("found package %s for service %ld\n", debugstr_w(packages[i].Name), AuthnSvc);
|
||||||
|
r = AcquireCredentialsHandleW((SEC_WCHAR *)ServerPrincName, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL,
|
||||||
|
AuthIdentity, NULL, NULL, &cred, &exp);
|
||||||
|
FreeContextBuffer(packages);
|
||||||
|
if (r == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
|
||||||
|
bind->AuthInfo = NULL;
|
||||||
|
r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, &bind->AuthInfo);
|
||||||
|
if (r != RPC_S_OK)
|
||||||
|
FreeCredentialsHandle(&cred);
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ERR("AcquireCredentialsHandleA failed with error 0x%08lx\n", r);
|
||||||
|
return RPC_S_SEC_PKG_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue