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

◆ GetSniFromHostNameStruct()

static string System.Net.Security.TlsFrameHelper.GetSniFromHostNameStruct ( ReadOnlySpan< byte > hostNameStruct,
out bool invalid )
inlinestaticprivate

Definition at line 334 of file TlsFrameHelper.cs.

335 {
336 int num = BinaryPrimitives.ReadUInt16BigEndian(hostNameStruct);
337 ReadOnlySpan<byte> bytes = hostNameStruct.Slice(2);
338 if (num != bytes.Length)
339 {
340 invalid = true;
341 return null;
342 }
343 invalid = false;
344 return DecodeString(bytes);
345 }
static ushort ReadUInt16BigEndian(ReadOnlySpan< byte > source)
static string DecodeString(ReadOnlySpan< byte > bytes)
ReadOnlySpan< T > Slice(int start)

References System.bytes, System.Net.Security.TlsFrameHelper.DecodeString(), System.Buffers.Binary.BinaryPrimitives.ReadUInt16BigEndian(), and System.ReadOnlySpan< T >.Slice().

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