anchor.diff:  
   
   select_all(CL, SL) when length(CL) + length(SL) < ?MAX_NUM_ALGORITHMS ->
  -    A = CL -- SL,  %% algortihms only used by client
  +    %% algortihms only used by client
  +    %% NOTE: an algorithm occuring more than once in CL will still be present
  +    %%       in CLonly. This is not a problem for nice clients.
  +    CLonly = CL -- SL,
  +
       %% algorithms used by client and server (client pref)
  -    lists:map(fun(ALG) -> list_to_atom(ALG) end, (CL -- A));
  +    lists:foldr(fun(ALG, Acc) -> 
  +                      try [list_to_existing_atom(ALG) | Acc]
  +                      catch
  +                          %% If an malicious client uses the same non-existing algorithm twice,
  +                          %% we will end up here
  +                          _:_ -> Acc
  +                      end
  +              end, [], (CL -- CLonly));
  +
   select_all(CL, SL) ->
       Error = lists:concat(["Received too many algorithms (",length(CL),"+",length(SL)," >= ",?MAX_NUM_ALGORITHMS,")."]),
       ?DISCONNECT(?SSH_DISCONNECT_PROTOCOL_ERROR,
  
positive.code: sha('curve448-sha512') -> sha512;
  sha(x25519) -> sha256;
  sha(x448) -> sha512;
  sha(Str) when is_list(Str), length(Str)<50 -> sha(list_to_atom(Str)).
  
  
  mac_key_bytes('hmac-sha1')    -> 20;
  
negative.code:     
  valid_key_sha_alg_ec(OID, Alg) -> 
      Curve = public_key:oid2ssh_curvename(OID),
      try Alg == list_to_existing_atom("ecdsa-sha2-" ++ binary_to_list(Curve))
      catch
          _:_ -> false
      end.
      
  
  -dialyzer({no_match, public_algo/1}).
  