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

Client vs server build integrity check + server startup print neo_version info #496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nullsystem
Copy link
Collaborator

@nullsystem nullsystem commented Jul 7, 2024

Description

  • Server now just prints neo_version on startup
  • Server and client long git hashes are now matched up on startup to check build integrity. If they don't, the client cannot connect unless they have matching git hashes.
  • Server convar neo_sv_build_integrity_check to enable/disable this integrity check feature. Enabled by default.
  • Server convar neo_sv_build_integrity_check_allow_debug to enable/disable integrity checking for debug clients. Disabled by default for release builds, enabled by default for debug builds.
    • A warning message will indicate if a client bypassed the checking
    • Debug bypass is determined by the first byte's final bit of (8-bits) char. 1 = debug build, 0 = release build.
    • String matching will first mask out that char so even if neo_sv_build_integrity_check_allow_debug is disabled, a matching git hash between debug client and server can still be matched.

Toolchain

  • Windows MSVC VS2022
  • Linux GCC Distro Native Arch/GCC 14

Linked Issues

Examples

Client-side example of integrity check fail setting bogus "foobar" to trigger it:
clientintegrityfailexample

Server side will log this line:

Dropped PLAYER from server (Build integrity failed! Client vs server mis-match: Check your neo_version. Client: foobar | Server: e266b6d)

@nullsystem nullsystem changed the title Build integrity + server print neo_version info Client vs server build integrity check + server print neo_version info Jul 7, 2024
@nullsystem nullsystem changed the title Client vs server build integrity check + server print neo_version info Client vs server build integrity check + server startup print neo_version info Jul 7, 2024
@nullsystem nullsystem marked this pull request as ready for review July 7, 2024 16:03
@nullsystem nullsystem requested a review from a team July 7, 2024 16:09
@Rainyan
Copy link
Collaborator

Rainyan commented Jul 7, 2024

As a rogue feature request: could we get some kind of "I know what I'm doing, just let me in" magic bit that's automatically toggled if you're trying to join using a debug build, which would completely bypass this? For dev convenience.

This could literally just be a leading/trailing '1'/'0' char bit or whatever.

You could still perhaps make it print a client side DevWarning or something, to reduce the footgun potential.

@nullsystem
Copy link
Collaborator Author

nullsystem commented Jul 7, 2024

@Rainyan Implemented debug integrity bypass now: 44c04c4
Utilizes the first byte, final bit of char/8-bits. 1 = debug, 0 = release

* Server now just prints neo_version on startup
* Server and client long git hashes are now matched up on startup to
  check build integrity. If they don't, the client cannot connect unless
  they have matching git hashes.
* Server convar `neo_sv_build_integrity_check` to enable/disable this
  integrity check feature. Enabled by default.

Debug builds integrity check bypass
* Debug builds will have their first byte final bit fliped to 1 to
  indicate it's a debug build
* This will indicate to the server that it's a debug build and if
  the server allows bypass, then it will
* Mask out final bit before comparison to allow debug build that
  matches hash without first byte final bit

* fixes NeotokyoRebuild#437
* fixes NeotokyoRebuild#485
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants