Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SendBlobAsync< TAdapter >()

async Task System.Net.Security.NegotiateStream.SendBlobAsync< TAdapter > ( TAdapter adapter,
byte[] message )
inlineprivate
Type Constraints
TAdapter :IReadWriteAdapter 

Definition at line 838 of file NegotiateStream.cs.

838 : IReadWriteAdapter
839 {
840 Exception e = null;
841 if (message != s_emptyMessage)
842 {
843 message = GetOutgoingBlob(message, ref e);
844 }
845 if (e != null)
846 {
847 await SendAuthResetSignalAndThrowAsync(adapter, message, e).ConfigureAwait(continueOnCapturedContext: false);
848 }
850 {
851 if (_context.IsServer && !CheckSpn())
852 {
854 int num = 1790;
855 message = new byte[8];
856 for (int num2 = message.Length - 1; num2 >= 0; num2--)
857 {
858 message[num2] = (byte)((uint)num & 0xFFu);
859 num >>>= 8;
860 }
861 await SendAuthResetSignalAndThrowAsync(adapter, message, e).ConfigureAwait(continueOnCapturedContext: false);
862 }
864 {
866 int num3 = 1790;
867 message = new byte[8];
868 for (int num4 = message.Length - 1; num4 >= 0; num4--)
869 {
870 message[num4] = (byte)((uint)num3 & 0xFFu);
871 num3 >>>= 8;
872 }
873 await SendAuthResetSignalAndThrowAsync(adapter, message, e).ConfigureAwait(continueOnCapturedContext: false);
874 }
875 ProtectionLevel protectionLevel = (_context.IsConfidentialityFlag ? ProtectionLevel.EncryptAndSign : (_context.IsIntegrityFlag ? ProtectionLevel.Sign : ProtectionLevel.None));
876 if (protectionLevel < _expectedProtectionLevel)
877 {
879 int num5 = 1790;
880 message = new byte[8];
881 for (int num6 = message.Length - 1; num6 >= 0; num6--)
882 {
883 message[num6] = (byte)((uint)num5 & 0xFFu);
884 num5 >>>= 8;
885 }
886 await SendAuthResetSignalAndThrowAsync(adapter, message, e).ConfigureAwait(continueOnCapturedContext: false);
887 }
888 _framer.WriteHeader.MessageId = 20;
889 if (_context.IsServer)
890 {
891 _remoteOk = true;
892 if (message == null)
893 {
894 message = s_emptyMessage;
895 }
896 }
897 }
898 else if (message == null || message == s_emptyMessage)
899 {
900 throw new InternalException();
901 }
902 if (message != null)
903 {
904 await _framer.WriteMessageAsync(adapter, message).ConfigureAwait(continueOnCapturedContext: false);
905 }
907 {
908 await ReceiveBlobAsync(adapter).ConfigureAwait(continueOnCapturedContext: false);
909 }
910 }
TokenImpersonationLevel PrivateImpersonationLevel
TokenImpersonationLevel _expectedImpersonationLevel
static readonly byte[] s_emptyMessage
byte[] GetOutgoingBlob(byte[] incomingBlob, ref Exception e)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_auth_bad_client_creds_or_target_mismatch
Definition SR.cs:58
static string net_auth_context_expectation
Definition SR.cs:60
Definition SR.cs:7

References System.Net.Security.NegotiateStream._context, System.Net.Security.NegotiateStream._expectedImpersonationLevel, System.Net.Security.NegotiateStream._expectedProtectionLevel, System.Net.Security.NegotiateStream._framer, System.Net.Security.NegotiateStream._remoteOk, System.Net.Security.NegotiateStream.CheckSpn(), System.SR.Format(), System.Net.Security.NegotiateStream.GetOutgoingBlob(), System.Net.Security.NegotiateStream.HandshakeComplete, System.Net.NTAuthentication.IsServer, System.SR.net_auth_bad_client_creds_or_target_mismatch, System.SR.net_auth_context_expectation, System.Net.Security.NegotiateStream.PrivateImpersonationLevel, and System.Net.Security.NegotiateStream.s_emptyMessage.