mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-14 12:52:03 +10:00
Add UI for setting repeater identity keys
This adds a simple UI in repeater management settings for remotely setting a repeater's private key. A key can be pasted from an external key generator, or a random one can be generated here, optionally with a specified prefix. If a prefix is specified, searching is done in 30ms batches in order to keep the UI responsive and show the progress indicator animation smoothly. Searches can be interrupted. An estimation of search length is given as expected number of generated key pairs. (A future improvement would be to observe keys per second performance and give time estimates based on that.) When it generates a new private key on your behalf, it can tell you what the corresponding public key will be. Unfortunately, if you paste one in from another source, it can't compute the corresponding public key. This is because the standard Dart crypto library doesn't provide that capability, nor does it give access to the elliptic curve functions it implements so we could do it ourselves. Our only recourse would be to copy the source for all those things, and I didn't think it was worth it. This will not check the validity of a pasted key, but the remote repeater will. It does limit it to the correct length and hexadecimal charset. Prefixes are limited to 4 characters. There's no technical reason for this, but users are unlikely to want more, and I think it would just be a bad experience to allow more and spin for a very long time. If someone really wants a longer one, they can use an external generator like they do now. Possible TODO: rewrite background processing using isolates. Closes #142.
This commit is contained in:
@@ -2636,6 +2636,41 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
String get repeater_pathHashModeHelper =>
|
||||
'Byte utilizzati per codificare l\'ID di questo ripetitore nei tag per il rilevamento del percorso/loop. 0=1 byte (256 ID, fino a 64 salti), 1=2 byte (65.000 ID, fino a 32 salti), 2=3 byte (16 milioni di ID, fino a 21 salti). Le versioni 1.13 e precedenti utilizzano percorsi multi-byte: è necessario attivare la rete prima di utilizzare questa funzionalità (a partire dalla versione 1.14).';
|
||||
|
||||
@override
|
||||
String get repeater_keySettings => 'Change Identity Keys';
|
||||
|
||||
@override
|
||||
String get repeater_keySettingsSubtitle =>
|
||||
'Change the public/private keypair';
|
||||
|
||||
@override
|
||||
String get repeater_prvKey => 'Private key';
|
||||
|
||||
@override
|
||||
String get repeater_prvKeyHelper =>
|
||||
'A new private key for the repeater, a 128-character hex string.';
|
||||
|
||||
@override
|
||||
String get repeater_generatePrvKey => 'Generate a random keypair';
|
||||
|
||||
@override
|
||||
String get repeater_stopGeneratingPrvKey => 'Interrupt search for keypair';
|
||||
|
||||
@override
|
||||
String get repeater_pubKey => 'Public key';
|
||||
|
||||
@override
|
||||
String get repeater_pubKeyHelper =>
|
||||
'This is the public key that goes with the generated private key. You can\'t set this directly.';
|
||||
|
||||
@override
|
||||
String get repeater_pubKeyPrefix => 'Desired prefix';
|
||||
|
||||
@override
|
||||
String repeater_pubKeyPrefixHelper(int tries) {
|
||||
return 'Find a public key that starts with these hex digits. Expected tries needed: $tries.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get repeater_txDelay => 'Ritardo a Flood, TX';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user