Use the package properties to know how big to make the token buffers.
This commit is contained in:
@@ -87,8 +87,12 @@ namespace NSspi.Contexts
|
|||||||
throw new InvalidOperationException( "Must provide the server's response when continuing the init process." );
|
throw new InvalidOperationException( "Must provide the server's response when continuing the init process." );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The security package tells us how big its biggest token will be. We'll allocate a buffer
|
||||||
outTokenBuffer = new SecureBuffer( new byte[12288], BufferType.Token );
|
// that size, and it'll tell us how much it used.
|
||||||
|
outTokenBuffer = new SecureBuffer(
|
||||||
|
new byte[ this.Credential.PackageInfo.MaxTokenLength ],
|
||||||
|
BufferType.Token
|
||||||
|
);
|
||||||
|
|
||||||
serverBuffer = null;
|
serverBuffer = null;
|
||||||
if ( serverToken != null )
|
if ( serverToken != null )
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ namespace NSspi.Contexts
|
|||||||
}
|
}
|
||||||
|
|
||||||
clientBuffer = new SecureBuffer( clientToken, BufferType.Token );
|
clientBuffer = new SecureBuffer( clientToken, BufferType.Token );
|
||||||
outBuffer = new SecureBuffer( new byte[12288], BufferType.Token );
|
|
||||||
|
outBuffer = new SecureBuffer(
|
||||||
|
new byte[ this.Credential.PackageInfo.MaxTokenLength ],
|
||||||
|
BufferType.Token
|
||||||
|
);
|
||||||
|
|
||||||
using ( clientAdapter = new SecureBufferAdapter( clientBuffer ) )
|
using ( clientAdapter = new SecureBufferAdapter( clientBuffer ) )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user