Skip to content

use modern API in userauth_keyboard_interactive() - #663

Merged
willco007 merged 15 commits into
libssh2:masterfrom
xalopp:userauth_kdb_new_api
Feb 19, 2022
Merged

willco007 merged 15 commits into
libssh2:masterfrom
xalopp:userauth_kdb_new_api

Conversation

@xalopp

@xalopp xalopp commented Jan 14, 2022

Copy link
Copy Markdown
Contributor

This refactors SSH_MSG_USERAUTH_INFO_REQUEST processing in userauth_keyboard_interactive() in order to improve robustness, correctness and readability or the code.

In order to be able to do unit testing, I moved some portion of the code from src/userauth.c to src/userauth_kbd_packet.c

{FAIL, -38,
"Unable to decode keyboard-interactive number of "
"keyboard prompts"}},
/* to many prompts */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, "to" should be "too"

@willco007

Copy link
Copy Markdown
Member

Looks like there is a linker error that needs to be fixed up; but at first glance this looks great!

@willco007

Copy link
Copy Markdown
Member

The makefile needs to be updated to include userauth_kbd_packet.c, should fix it up.

@xalopp

xalopp commented Jan 15, 2022

Copy link
Copy Markdown
Contributor Author

The makefile needs to be updated to include userauth_kbd_packet.c, should fix it up.

My bad. Totally forgot the autotools build.

@xalopp
xalopp force-pushed the userauth_kdb_new_api branch 7 times, most recently from b6157c7 to cfa3844 Compare January 18, 2022 15:44
@willco007

Copy link
Copy Markdown
Member

@xalopp thank you for your continued patience working on the Windows builds. 👍

@xalopp

xalopp commented Jan 18, 2022

Copy link
Copy Markdown
Contributor Author

@willco007 finally, the build is green 😸

In order to be able to do unit testing, I move some code to src/userauth_kbd_packet.c. This currently adds userauth_keyboard_interactive_decode_info_request to the symbol list of libssh2.a / libssh2.so. Since it's not part of libssh2.h, it's a "unofficial" function that will be part of the API. Not sure if this is a issue.

@xalopp
xalopp marked this pull request as draft January 19, 2022 08:38
@xalopp
xalopp force-pushed the userauth_kdb_new_api branch from f994ba8 to 61c1ed0 Compare January 19, 2022 14:42
@xalopp
xalopp force-pushed the userauth_kdb_new_api branch from 166fb70 to 7f1664c Compare January 20, 2022 11:46
@xalopp
xalopp marked this pull request as ready for review January 26, 2022 19:46
@willco007

Copy link
Copy Markdown
Member

I've looked at this and it looks good to me; anyone else have time to take a look at this?

@willco007
willco007 merged commit 83853f8 into libssh2:master Feb 19, 2022
@xalopp
xalopp deleted the userauth_kdb_new_api branch February 21, 2022 16:22
vszakats pushed a commit that referenced this pull request May 31, 2023
Co-authored-by: Viktor Szakats
Regression from 83853f8 #663
Fixes #1056
lampmanyao pushed a commit to lampmanyao/libssh2 that referenced this pull request Jul 16, 2023
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
vszakats added a commit to vszakats/libssh2 that referenced this pull request Aug 28, 2026
vszakats added a commit that referenced this pull request Aug 28, 2026
To fix unused variable warning with clang-tidy 23.1.0.

Follow-up to 83853f8 #663

Closes #2554
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