Disable encryption for now
All checks were successful
Build & Test / nix-build (push) Successful in 1m7s
All checks were successful
Build & Test / nix-build (push) Successful in 1m7s
This commit is contained in:
parent
099d2a3a68
commit
9291af2bc8
@ -2,5 +2,5 @@ import Config
|
|||||||
|
|
||||||
config :amethyst,
|
config :amethyst,
|
||||||
port: 25599, # Bogus port for testing, avoids unexpected conflicts
|
port: 25599, # Bogus port for testing, avoids unexpected conflicts
|
||||||
encryption: true, # Whether or not to enable encryption, this should almost always be 'true' for security reasons
|
encryption: false, # Whether or not to request encryption from clients.
|
||||||
auth: true # Whether or not users should be authenticated.
|
auth: false # Whether or not users should be authenticated with Mojang.
|
||||||
|
@ -49,8 +49,8 @@ defmodule Amethyst.Server.Handshake do
|
|||||||
## HANDLING
|
## HANDLING
|
||||||
# Handshake https://wiki.vg/Protocol#Handshake
|
# Handshake https://wiki.vg/Protocol#Handshake
|
||||||
@spec handle(any(), any()) :: no_return()
|
@spec handle(any(), any()) :: no_return()
|
||||||
def handle({:handshake, ver, addr, port, next}, client) do
|
def handle({:handshake, 767, addr, port, next}, client) do
|
||||||
Logger.info("Got handshake, version #{ver} on #{addr}:#{port}. Wants to move to #{next}")
|
Logger.info("Got handshake, version 767 on #{addr}:#{port}. Wants to move to #{next}")
|
||||||
case next do
|
case next do
|
||||||
:status -> Amethyst.Server.Status.serve(client)
|
:status -> Amethyst.Server.Status.serve(client)
|
||||||
:login -> Amethyst.Server.Login.serve(client)
|
:login -> Amethyst.Server.Login.serve(client)
|
||||||
|
@ -107,10 +107,11 @@ defmodule Amethyst.Server.Login do
|
|||||||
def handle({:login_start, name, uuid}, client) do
|
def handle({:login_start, name, uuid}, client) do
|
||||||
Logger.info("Logging in #{name} (#{uuid})")
|
Logger.info("Logging in #{name} (#{uuid})")
|
||||||
if Application.fetch_env!(:amethyst, :encryption) do
|
if Application.fetch_env!(:amethyst, :encryption) do
|
||||||
verify_token = :crypto.strong_rand_bytes(4)
|
raise RuntimeError, "Encryption is currently unsupported." # TODO: Implement encryption
|
||||||
pubkey = Amethyst.Keys.get_pub()
|
# verify_token = :crypto.strong_rand_bytes(4)
|
||||||
auth = Application.fetch_env!(:amethyst, :auth)
|
# pubkey = Amethyst.Keys.get_pub()
|
||||||
transmit({:encryption_request, "amethyst", pubkey, verify_token, auth}, client)
|
# auth = Application.fetch_env!(:amethyst, :auth)
|
||||||
|
# transmit({:encryption_request, "amethyst", pubkey, verify_token, auth}, client) # This is broken for some reason? java.lang.IllegalStateException: Protocol Error
|
||||||
else
|
else
|
||||||
transmit({:login_success, uuid, name, [], false}, client)
|
transmit({:login_success, uuid, name, [], false}, client)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user