Commit 20c53a77 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Allow applications to specify authentication levels other than connect…

rpcrt4: Allow applications to specify authentication levels other than connect in RpcBindingSetAuthInfoA/W. Map the default authentication level and service to sane values. Don't create an RpcAuthInfo object if RPC_C_AUTHN_LEVEL_NONE is specified.
parent 881095d7
......@@ -1049,9 +1049,23 @@ RpcBindingSetAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName,
TRACE("%p %s %lu %lu %p %lu %p\n", Binding, debugstr_a((const char*)ServerPrincName),
AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos);
if (AuthnLevel != RPC_C_AUTHN_LEVEL_CONNECT)
if (AuthnSvc == RPC_C_AUTHN_DEFAULT)
AuthnSvc = RPC_C_AUTHN_WINNT;
/* FIXME: the mapping should probably be retrieved using SSPI somehow */
if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT)
AuthnLevel = RPC_C_AUTHN_LEVEL_NONE;
if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE))
{
if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
bind->AuthInfo = NULL;
return RPC_S_OK;
}
if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
{
FIXME("unsupported AuthnLevel %lu\n", AuthnLevel);
FIXME("unknown AuthnLevel %lu\n", AuthnLevel);
return RPC_S_UNKNOWN_AUTHN_LEVEL;
}
......@@ -1121,9 +1135,23 @@ RpcBindingSetAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName,
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)
if (AuthnSvc == RPC_C_AUTHN_DEFAULT)
AuthnSvc = RPC_C_AUTHN_WINNT;
/* FIXME: the mapping should probably be retrieved using SSPI somehow */
if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT)
AuthnLevel = RPC_C_AUTHN_LEVEL_NONE;
if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE))
{
if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
bind->AuthInfo = NULL;
return RPC_S_OK;
}
if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
{
FIXME("unsupported AuthnLevel %lu\n", AuthnLevel);
FIXME("unknown AuthnLevel %lu\n", AuthnLevel);
return RPC_S_UNKNOWN_AUTHN_LEVEL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment