fix: correct truncated legacy fingerprint lookup table#24
Merged
Conversation
Contributor
Author
|
see also: lircy/S7CommPlusV3Driver#1 (comment) |
Contributor
Author
|
can you create a new release after merge? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24 +/- ##
=======================================
Coverage 98.82% 98.82%
=======================================
Files 69 69
Lines 57383 57383
Branches 290 290
=======================================
Hits 56709 56709
Misses 520 520
Partials 154 154 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Legacy session-key renewal could throw IndexOutOfRangeException in FingerprintSubProcedure when a challenge selected the final lookup block. Data2Collection table 1 contained 4222 bytes although its 33 operations require 4224 bytes. Restore the missing final lookup word 0x4C28. The captured renewal challenge 5B15B4694FC38A775E6778F0770C6E7A3118200D now derives fingerprint 6AB5811DE6D28746 and can complete authentication instead of terminating the connection. Add a lookup-table size invariant and an exact regression test for the captured challenge. Bump the package, assembly, and file versions to 1.1.3 and document the fix in the package release notes.
Contributor
Author
|
@bonk-dev FYI: I've included your lib into my S7CommPlus fork |
Owner
I've set up automatic nuget publishing, so every merge now pushes the nugets, as long as you bump the package version. |
gijzelaerr
added a commit
to gijzelaerr/python-snap7
that referenced
this pull request
Jul 16, 2026
Data2Collection table 1 had 2111 entries (4222 bytes) but its 33 operations require 2112 entries (4224 bytes). The missing final word 0x4C28 caused IndexError during session key renewal when a challenge selected the last lookup block. Backported from HarpoS7 commit 22b9dc0 (bonk-dev/HarpoS7#24). Adds: - The missing 0x4C28 entry in fp_data2.bin - Lookup table size invariant test - Regression test with captured renewal challenge 5B15B469... Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix a rare failure during legacy S7CommPlus session-key renewal.
Certain PLC challenges selected the final block of a fingerprint lookup table. The table was two bytes too short, causing
FingerprintSubProcedureto throw anIndexOutOfRangeExceptionand terminate the connection.Root cause
Data2Collection[1]contained 4,222 bytes, while its 33 fingerprint operations require 4,224 bytes:The missing final lookup word is
0x4C28.Changes
Data2Collection[1]with the missing0x4C28word.5B15B4694FC38A775E6778F0770C6E7A3118200D6AB5811DE6D28746Verification
No PLC tags were written during testing.