mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: generate random PSK on clear (#2136)
This commit is contained in:
parent
3ef504c567
commit
8822f7529d
1 changed files with 8 additions and 0 deletions
|
|
@ -52,6 +52,8 @@ import com.geeksville.mesh.ui.common.components.SwitchPreference
|
|||
import com.geeksville.mesh.ui.node.NodeActionButton
|
||||
import com.geeksville.mesh.ui.radioconfig.RadioConfigViewModel
|
||||
import com.geeksville.mesh.util.encodeToString
|
||||
import com.google.protobuf.ByteString
|
||||
import java.security.SecureRandom
|
||||
|
||||
@Composable
|
||||
fun SecurityConfigScreen(
|
||||
|
|
@ -249,6 +251,12 @@ fun PrivateKeyRegenerateDialog(
|
|||
onClick = {
|
||||
securityInput = securityInput.copy {
|
||||
clearPrivateKey()
|
||||
@Suppress("MagicNumber")
|
||||
privateKey = ByteString.copyFrom(
|
||||
ByteArray(32).apply {
|
||||
SecureRandom().nextBytes(this)
|
||||
}
|
||||
)
|
||||
}
|
||||
onConfirm(securityInput)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue