According to http://www.libssh2.org/libssh2_hostkey_hash.html, a raw binary string is returned. If I understand it correctly, the string may include non-terminating null characters. So yes, I guess the code is broken in Python 2 if the host key contains a null byte. Or did I miss something?

I will update the pull request splitting in two commits.