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

Add handling of hex encoded key to realm-trawler #6264

Merged
merged 5 commits into from
Feb 7, 2023

Conversation

finnschiermer
Copy link
Contributor

@finnschiermer finnschiermer commented Feb 2, 2023

What, How & Why?

Add a new option "--hexkey <the-very-long-key>" to realm-trawler.
This option allows the trawler to get the key to an encrypted realm directly on the command line instead of via a binary file.

@finnschiermer finnschiermer force-pushed the fsa/trawler-handles-hexkeyformat branch from 541b0f7 to c590514 Compare February 2, 2023 12:42
@@ -1036,6 +1044,42 @@ void RealmFile::changes() const
}
}

bool is_hex(char c)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not used

std::ifstream key_file(argv[curr_arg + 1]);
key_file.read(key, sizeof(key));
key_ptr = key;
curr_arg++;
}
else if (strcmp(argv[curr_arg], "--hexkey") == 0) {
curr_arg++;
const char* chars = argv[curr_arg];
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should have a check on the length here.

return (hex_char_to_bin(first) << 4) | hex_char_to_bin(second);
}

char to_hex_char(char c)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not used

Copy link
Contributor

@jedelbo jedelbo left a comment

Choose a reason for hiding this comment

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

Awesome

@finnschiermer finnschiermer merged commit 5c34f92 into master Feb 7, 2023
@finnschiermer finnschiermer deleted the fsa/trawler-handles-hexkeyformat branch February 7, 2023 12:30
@kiburtse kiburtse mentioned this pull request Mar 3, 2023
3 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants