Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

wez
Copy link
Collaborator

@wez wez commented Jul 24, 2019

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

@wez wez force-pushed the kbdauth branch 5 times, most recently from 6571048 to 6d1ca83 Compare July 29, 2019 16:02
@@ -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(
Copy link
Collaborator Author

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"
Copy link
Collaborator Author

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

Copy link
Owner

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
@wez
Copy link
Collaborator Author

wez commented Jul 31, 2019

@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 libssh2-sys to unblock releasing a new ssh2 crate; I've just run cargo publish --dry-run for libssh2-sys and it looks like all you need to do is run the publish for real when you have a moment to review and run it.

@wez wez closed this Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants