public unsafe int DecryptMessage(SafeDeleteContext context, ref Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber)
{
int status = (int)Interop.SECURITY_STATUS.InvalidHandle;
uint qop = 0;
try
{
bool ignore = false;
context.DangerousAddRef(ref ignore);
status = Interop.SspiCli.DecryptMessage(ref context._handle, ref inputOutput, sequenceNumber, &qop);
}
finally
{
context.DangerousRelease();
}
if (status == 0 && qop == Interop.SspiCli.SECQOP_WRAP_NO_ENCRYPT)
{
NetEventSource.Fail(this, $"Expected qop = 0, returned value = {qop}");
throw new InvalidOperationException(SR.net_auth_message_not_encrypted);
}
return status;
}