handshake: throw error when no authentication methods left
handshake: only send one nul byte
handshake: log error on unsupported auth method
Merge pull request #46 from gfxmonk/handshake

Fix a number of issues in handshake code