fix base64 encoding of key field in config#696
fix base64 encoding of key field in config#696ianmcorvidae merged 1 commit intomeshtastic:masterfrom
Conversation
|
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #696 +/- ##
==========================================
- Coverage 60.62% 60.49% -0.13%
==========================================
Files 24 24
Lines 3774 3782 +8
==========================================
Hits 2288 2288
- Misses 1486 1494 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The security.privateKey and security.publicKey fields are of type bytes, but the protobuf MessageToDict converts them to base64 encoded strings. When importing the config again, this is read as a string, which breaks the import. Instead, the value needs to be prefixed with "base64:", so the type handling logic on import kicks in and decodes the value to a bytes array again. Fixes: meshtastic#678
|
Cool, thanks for the PR! It might be good if we eventually do this for any |
Agree, I had a look into that as well. The root-cause is the type incorrectness of A probably better solution is to interface with the protobuf definitions using the class interface instead of passing around plain dicts. This should conserve all types. But this requires a major refactoring. |
The security.privateKey and security.publicKey fields are of type bytes, but the protobuf MessageToDict converts them to base64 encoded strings. When importing the config again, this is read as a string, which breaks the import. Instead, the value needs to be prefixed with "base64:", so the type handling logic on import kicks in and decodes the value to a bytes array again.
Fixes: #678