Skip to content

Commit 3622bfa

Browse files
jborean93wfurt
andauthored
Fix SSPI ComputeIntegrityCheck with Sign level (#105605)
Fix calling NegotiateAuthentication.ComputeIntegrityCheck on SSPI when the negotiation context was built with ProtectionLevel.Sign. The SECQOP_WRAP_NO_ENCRYPT QoP flag should not be set when calling GetMIC as no encryption is involved and some authentication providers fail when this is set. Fix #103461 Co-authored-by: Tomas Weinfurt <[email protected]>
1 parent 2791df7 commit 3622bfa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.Windows.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,7 @@ public override unsafe void GetMIC(ReadOnlySpan<byte> message, IBufferWriter<byt
587587
pBuffers = unmanagedBuffer
588588
};
589589

590-
uint qop = IsEncrypted ? 0 : Interop.SspiCli.SECQOP_WRAP_NO_ENCRYPT;
591-
int errorCode = Interop.SspiCli.MakeSignature(ref _securityContext._handle, qop, ref sdcInOut, 0);
590+
int errorCode = Interop.SspiCli.MakeSignature(ref _securityContext._handle, 0, ref sdcInOut, 0);
592591

593592
if (errorCode != 0)
594593
{

0 commit comments

Comments
 (0)