WIP
This commit is contained in:
+10
-7
@@ -101,6 +101,7 @@ do_connect(State = #s{host = Host = {Addr, Port}}, Ref, From) ->
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handshake(State = #s{socket = Socket}, Ref, From, TempKey) ->
|
handshake(State = #s{socket = Socket}, Ref, From, TempKey) ->
|
||||||
ok = active_once(State),
|
ok = active_once(State),
|
||||||
receive
|
receive
|
||||||
@@ -108,6 +109,15 @@ handshake(State = #s{socket = Socket}, Ref, From, TempKey) ->
|
|||||||
PermanentID = gmser_api_encoder:encode(account_pubkey, PPK),
|
PermanentID = gmser_api_encoder:encode(account_pubkey, PPK),
|
||||||
EphemeralID = gmser_api_encoder:encode(account_pubkey, EPK),
|
EphemeralID = gmser_api_encoder:encode(account_pubkey, EPK),
|
||||||
tell(info, "Got keys ~s, ~s", [PermanentID, EphemeralID]),
|
tell(info, "Got keys ~s, ~s", [PermanentID, EphemeralID]),
|
||||||
|
{tcp_closed, Socket} ->
|
||||||
|
From ! {Ref, {error, tcp_closed}},
|
||||||
|
retire(State, normal, "Handshake died")
|
||||||
|
after 5000 ->
|
||||||
|
From ! {Ref, {error, timeout}},
|
||||||
|
retire(State, normal, "Handshake timed out")
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
||||||
% case is_sus(Challenge) of
|
% case is_sus(Challenge) of
|
||||||
% false ->
|
% false ->
|
||||||
% tell(info, "Not sus"),
|
% tell(info, "Not sus"),
|
||||||
@@ -118,13 +128,6 @@ handshake(State = #s{socket = Socket}, Ref, From, TempKey) ->
|
|||||||
% From ! {Ref, {error, "Challenge was sus."}},
|
% From ! {Ref, {error, "Challenge was sus."}},
|
||||||
% retire(State, normal)
|
% retire(State, normal)
|
||||||
% end;
|
% end;
|
||||||
{tcp_closed, Socket} ->
|
|
||||||
From ! {Ref, {error, tcp_closed}},
|
|
||||||
retire(State, normal, "Handshake died")
|
|
||||||
after 5000 ->
|
|
||||||
From ! {Ref, {error, timeout}},
|
|
||||||
retire(State, normal, "Handshake timed out")
|
|
||||||
end.
|
|
||||||
|
|
||||||
%is_sus(Challenge) ->
|
%is_sus(Challenge) ->
|
||||||
% case string:split(Challenge, "_", all) of
|
% case string:split(Challenge, "_", all) of
|
||||||
|
|||||||
Reference in New Issue
Block a user