-
Notifications
You must be signed in to change notification settings - Fork 154
Support keyboard-interactive authentication #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6571048
to
6d1ca83
Compare
@@ -248,6 +248,30 @@ pub type LIBSSH2_PASSWD_CHANGEREQ_FUNC = extern "C" fn( | |||
abstrakt: *mut *mut c_void, | |||
); | |||
|
|||
pub type LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC = extern "C" fn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton here's another libssh2-sys
change; this one exposes keyboard interactive authentication types
.skip_fn(|f| { | ||
f == "libssh2_userauth_password_ex" | ||
|| f == "libssh2_session_init_ex" | ||
|| f == "libssh2_userauth_keyboard_interactive_ex" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton systest seems to not like the callback types, so I added this to the skip list here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ,that seems fine so long as it's been manually verified
Increase the level of diagnostics in the hope that we learn more about what's happening with the failure on travis: https://travis-ci.com/alexcrichton/ssh2-rs/jobs/221391881
@alexcrichton I'm going to merge even though you haven't explicitly approved it because I don't think it is contentious to do so; hope you don't mind! (The CI is actually green; it shows as red because rust-lang/rust#63115 has broken nightly rust, but the stable builds are good) We'll need you to make a release of |
There's magic happening in the systest stuff that I couldn't trace; I couldn't find information on how it generates the C code that it compiles, and it seems to trip over the other existing function types, so I arranged for those that I added here to be skipped too.
For the prompt callback; I chose to implement this using a trait object. This is a combination of flexible and more easily documentable. My use case is embedding this into a terminal emulator and I'd like to be able to associate the callback and prompt information with the relevant portion of the UI, so having that context available is highly desirable.
I've included an integration test that shows that things basically work, although we can't have the test end-to-end successfully use interactive auth because we don't know the password of the user running the test(!)
#65