Skip to content

Commit

Permalink
Merge pull request #696 from fmoessbauer/master
Browse files Browse the repository at this point in the history
fix base64 encoding of key field in config
  • Loading branch information
ianmcorvidae authored Oct 18, 2024
2 parents da7fa31 + dfaf1a2 commit feca49f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,15 @@ def export_config(interface):
prefs[meshtastic.util.snake_to_camel(pref)] = config[pref]
else:
prefs[pref] = config[pref]
# mark base64 encoded fields as such
if pref == "security":
if 'privateKey' in prefs[pref]:
prefs[pref]['privateKey'] = 'base64:' + prefs[pref]['privateKey']
if 'publicKey' in prefs[pref]:
prefs[pref]['publicKey'] = 'base64:' + prefs[pref]['publicKey']
if 'adminKey' in prefs[pref]:
for i in range(len(prefs[pref]['adminKey'])):
prefs[pref]['adminKey'][i] = 'base64:' + prefs[pref]['adminKey'][i]
if mt_config.camel_case:
configObj["config"] = config
else:
Expand Down

0 comments on commit feca49f

Please sign in to comment.