Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SmtpNegotiateAuthenticationModule.cs
Go to the documentation of this file.
4
5namespace System.Net.Mail;
6
8{
10
11 public string AuthenticationType => "gssapi";
12
16
18 {
19 try
20 {
22 {
24 {
25 if (credential == null)
26 {
27 return null;
28 }
29 value = (_sessions[sessionCookie] = new System.Net.NTAuthentication(isServer: false, "Negotiate", credential, spn, System.Net.ContextFlagsPal.Connection | System.Net.ContextFlagsPal.AcceptStream, channelBindingToken));
30 }
31 string token = null;
32 if (!value.IsCompleted)
33 {
34 byte[] incomingBlob = null;
35 if (challenge != null)
36 {
38 }
39 byte[] outgoingBlob = value.GetOutgoingBlob(incomingBlob, thrownOnError: false);
40 if (value.IsCompleted && outgoingBlob == null)
41 {
42 token = "\r\n";
43 }
44 if (outgoingBlob != null)
45 {
47 }
48 }
49 else
50 {
52 }
53 return new Authorization(token, value.IsCompleted);
54 }
55 }
57 {
58 return null;
59 }
60 }
61
62 public void CloseContext(object sessionCookie)
63 {
66 {
68 {
70 }
71 }
72 value?.CloseContext();
73 }
74
76 {
77 if (challenge == null)
78 {
79 return null;
80 }
82 int num;
83 try
84 {
85 num = clientContext.VerifySignature(array, 0, array.Length);
86 }
87 catch (Win32Exception)
88 {
89 return null;
90 }
91 if (num < 4 || array[0] != 1 || array[1] != 0 || array[2] != 0 || array[3] != 0)
92 {
93 return null;
94 }
95 byte[] output = null;
96 try
97 {
98 num = clientContext.MakeSignature(array, 0, 4, ref output);
99 }
100 catch (Win32Exception)
101 {
102 return null;
103 }
104 return Convert.ToBase64String(output, 0, num);
105 }
106}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
static string ToBase64String(byte[] inArray)
Definition Convert.cs:2675
static unsafe byte[] FromBase64String(string s)
Definition Convert.cs:2904
Authorization Authenticate(string challenge, NetworkCredential credential, object sessionCookie, string spn, ChannelBinding channelBindingToken)
string GetSecurityLayerOutgoingBlob(string challenge, System.Net.NTAuthentication clientContext)
readonly Dictionary< object, System.Net.NTAuthentication > _sessions