private void HandleAuthorizationRequest(AuthorizationRequestPacket packet) { if (Authorized) return; SendPacket(new AuthorizationResponsePacket { AuthorizationStatus = AuthorizationStatus }); }
private void HandleAuthorizationRequest(AuthorizationRequestPacket packet) { if (Authorized) return; SendPacket(new AuthorizationResponsePacket { AuthorizationStatus = AuthorizationStatus }); if (AuthorizationStatus.HasFlag(AuthorizationStatus.EncryprionEnabled)) { var publicKey = Module.RsaKeyPair.PublicKeyToByteArray(); VerificationToken = new byte[4]; var drg = new DigestRandomGenerator(new Sha512Digest()); drg.NextBytes(VerificationToken); SendPacket(new EncryptionRequestPacket { PublicKey = publicKey, VerificationToken = VerificationToken }); } }