Handle failed decrypts in handshake

This commit is contained in:
Hans Svensson
2018-04-25 09:37:26 +02:00
parent a484d14c41
commit a024fc4dc9
2 changed files with 12 additions and 5 deletions
+6 -2
View File
@@ -181,8 +181,12 @@ do_handshake(HState, ComState, Timeout) ->
in ->
case hs_recv_msg(ComState, Timeout) of
{ok, Data, ComState1} ->
{ok, HState1, _Msg} = enoise_hs_state:read_message(HState, Data),
do_handshake(HState1, ComState1, Timeout);
case enoise_hs_state:read_message(HState, Data) of
{ok, HState1, _Msg} ->
do_handshake(HState1, ComState1, Timeout);
Err = {error, _} ->
Err
end;
Err = {error, _} ->
Err
end;