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

minor: runtime_data: declared checksums structure #532

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

Conversation

SmileyAG
Copy link
Collaborator

@SmileyAG SmileyAG commented Jul 14, 2024

This request does NOT solve the issue, but simply gives it a some start in resolving.

Hashes will be transmitted as strings instead of the hardcoded amount of allocated bytes for them, just so that if something happens we can easily change the hashing algorithm without consequences for this.

On the parser side, we can always check whether the string contains any other characters other than a-F and 0-9 as validity (basically to make sure that this string corresponds to hexadecimal format)

And a simple way on the parser side to determine the type of algorithm is by the number of characters (e.g. MD5 is 128 bit = 128 / 8 = 16 * 2 = 32 characters); this is could be used for comparison with some hardcoded list of hashes in parser side

We also need to return at least the logging name of the server module later, since modules logging was removed with this commit: 1d049ef

I also don’t see much point in logging the names of all loaded modules, but the name of the server module (hl.dll and etc) must be logged for the purpose to working with hardcoded list of hashes (e.g. since list might be formatted in way like: "server_module_name", "md5_hash", "sha1_hash", "sha256_hash")

struct Checksums {
std::string client;
std::string server;
std::string map;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead a map from name to checksum? Then it can have "hl.dll" => checksum, "client.dll" => checksum, and whatever else we may add in the future?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's a really good idea in fact. After all, maybe in the future this field with all the loaded modules will still be needed again, who knows, so it's better not to re-use it again just for this.

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.

2 participants