Skip to content
Prev Previous commit
Next Next commit
Update usage of the internal APIs
  • Loading branch information
filipnavara committed Jan 9, 2024
commit 7ae11f040a7c1deab97975fe94d3fcf6a6282081
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ private async ValueTask<int> ReadAsync<TIOAdapter>(Memory<byte> buffer, Cancella
const int NtlmSignatureLength = 16;

if (readBytes < NtlmSignatureLength ||
!_context.VerifyMIC(_readBuffer.AsSpan(NtlmSignatureLength, readBytes - NtlmSignatureLength), _readBuffer.AsSpan(0, NtlmSignatureLength)))
!_context.VerifyIntegrityCheck(_readBuffer.AsSpan(NtlmSignatureLength, readBytes - NtlmSignatureLength), _readBuffer.AsSpan(0, NtlmSignatureLength)))
{
statusCode = NegotiateAuthenticationStatusCode.InvalidToken;
}
Expand Down Expand Up @@ -526,7 +526,7 @@ private async Task WriteAsync<TIOAdapter>(ReadOnlyMemory<byte> buffer, Cancellat
if (isNtlm && !isEncrypted)
{
// Non-encrypted NTLM uses an encoding quirk
_context.GetMIC(bufferToWrap.Span, _writeBuffer);
_context.ComputeIntegrityCheck(bufferToWrap.Span, _writeBuffer);
_writeBuffer.Write(bufferToWrap.Span);
statusCode = NegotiateAuthenticationStatusCode.Completed;
}
Expand Down