public static byte[] Success(SecureRemotePasswordProtocol srp) => new PacketWriter() .WriteUInt8(/* cmd */ (byte)Opcode.LoginChallenge) .WriteUInt8(/* error */ (byte)AuthenticationStatus.Success) .WriteUInt8(/* unk2 */ 0) .WriteBytes(/* B[32] */ srp.B) .WriteUInt8(/* g_len */ 1) .WriteUInt8(/* g[1] */ SecureRemotePasswordProtocol.g) .WriteUInt8(/* N_len */ 32) .WriteBytes(/* N[32] */ srp.N.ToProperByteArray()) .WriteBytes(/* s */ srp.s) .WriteBytes( /* unk3 */ 0x2A, 0xD5, 0x48, 0xCC, 0x9B, 0x9D, 0xA1, 0x99, 0xCC, 0x04, 0x7A, 0x60, 0x91, 0x15, 0x6C, 0x51) .WriteUInt8(/* unk4 */ 0) .Build();
public User(SecureRemotePasswordProtocol srp) { this.srp = srp; // TODO if (File.Exists(CharsFile)) { var raw = File.ReadAllText(CharsFile); var chars = JsonConvert.DeserializeObject <Character[]>(raw); this.Characters = new ConcurrentBag <Character>(chars); } else { this.Characters = new ConcurrentBag <Character>(); } }
public static byte[] Success(SecureRemotePasswordProtocol srp, int build) { using var packet = new PacketWriter(); packet .WriteUInt8( /* cmd */ (byte)Opcode.LoginProof) .WriteUInt8( /* error */ (byte)AuthenticationStatus.Success) .WriteBytes( /* M[20] */ srp.M) .WriteUInt32(/* unk */ 0); if (build > ClientBuild.Vanilla) { packet .WriteUInt32(/* unk2 */ 0) .WriteUInt16(/* unk3 */ 0); } return packet.Build(); }
private async Task HandleLoginChallenge(byte[] packet) { var request = new ClientLoginChallenge(packet); if (request.Build > ClientBuild.WotLK) { // Send failed event this.Log($"Login with unsupported build {Build}"); return; } this.Build = request.Build; this.srp = new SecureRemotePasswordProtocol(request.Identifier, request.Identifier); // TODO: Quick hack this.accountService.AddClientBuildForAddress(this.Address, this.Port, this.Build); // Create and send a ServerLogonChallenge as response. await this.Send(ServerLoginChallenge.Success(this.srp)); }
public ServerLogonChallenge(SecureRemotePasswordProtocol srp) { this.srp = srp; }
public ServerLogonProof(SecureRemotePasswordProtocol srp) { this.srp = srp; }