Skip to content
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

RFC-4256 Keyboard-Interactive authentication #763

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LinuxJedi
Copy link
Member

This implements Keyboard-Interactive authentication.

Adds an additional callback set by wolfSSH_KeyboarAuthPrompts() which will set a callback in the server to ask the application to provide the prompt details for the client.

@LinuxJedi LinuxJedi force-pushed the RFC-4256 branch 5 times, most recently from bab5784 to 9e7bd3f Compare January 31, 2025 20:36
@LinuxJedi LinuxJedi marked this pull request as draft January 31, 2025 20:49
@LinuxJedi LinuxJedi force-pushed the RFC-4256 branch 3 times, most recently from d385689 to 8d1a669 Compare February 3, 2025 08:37
@LinuxJedi LinuxJedi marked this pull request as ready for review February 3, 2025 08:55
@LinuxJedi LinuxJedi force-pushed the RFC-4256 branch 5 times, most recently from 5f68a6c to 4f65c0b Compare February 4, 2025 15:32
@LinuxJedi
Copy link
Member Author

Added additional packet checks and an additional test.

@LinuxJedi LinuxJedi force-pushed the RFC-4256 branch 2 times, most recently from 8ee69de to de0f986 Compare February 4, 2025 17:05
@dgarske dgarske requested a review from ejohnstown February 4, 2025 17:25
@LinuxJedi LinuxJedi force-pushed the RFC-4256 branch 2 times, most recently from fbef091 to 7ea9f8f Compare February 5, 2025 13:18
src/internal.c Outdated
if (ssh == NULL || output == NULL || idx == NULL || authData == NULL)
ret = WS_BAD_ARGUMENT;

if (authData->sf.keyboard.promptCount != authData->sf.keyboard.responseCount) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If authData is NULL, ret is set to the error code, but we'll still dereference it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I ran my work from #769 and found another one too. Both fixed.

src/internal.c Outdated
@@ -7526,6 +7685,10 @@ static int DoUserAuthFailure(WOLFSSH* ssh,
ret = SendUserAuthRequest(ssh, authType, 0);
}

if ((ret == WS_SUCCESS) && (authType & WOLFSSH_USERAUTH_KEYBOARD)) {
//ret = SendUserAuthKeyboard(ssh, authType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't use C++ comments.

Copy link
Member Author

Choose a reason for hiding this comment

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

Doh! That shouldn't be there at all, I thought I had removed it already.

This implements Keyboard-Interactive authentication.

Adds an additional callback set by `wolfSSH_KeyboarAuthPrompts()` which
will set a callback in the server to ask the application to provide the
prompt details for the client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants