anchor.diff:      {reply, {error, authentication_needed}, waiting_for_reject, State};
   
   waiting_for_reject(auth, {_Pid, Tag}=From, #state{waiting=Waiting}=State) ->
  -    {reply, {ok, {self(), Tag}}, waiting_for_reject, 
  -     State#state{waiting=[From|Waiting]}};
  +    {reply, {ok, {self(), Tag}}, waiting_for_reject, State#state{waiting=[From|Waiting]}};
   waiting_for_reject(_Evt, _From, State) ->
       ?debug("Unexpected event: ~p~n", [_Evt]),
       {reply, {error, invalid_event}, waiting_for_reject, State}.
  
positive.code: strip_eol(<<C:8, Rest/binary>>, Acc) ->
      strip_eol(Rest, <<C, Acc/binary>>).
  
  parse_mechs(<<>>) ->
      {error, invalid_mechanisms};
  parse_mechs(<<$\s, Rest/bits>>) ->
      parse_mechs(Rest);
  parse_mechs(Bin) ->
      parse_mech(Bin, <<>>, []).
  
  parse_mech(<<>>, SoFar, Mechs) ->
      case valid_mech(SoFar) of
          {ok, Mod} -> lists:reverse([Mod | Mechs]);
          error -> {error, {unsupported_mechanism, SoFar}}
      end;
  parse_mech(<<$\s, Rest/bits>>, SoFar, Mechs) ->
      parse_mech(Rest, SoFar, Mechs);
  parse_mech(<<C:8, Rest/bits>>, SoFar, Mechs) ->
      parse_mech(Rest, << SoFar/binary, C>>, Mechs).
  
  valid_mech(<<"DBUS_COOKIE_SHA1">>) -> {ok, bus_auth_cookie_sha1};
  valid_mech(<<"EXTERNAL">>) -> {ok, dbus_auth_external};
  valid_mech(<<"KERBEROS_V4">>) -> error;
  valid_mech(<<"SKEY">>) -> error;
  valid_mech(_) -> error.
  
negative.code:             {next_state, authenticated, State#state{waiting=[], guid=Guid, unix_fd=false}}
      end;
  
  handle_info({received, <<"REJECTED ", _Line/binary>>}, StateName, #state{mechs=[]}=State) 
    when StateName =:= waiting_for_ok; StateName =:= waiting_for_data ->
      ?error("No more authentication mechanisms", []),
      {stop, disconnect, State};
  
  handle_info({received, <<"REJECTED ", _Line/binary>>}, StateName, #state{sock=Sock, mechs=[Mech|Rest]}=State) 
    when StateName =:= waiting_for_ok; StateName =:= waiting_for_data ->
      ?debug("Trying next authentication mechanism~n", []),
      case Mech:init() of 
  