kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix: remote admin backward compatibility
- only use PKC encryption when the remote node has a public key (2.5 -> 2.5) - fall back to legacy admin if public key is not available (2.5 -> 2.4)pull/1297/head
rodzic
3473ef343a
commit
23f05c109b
|
@ -476,11 +476,13 @@ class MeshService : Service(), Logging {
|
||||||
private val myNodeID get() = toNodeID(myNodeNum)
|
private val myNodeID get() = toNodeID(myNodeNum)
|
||||||
|
|
||||||
/// Admin channel index
|
/// Admin channel index
|
||||||
private val adminChannelIndex: Int
|
private val MeshPacket.Builder.adminChannelIndex: Int
|
||||||
get() = if (nodeDBbyNodeNum[myNodeNum]?.hasPKC == true) { // TODO use meta.hasPKC
|
get() = when {
|
||||||
DataPacket.PKC_CHANNEL_INDEX
|
myNodeNum == to -> 0
|
||||||
} else {
|
nodeDBbyNodeNum[myNodeNum]?.hasPKC == true && nodeDBbyNodeNum[to]?.hasPKC == true ->
|
||||||
channelSet.settingsList
|
DataPacket.PKC_CHANNEL_INDEX
|
||||||
|
|
||||||
|
else -> channelSet.settingsList
|
||||||
.indexOfFirst { it.name.equals("admin", ignoreCase = true) }
|
.indexOfFirst { it.name.equals("admin", ignoreCase = true) }
|
||||||
.coerceAtLeast(0)
|
.coerceAtLeast(0)
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue