On Jan 15, 2010, at 9:02 AM, Dave McCaldon wrote:
> On Jan 15, 2010, at 6:26 AM, Alexander Lamaison wrote:
>
>> 2010/1/15 Peter Stuge <peter_at_stuge.se>:
>>> So the problem we are facing is that we should actually rename
>>> LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED to something like
>>> LIBSSH2_ERROR_AUTHENTICATION_FAILED and use that error code for
>>> all failed authentication attempts, regardless of the method used.
>>>
>>> Can we do this rename? It means changing the API. We could keep a
>>> backwards-compatible alias define and mark _PUBLICKEY_UNRECOGNIZED
>>> as deprecated, I guess that is as good as it gets?
>>
>> As long as we do the backwards-compatibility alias, it doesn't even
>> change the API. The other authentication functions didn't specify
>> error values.
>
> Yes, my patch added LIBSSH2_ERROR_AUTHENTICATION_FAILED with the same value as LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED.
>
>> ... Which brings me to libssh2_userauth_keyboard_interactive_ex. This
>> needs to be given the same treatment as
>> libssh2_userauth_password_ex().
>
> Absolutely.
>
> Now, what's the best patch format? A git patch from my copy of the repo? or a plain/regular diff?
Attached is a git patch that implements handling of SSH_MSG_USERAUTH_FAILURE in both libssh2_userauth_password_ex() and libssh2_userauth_keyboard_interactive_ex(). The error code returned, is LIBSSH2_ERROR_AUTHENTICATION_FAILED and as discussed it replaces LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED, but leaves LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED as an alias for LIBSSH2_ERROR_AUTHENTICATION_FAILED.
Please let me know if there are any problems!
Thanks.
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel