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

◆ TryParseHelloFrame()

static bool System.Net.Security.TlsFrameHelper.TryParseHelloFrame ( ReadOnlySpan< byte > sslHandshake,
ref TlsFrameInfo info,
ProcessingOptions options,
HelloExtensionCallback callback )
inlinestaticprivate

Definition at line 194 of file TlsFrameHelper.cs.

195 {
196 if (sslHandshake.Length < 4 || (sslHandshake[0] != 1 && sslHandshake[0] != 2))
197 {
198 return false;
199 }
200 int num = ReadUInt24BigEndian(sslHandshake.Slice(1));
201 ReadOnlySpan<byte> readOnlySpan = sslHandshake.Slice(4);
202 if (readOnlySpan.Length < num)
203 {
204 return false;
205 }
206 if (readOnlySpan[0] == 3)
207 {
208 info.SupportedVersions |= TlsMinorVersionToProtocol(readOnlySpan[1]);
209 }
210 if (sslHandshake[0] != 1)
211 {
212 return TryParseServerHello(readOnlySpan.Slice(0, num), ref info, options, callback);
213 }
214 return TryParseClientHello(readOnlySpan.Slice(0, num), ref info, options, callback);
215 }
static int ReadUInt24BigEndian(ReadOnlySpan< byte > bytes)
static bool TryParseClientHello(ReadOnlySpan< byte > clientHello, ref TlsFrameInfo info, ProcessingOptions options, HelloExtensionCallback callback)
static bool TryParseServerHello(ReadOnlySpan< byte > serverHello, ref TlsFrameInfo info, ProcessingOptions options, HelloExtensionCallback callback)
static SslProtocols TlsMinorVersionToProtocol(byte value)
ReadOnlySpan< T > Slice(int start)

References System.info, System.ReadOnlySpan< T >.Length, System.options, System.Net.Security.TlsFrameHelper.ReadUInt24BigEndian(), System.ReadOnlySpan< T >.Slice(), System.Net.Security.TlsFrameHelper.TlsMinorVersionToProtocol(), System.Net.Security.TlsFrameHelper.TryParseClientHello(), and System.Net.Security.TlsFrameHelper.TryParseServerHello().

Referenced by System.Net.Security.TlsFrameHelper.TryGetFrameInfo().