sidorares/node-dbus — pull request #46 by gfxmonk (2014-11-02 11:16:04+00:00)
Title: Fix a number of issues in handshake code

The existing code:
- tries to use an `undefined` auth method if it tried all the available methods without success
- silently does nothing (i.e never proceeds) if it encounters an unknown auth method (like `undefined` ;))
- sends a new NUL byte before attempting _each_ auth method, while the spec (from http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol-overview) says that it should only send one in total:

> Immediately after connecting to the server, the client must send a single nul byte. [ ... ]
> A nul byte in any context other than the initial byte is an error; the protocol is ASCII-only.