-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Allows all 3 PKI keys to be added to userPrefs.h (#4969) and a tool. #5368
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ec7b453
more userPrefs.h
gjelsoe 06ae40a
Update userPrefs.h
gjelsoe 90974f3
Merge branch 'meshtastic:master' into adminKeys
gjelsoe dbab5d7
Update NodeDB.cpp
gjelsoe d749e06
Update userPrefs.h
gjelsoe 27ad704
Create base64_to_hex.py
gjelsoe 19e563f
more userPrefs.h
gjelsoe 4b0fc47
Update userPrefs.h
gjelsoe 65f91b8
Update NodeDB.cpp
gjelsoe 108fb1f
Update userPrefs.h
gjelsoe 4711eed
Create base64_to_hex.py
gjelsoe 540dc27
Merge branch 'adminKeys' of https://github.com/gjelsoe/firmware into …
gjelsoe f255b0a
Merge branch 'master' into adminKeys
gjelsoe 39fb139
Merge branch 'meshtastic:master' into adminKeys
gjelsoe d8f20d5
Merge branch 'adminKeys' of https://github.com/gjelsoe/firmware into …
gjelsoe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import sys | ||
| import base64 | ||
|
|
||
| def base64_to_hex_string(b64_string): | ||
| try: | ||
| # Decode the Base64 string to raw bytes | ||
| decoded_bytes = base64.b64decode(b64_string) | ||
| except Exception as e: | ||
| raise ValueError(f"Invalid Base64 input: {e}") | ||
|
|
||
| # Check if the decoded result is exactly 32 bytes | ||
| if len(decoded_bytes) != 32: | ||
| raise ValueError("Decoded Base64 input must be exactly 32 bytes.") | ||
|
|
||
| # Convert each byte to its hex representation | ||
| hex_values = [f"0x{byte:02x}" for byte in decoded_bytes] | ||
|
|
||
| # Join the formatted hex values with commas | ||
| formatted_output = "{ " + ", ".join(hex_values) + " };" | ||
| return formatted_output | ||
|
|
||
| if __name__ == "__main__": | ||
| # Check if a Base64 string was provided in command line arguments | ||
| if len(sys.argv) != 2: | ||
| print("Usage: python script.py <base64-string>") | ||
| sys.exit(1) | ||
|
|
||
| b64_string = sys.argv[1] | ||
| try: | ||
| formatted_hex = base64_to_hex_string(b64_string) | ||
| print(formatted_hex) | ||
| except ValueError as e: | ||
| print(e) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.