Fixed Credential using a fixed-size 64-bit handle; it's always 2 pointers.

Reworked the Credential handle into a SafeCredentialHandle. We still use references to the raw handle, which is unsafe, but I will hopefully rework that soon.
This commit is contained in:
antiduh
2014-06-24 03:01:53 +00:00
parent 19f2e71e9c
commit fe14836949
7 changed files with 124 additions and 38 deletions

View File

@@ -24,7 +24,6 @@ namespace NSspi.Contexts
SecureBuffer clientBuffer = new SecureBuffer( clientToken, BufferType.Token );
SecureBuffer outBuffer = new SecureBuffer( new byte[12288], BufferType.Token );
long credHandle = this.Credential.CredentialHandle;
long oldContextHandle = base.ContextHandle;
long newContextHandle = 0;
@@ -42,7 +41,7 @@ namespace NSspi.Contexts
if ( oldContextHandle == 0 )
{
status = ContextNativeMethods.AcceptSecurityContext_1(
ref credHandle,
ref this.Credential.Handle.rawHandle,
IntPtr.Zero,
clientAdapter.Handle,
requestedAttribs,
@@ -56,7 +55,7 @@ namespace NSspi.Contexts
else
{
status = ContextNativeMethods.AcceptSecurityContext_2(
ref credHandle,
ref this.Credential.Handle.rawHandle,
ref oldContextHandle,
clientAdapter.Handle,
requestedAttribs,