Skip to content

Add negative test case for CheckPasswordHashUnix#914

Open
padelsbach wants to merge 1 commit intowolfSSL:masterfrom
padelsbach:negative-test-cases
Open

Add negative test case for CheckPasswordHashUnix#914
padelsbach wants to merge 1 commit intowolfSSL:masterfrom
padelsbach:negative-test-cases

Conversation

@padelsbach
Copy link
Copy Markdown
Contributor

@padelsbach padelsbach commented Apr 13, 2026

Fixes F-2489

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #914

Scan targets checked: wolfssh-bugs, wolfssh-compliance, wolfssh-defaults, wolfssh-mutation, wolfssh-proptest, wolfssh-src, wolfssh-zeroize

No new issues found in the changed files. ✅

@padelsbach padelsbach marked this pull request as ready for review April 13, 2026 21:42
@ejohnstown ejohnstown requested a review from Copilot April 15, 2026 16:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a targeted negative-path unit test for Unix password hash checking to prevent regressions in the constant-time comparison logic.

Changes:

  • Introduces a new unit test test_CheckPasswordHashUnix() that validates both acceptance and rejection paths using crypt().
  • Exposes CheckPasswordHashUnix() for unit tests via WOLFSSHD_UNIT_TEST and moves auth success/failure constants to auth.h.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/wolfsshd/test/test_configuration.c Adds a new negative-path unit test for Unix password hash verification and required includes/feature macros.
apps/wolfsshd/auth.h Exposes auth result constants and declares CheckPasswordHashUnix() for unit tests.
apps/wolfsshd/auth.c Makes CheckPasswordHashUnix() non-static under WOLFSSHD_UNIT_TEST so the test can link to it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/wolfsshd/test/test_configuration.c Outdated
Comment thread apps/wolfsshd/test/test_configuration.c
@padelsbach padelsbach force-pushed the negative-test-cases branch from afcda8b to 6d31d73 Compare April 15, 2026 17:57
@ejohnstown ejohnstown self-requested a review April 16, 2026 15:36
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.

4 participants