mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
TLS public key must be positive
This commit is contained in:
parent
145ade4414
commit
6882e85fe1
|
|
@ -14,7 +14,8 @@ namespace WTelegram
|
|||
public static Action<int, string> Log { get; set; } = DefaultLogger;
|
||||
|
||||
/// <summary>For serializing indented Json with fields included</summary>
|
||||
public static readonly JsonSerializerOptions JsonOptions = new() { IncludeFields = true, WriteIndented = true, IgnoreReadOnlyProperties = true };
|
||||
public static readonly JsonSerializerOptions JsonOptions = new() { IncludeFields = true, WriteIndented = true,
|
||||
IgnoreReadOnlyProperties = true, DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull };
|
||||
|
||||
private static readonly ConsoleColor[] LogLevelToColor = new[] { ConsoleColor.DarkGray, ConsoleColor.DarkCyan, ConsoleColor.Cyan,
|
||||
ConsoleColor.Yellow, ConsoleColor.Red, ConsoleColor.Magenta, ConsoleColor.DarkBlue };
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ namespace WTelegram
|
|||
buffer[142 + dlen] = buffer[143 + dlen] = greases[4];
|
||||
buffer[219 + dlen] = buffer[220 + dlen] = greases[4];
|
||||
Encryption.RNG.GetBytes(buffer, 228 + dlen, 32); // public key
|
||||
buffer[228 + dlen + 31] &= 0x7F; // must be positive
|
||||
TlsClientHello4.CopyTo(buffer, 260 + dlen);
|
||||
buffer[271 + dlen] = buffer[272 + dlen] = greases[6];
|
||||
buffer[288 + dlen] = buffer[289 + dlen] = greases[3];
|
||||
|
|
|
|||
Loading…
Reference in a new issue