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.
This commit is contained in:
Rob Shearman 2006-11-21 13:09:44 +00:00 committed by Alexandre Julliard
parent 881095d720
commit 20c53a77e2
1 changed files with 32 additions and 4 deletions

View File

@ -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))
{
FIXME("unsupported AuthnLevel %lu\n", AuthnLevel);
if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
bind->AuthInfo = NULL;
return RPC_S_OK;
}
if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
{
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))
{
FIXME("unsupported AuthnLevel %lu\n", AuthnLevel);
if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
bind->AuthInfo = NULL;
return RPC_S_OK;
}
if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
{
FIXME("unknown AuthnLevel %lu\n", AuthnLevel);
return RPC_S_UNKNOWN_AUTHN_LEVEL;
}