Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make NegotiateAuthentication.ComputeIntegrityCheck/VerifyIntegrityChe…
…ck APIs public
  • Loading branch information
filipnavara committed Jan 9, 2024
commit 3deeca767ffe86c1a86b6692bfd1ebfa46ed36ff
Original file line number Diff line number Diff line change
Expand Up @@ -356,21 +356,23 @@ public NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int
/// Computes the message integrity check of a given message.
/// </summary>
/// <param name="message">Input message for MIC calculation.</param>
/// <param name="signature">Buffer writer where the MIC is written.</param>
/// <param name="signatureWriter">Buffer writer where the MIC is written.</param>
/// <remarks>
/// Implements the GSSAPI GetMIC operation.
///
/// The method modifies the internal state and may update sequence numbers depending on the
/// selected algorithm. Two successive invocations thus don't produce the same result and
/// it's important to carefully pair GetMIC and VerifyMIC calls on the both sides of the
/// authenticated session.
/// </remarks>
internal void GetMIC(ReadOnlySpan<byte> message, IBufferWriter<byte> signature)
public void ComputeIntegrityCheck(ReadOnlySpan<byte> message, IBufferWriter<byte> signatureWriter)
{
if (!IsAuthenticated || _isDisposed)
{
throw new InvalidOperationException(SR.net_auth_noauth);
}

_pal.GetMIC(message, signature);
_pal.GetMIC(message, signatureWriter);
}

/// <summary>
Expand All @@ -380,12 +382,14 @@ internal void GetMIC(ReadOnlySpan<byte> message, IBufferWriter<byte> signature)
/// <param name="signature">MIC to be verified.</param>
/// <returns>For successfully verified MIC, the method returns true.</returns>
/// <remarks>
/// Implements the GSSAPI VerifyMIC operation.
///
/// The method modifies the internal state and may update sequence numbers depending on the
/// selected algorithm. Two successive invocations thus don't produce the same result and
/// it's important to carefully pair GetMIC and VerifyMIC calls on the both sides of the
/// authenticated session.
/// </remarks>
internal bool VerifyMIC(ReadOnlySpan<byte> message, ReadOnlySpan<byte> signature)
public bool VerifyIntegrityCheck(ReadOnlySpan<byte> message, ReadOnlySpan<byte> signature)
{
if (!IsAuthenticated || _isDisposed)
{
Expand Down