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:
@@ -25,8 +25,6 @@ namespace NSspi.Contexts
|
||||
|
||||
public SecurityStatus Init( byte[] serverToken, out byte[] outToken )
|
||||
{
|
||||
long credHandle = base.Credential.CredentialHandle;
|
||||
|
||||
long prevContextHandle = base.ContextHandle;
|
||||
long newContextHandle = 0;
|
||||
|
||||
@@ -62,7 +60,7 @@ namespace NSspi.Contexts
|
||||
if ( prevContextHandle == 0 )
|
||||
{
|
||||
status = ContextNativeMethods.InitializeSecurityContext_1(
|
||||
ref credHandle,
|
||||
ref this.Credential.Handle.rawHandle,
|
||||
IntPtr.Zero,
|
||||
this.serverPrinc,
|
||||
this.requestedAttribs,
|
||||
@@ -81,7 +79,7 @@ namespace NSspi.Contexts
|
||||
using ( serverAdapter = new SecureBufferAdapter( serverBuffer ) )
|
||||
{
|
||||
status = ContextNativeMethods.InitializeSecurityContext_2(
|
||||
ref credHandle,
|
||||
ref this.Credential.Handle.rawHandle,
|
||||
ref prevContextHandle,
|
||||
this.serverPrinc,
|
||||
this.requestedAttribs,
|
||||
|
||||
Reference in New Issue
Block a user