Rob Shearman : rpcrt4:
Allow applications to specify authentication levels other than connect
in RpcBindingSetAuthInfoA /W.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Nov 22 05:21:14 CST 2006
Module: wine
Branch: master
Commit: 20c53a77e287e1b2d0db95a4f50ff76a12da0d13
URL: http://source.winehq.org/git/wine.git/?a=commit;h=20c53a77e287e1b2d0db95a4f50ff76a12da0d13
Author: Rob Shearman <rob at codeweavers.com>
Date: Tue Nov 21 13:09:44 2006 +0000
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.
---
dlls/rpcrt4/rpc_binding.c | 36 ++++++++++++++++++++++++++++++++----
1 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c
index c8368ff..7b55f21 100644
--- a/dlls/rpcrt4/rpc_binding.c
+++ b/dlls/rpcrt4/rpc_binding.c
@@ -1049,9 +1049,23 @@ RpcBindingSetAuthInfoExA( RPC_BINDING_HA
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_HA
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;
}
More information about the wine-cvs
mailing list