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 negotiate request context padding #201

Merged
merged 1 commit into from
Nov 6, 2022
Merged

Conversation

jborean93
Copy link
Owner

When using a negotiate request with a hostname that is a multiple of 8 bytes the code will add 8 extra padding bytes. While this works on some servers others are stricter and can fail the request. This commit fixes up the padding to ensure no padding is used if the length of a context request aligns with the 8 byte boundary it is in.

Fixes: #199

When using a negotiate request with a hostname that is a multiple of 8
bytes the code will add 8 extra padding bytes. While this works on some
servers others are stricter and can fail the request. This commit fixes
up the padding to ensure no padding is used if the length of a context
request aligns with the 8 byte boundary it is in.
@codecov
Copy link

codecov bot commented Nov 6, 2022

Codecov Report

Merging #201 (4c7bfde) into master (dabafb9) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
- Coverage   99.09%   99.09%   -0.01%     
==========================================
  Files          24       24              
  Lines        5079     5077       -2     
==========================================
- Hits         5033     5031       -2     
  Misses         46       46              
Flag Coverage Δ
macOS 68.20% <100.00%> (+0.02%) ⬆️
py3.10 99.07% <100.00%> (-0.01%) ⬇️
py3.7 99.07% <100.00%> (-0.01%) ⬇️
py3.8 99.07% <100.00%> (-0.01%) ⬇️
py3.9 99.09% <100.00%> (-0.01%) ⬇️
ubuntu 96.78% <100.00%> (-0.01%) ⬇️
windows 99.01% <100.00%> (-0.01%) ⬇️
x64 99.09% <100.00%> (-0.01%) ⬇️
x86 99.01% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/smbprotocol/connection.py 99.84% <100.00%> (-0.01%) ⬇️

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

@jborean93 jborean93 merged commit 53fb439 into master Nov 6, 2022
@jborean93 jborean93 deleted the negotiate-padding branch November 6, 2022 20:15
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.

smbprotocol.exceptions.InvalidParameter from ubuntu to synology nas
1 participant