-
Notifications
You must be signed in to change notification settings - Fork 425
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
Weird padding calculation for SSU2Session Token Request #2015
Comments
And even more. According https://geti2p.net/spec/proposals/159-ssu2#padding padding data should be random one, but in code we can see |
You are right, minimal size of 1 it not required, it can be zero. |
What about random vs zero padding? |
|
You don't need actual random data there, all zeros are fine. |
I understand, but I mean difference between official specification and implementation. May be update specification then to avoid confusion. |
We have the following code:
i2pd/libi2pd/SSU2Session.cpp
Lines 1151 to 1152 in 6439e22
Here is a CreatePaddingBlock function implementation:
i2pd/libi2pd/SSU2Session.cpp
Lines 2640 to 2650 in 6439e22
So we have the flowing params which are rally a constants:
And I see no way to this condition to mean something - it will never be called
Same for this block
Beside this weirdness it is really confusing why
minSize
value for padding block is 1. According Spec for TokenRequest https://geti2p.net/spec/proposals/159-ssu2#token-request-type-10 Padding block is mandatory (at least not marked as optional), but same time minimal payload size is 8.It looks really contradictory - payload consist of DateTime block (7 bytes) and Padding block (at least 3 bytes). So minimal size should be 10 bytes at least. It mentioned there, what size can be zero, but zero IMO does not mean absence of size field.
Can someone clarify why it working such a tricky way?
PS: also why nothing specified in documentation about padding size should be 0-15? What is really a correct value?
The text was updated successfully, but these errors were encountered: