-
Notifications
You must be signed in to change notification settings - Fork 284
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
Make bootstrap daemon use toxcore's version #875
Conversation
|
You are overcomplicating the issue. Previously it used to be Don't forget you are not the only one who is implementing toxcore. These changes are changes in protocol and must be discussed with all implementors of tox. |
The bootstrap Daemon version response isn't part of the specified protocol. It should be, but until then the implementation is the definition. I think we can make this change and then write it down so others can implement it. |
That is not the reason to make your implementation become the part of the specified protocol since there are a lot of programs that check the version of tox with the given packet. You are going to break them. Why? My suggestion is to write down a document that standardize the current situation. If 4 bytes is not enough for you we may keep 128 bytes of version info. Please stop juggling with bits and bytes. You have done enough which led to #873 |
Yes, agree. We should make sure those programs support the new version format before releasing this change. Do you know of other programs besides the node list? |
https://github.com/irungentoo/toxcore/blob/master/other/fun/bootstrap_node_info.py The vulnerability was found in tox-rs/tox, as it was described by Evgeniy in #873. You are not the only one implementors of tox in the world. |
Right, I could update it like that, but it would be more meaningful if the version reflected the toxcore version instead. The daemon usually doesn't change much at all, it can stay for a year without a single change aside from refactoring, yet toxcore changes a lot faster and changes the daemon's behavior, like the recent DHT changes in toxcore aimed to reduce the bandwidth consumption.
It would make sense to extend the daemon's version information to include daemon name and version and the name and version of the toxcore implementation it uses then. Don't think this is going to fit into 4 bytes though, we'd likely need some string for that, so some spec change is needed.
Are you asking everyone to stop coding? Now that's rude and inappropriate of you. |
Would you please do it!
Then let's do it! Make 2 new packets, call them REQ_VERSION, RESP_VERSION, let them be in semver syntax (128 bytes) + date + 128 byte comment. What stops you from making things like that? |
The bootstrap version is defined just as a 32 bit word in the spec, the spec doesn't specify versioning scheme, it's up to an implementation, it could be anything, there could be another bootstrap daemon implementation somewhere that doesn't follow tox-boostrapd's versioning scheme of |
So will you update docs according to your PR or no? If you will not then it is fine for you to make any changes. Have fun! |
This field seems to specify only informational stuff and not something code should depend on (yet), so I think @nurupo is right that it should be mostly human readable. In a future version I'd like to have a better specified versioning scheme + a comment/implementation name string. |
I don't think that there is anything that stops anyone from proposing changes to the spec. Is there?
If what you want is to improve the spec by making the definition of a bootstrap version more detailed than a 32 bit word, i.e. define the exact versioning scheme that all bootstrap daemons need to follow, instead of leaving it up to an implementation, or define a new bootstrap version packet, you should open a discussion/proposal thread against the spec repository and discuss it in there, instead of discussing it in a PR that makes a spec compatible and non-breaking change to an implementation of a bootstrap daemon. What stops you from doing that? |
Reviewed 1 of 1 files at r1. Comments from Reviewable |
This is compliant with the spec as written. Reviewed 1 of 1 files at r1. Comments from Reviewable |
Please rebase onto master and optionally fast-forward master onto it. |
@iphydf rebased. |
v0.2.3 **Merged PRs:** - [TokTok#951] Only run astyle if the astyle binary exists. - [TokTok#950] Remove utils.c and utils.h from toxencryptsave build. - [TokTok#949] Fixes to the imported sodium sources to compile without warnings. - [TokTok#948] Add a MAX_HOSTNAME_LENGTH constant. - [TokTok#947] Remove the format test. - [TokTok#937] Add new Circle CI configuration. - [TokTok#935] Add a test for double conference invite. - [TokTok#933] Add Logger to various net_crypto functions, and add `const` to Logger where possible. - [TokTok#931] Avoid conditional-uninitialised warning for tcp test. - [TokTok#930] Disable UDP when proxy is enabled. - [TokTok#928] Use clang-format for C++ code. - [TokTok#927] Add assertions to bootstrap tests for correct connection type. - [TokTok#926] Make NULL options behave the same as default options. - [TokTok#925] Add tests for what happens when passing an invalid proxy host. - [TokTok#924] Make the net_crypto connection state an enum. - [TokTok#922] Clarify/Improve test_some test - [TokTok#921] Beginnings of a TCP_test.c overhaul - [TokTok#920] Add test for creating multiple conferences in one tox. - [TokTok#918] Merge irungentoo/master into toktok - [TokTok#917] Add random testing program. - [TokTok#916] Fix linking with address sanitizer. - [TokTok#915] Remove resource_leak_test. - [TokTok#914] Make dht_test more stable. - [TokTok#913] Minor cleanup: return early on error condition. - [TokTok#906] Sort bazel build file according to buildifier standard. - [TokTok#905] In DEBUG mode, make toxcore crash on signed integer overflow. - [TokTok#902] Log only the filename, not the full path in LOGGER. - [TokTok#899] Fix macOS macro because of GNU Mach - [TokTok#898] Fix enumeration of Crypto_Connection instances - [TokTok#897] Fix ipport_isset: port 0 is not a valid port. - [TokTok#894] Fix logging related crash in bootstrap node - [TokTok#893] Fix bootstrap crashes, still - [TokTok#892] Add empty logger to DHT bootstrap daemons. - [TokTok#887] Fix FreeBSD build on Travis - [TokTok#884] Fix the often call of event tox_friend_connection_status - [TokTok#883] Make toxcore compile on BSD - [TokTok#878] fix DHT_bootstrap key loading - [TokTok#877] Add minitox to under "Other resources" section in the README - [TokTok#875] Make bootstrap daemon use toxcore's version - [TokTok#867] Improve network error reporting on Windows - [TokTok#841] Only check full rtp offset if RTP_LARGE_FRAME is set - [TokTok#823] Finish @Diadlo's network Family abstraction. - [TokTok#822] Move system header includes from network.h to network.c
v0.2.3 **Merged PRs:** - [TokTok#951] Only run astyle if the astyle binary exists. - [TokTok#950] Remove utils.c and utils.h from toxencryptsave build. - [TokTok#949] Fixes to the imported sodium sources to compile without warnings. - [TokTok#948] Add a MAX_HOSTNAME_LENGTH constant. - [TokTok#947] Remove the format test. - [TokTok#937] Add new Circle CI configuration. - [TokTok#935] Add a test for double conference invite. - [TokTok#933] Add Logger to various net_crypto functions, and add `const` to Logger where possible. - [TokTok#931] Avoid conditional-uninitialised warning for tcp test. - [TokTok#930] Disable UDP when proxy is enabled. - [TokTok#928] Use clang-format for C++ code. - [TokTok#927] Add assertions to bootstrap tests for correct connection type. - [TokTok#926] Make NULL options behave the same as default options. - [TokTok#925] Add tests for what happens when passing an invalid proxy host. - [TokTok#924] Make the net_crypto connection state an enum. - [TokTok#922] Clarify/Improve test_some test - [TokTok#921] Beginnings of a TCP_test.c overhaul - [TokTok#920] Add test for creating multiple conferences in one tox. - [TokTok#918] Merge irungentoo/master into toktok - [TokTok#917] Add random testing program. - [TokTok#916] Fix linking with address sanitizer. - [TokTok#915] Remove resource_leak_test. - [TokTok#914] Make dht_test more stable. - [TokTok#913] Minor cleanup: return early on error condition. - [TokTok#906] Sort bazel build file according to buildifier standard. - [TokTok#905] In DEBUG mode, make toxcore crash on signed integer overflow. - [TokTok#902] Log only the filename, not the full path in LOGGER. - [TokTok#899] Fix macOS macro because of GNU Mach - [TokTok#898] Fix enumeration of Crypto_Connection instances - [TokTok#897] Fix ipport_isset: port 0 is not a valid port. - [TokTok#894] Fix logging related crash in bootstrap node - [TokTok#893] Fix bootstrap crashes, still - [TokTok#892] Add empty logger to DHT bootstrap daemons. - [TokTok#887] Fix FreeBSD build on Travis - [TokTok#884] Fix the often call of event tox_friend_connection_status - [TokTok#883] Make toxcore compile on BSD - [TokTok#878] fix DHT_bootstrap key loading - [TokTok#877] Add minitox to under "Other resources" section in the README - [TokTok#875] Make bootstrap daemon use toxcore's version - [TokTok#867] Improve network error reporting on Windows - [TokTok#841] Only check full rtp offset if RTP_LARGE_FRAME is set - [TokTok#823] Finish @Diadlo's network Family abstraction. - [TokTok#822] Move system header includes from network.h to network.c
I have wanted to make the daemon report toxcore's version for quite a bit now, and here I finally I got around to doing this. The main motivation for this was the onion vulnerability #873. To fix the vulnerability, all DHT nodes should be updated to the new upcoming toxcore version. Reporting toxcore version in the bootstrap daemon would enable us to see at the very least if the bootstrap nodes are updated, my main interest being the the nodes that are listed on the https://nodes.tox.chat page which displays the daemon version of the nodes.
The daemon version is just a
uint32_t
, there is not much you can encode in 4 bytes. I have been thinking of packing the toxcore version into thatuint32_t
, 1 byte for major, 1 byte for minor, 1 byte for patch and 1 byte for misc: bit indicating that this is a new version scheme, a bit indicating that the daemon was build using a release checkpoint of toxcore rather than an in-development (there might be big differences between 2.x.y release and the same 2.x.y right before the version bump, containing all the changes for the next version). Such version encoding would be inconsistent with the previous one ofYYYYMMDD
, which you could print out as an number to show the version to the user, which is what nodes.tox.chat and a few other scrips do. With the packed version encoding the version would need to be decoded first, if you print theuint32_t
as it is, it won't make sense. So to keep the compatibility with the way the daemon version is being printed by others I settled on a1AAABBBCCC
format, whereAAA
is the major version,BBB
is the minor version andCCC
is the patch version, all capped at 999. The leading 1 is just so that the leading zeros wouldn't get removed when printing it as a number, e.g. instead of0.2.1
being printed as2001
, it would be printed as1000002001
, i.e. 000.002.001.This change is