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

Fix intermediate session id preauth tracking #203

Merged
merged 1 commit into from
Nov 8, 2022
Merged

Conversation

jborean93
Copy link
Owner

On some hosts, the SESSION_SETUP_RESPONSE message that are not complete may not set the new session id on the response. This causes problems when the session is finalised as it tries to lookup the session based on the session id allocated in the last message which won't line up with any intermediate messages with a session id of 0.

The fix is to not update the session id tracker for the first SESSION_SETUP_RESPONSE message but rather the last message where the session id will actually be allocated.

Fixes: #193

@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #203 (d38d6c1) into master (f1ca936) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #203   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files          24       24           
  Lines        5082     5082           
=======================================
  Hits         5035     5035           
  Misses         47       47           
Flag Coverage Δ
99.07% <100.00%> (ø)
py3.10 99.03% <100.00%> (ø)
py3.11 99.03% <100.00%> (ø)
py3.7 99.03% <100.00%> (ø)
py3.8 99.03% <100.00%> (ø)
py3.9 99.07% <100.00%> (ø)
x64 99.07% <100.00%> (ø)
x86 98.99% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/smbprotocol/session.py 95.18% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

On some hosts, the SESSION_SETUP_RESPONSE message that are not complete
may not set the new session id on the response. This causes problems
when the session is finalised as it tries to lookup the session based on
the session id allocated in the last message which won't line up with
any intermediate messages with a session id of 0.

The fix is to not update the session id tracker for the first
SESSION_SETUP_RESPONSE message but rather the last message where the
session id will actually be allocated.
@jborean93 jborean93 merged commit cb0f3a1 into master Nov 8, 2022
@jborean93 jborean93 deleted the no-session-id branch November 8, 2022 22:18
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.

session_id problem : KeyError: 8873498640803430656
1 participant