2009/11/25 Dave McCaldon <[email protected]>:
> The patch adds an error code, LIBSSH2_ERROR_AUTHORIZATION_FAILED (which is 
> actually an alias for LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED, returned in 
> libssh2_userauth_publickey_fromfile() to maintain backward compatibility) 
> which is returned in the case of SSH_MSG_USERAUTH_FAILURE (this is the same 
> as the logic in libssh2_userauth_publickey_fromfile() that handles an 
> unrecognized public key).

Something about the idea of aliasing the error codes bothers me.
Currently, they uniquely identify the type of error that occurred and
so can be used as an index into, for instance, a lookup table of error
messages.

Or are you suggesting that all authentication failures (as opposed to
other errors such as sending failures) should share an error code
regardless of the authentication method used?  If so, I may agree with
this as I see the logic that these errors are the authentication
results and therefore of the same 'type'.  However, in this case we
should remove all references to LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED,
except the #define for backward-compatibility, and replace them with
LIBSSH2_ERROR_AUTHORIZATION_FAILED.  Also,
userauth_keyboard_interactive() needs a similar else block adding and
maybe LIBSSH2_ERROR_PUBLICKEY_UNRECOGNISED needs replacing as well.

Alex
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to