Skip to content

fix host key verification always passing due to hash() returning a stale digest instead of the updated buffer, add regression test - #84

Merged
byteskeptical merged 10 commits into
byteskeptical:rootfrom
miraz12:helper_hash_fix
Sep 8, 2026
Merged

fix host key verification always passing due to hash() returning a stale digest instead of the updated buffer, add regression test#84
byteskeptical merged 10 commits into
byteskeptical:rootfrom
miraz12:helper_hash_fix

Conversation

@miraz12

@miraz12 miraz12 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #83

…ale digest instead of the updated buffer, add regression test
@miraz12 miraz12 changed the title fix host key verification always passing due to hash() returning a stale digest instead of the updated buffer, add regression test #83 fix host key verification always passing due to hash() returning a stale digest instead of the updated buffer, add regression test Sep 2, 2026
@byteskeptical byteskeptical self-assigned this Sep 7, 2026
@byteskeptical byteskeptical added the bug Something isn't working label Sep 7, 2026
byteskeptical and others added 2 commits September 7, 2026 02:38
…unction str except block, updating expected hash result for get_r_pathed
…ale digest instead of the updated buffer, add regression test
@miraz12

miraz12 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on root, tests pass locally again :)

…ead-only server testing for put, rename and remove. Refactor for a few more tests that could leave lingering artifacts on failure, switching tempfile_containing to a fixture to standarize usage across the test suite. Switching to OSError catch for hash function str handling. Version bump.
…ts in test_put file and moved a line that should have been in part of the test above.
… only defined in the str section yet was being called for file object branches. Use strings for content as tempfile_containing expects and encode for only for hashlib calls.

@byteskeptical byteskeptical left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Overall looks good, ended up adding some additional testing around the hashing function, long overdue. Thanks for the report and PR!

@byteskeptical
byteskeptical merged commit 66974f1 into byteskeptical:root Sep 8, 2026
74 of 76 checks passed
@miraz12

miraz12 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Great! Thank you for your time and hard work on sftpretty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host key verification always passes due to a bug in helpers.hash()

2 participants