Commit 6cf8e5c
committed
The BLE link layer is unauthenticated, and HELLO was accepted at any
time on both platforms, mutating an already-announced link's identity:
- iOS (#29): handleHello set remoteTag and re-ran resolveDuplicateLinks
unconditionally. An attacker holding a link to a victim could send a
second HELLO claiming the victim's tag; the resolver's tie-break then
tore the victim's real link down — a targeted, persistent link-starve.
- Android (#29): remoteTag was assigned *above* the announced guard, so
a re-HELLO silently re-labelled a live link and the attacker's later
payloads surfaced to JS under a different peer's id (attribution spoof).
Both now ignore HELLO once the link is announced: identity is written
exactly once, and a stranger cannot re-label or kill a live link.
Android also gained the duplicate-link resolver iOS already had (#52):
the same lexicographic tie-break, adapted to Android's remoteTag id
model (keeper announced before the loser is dropped, so dropLink's
existing same-tag guard suppresses a spurious onDisconnected). The
ble-mesh README now documents write-once HELLO and cross-platform
duplicate resolution to match the code.
iOS compiles clean. Kotlin reviewed by hand; needs a CI/maintainer
compile and the two-phone validation tracked in #21.
1 parent be4fccd commit 6cf8e5c
3 files changed
Lines changed: 46 additions & 3 deletions
File tree
- modules/ble-mesh
- android/src/main/java/expo/modules/blemesh
- ios
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
215 | 222 | | |
216 | 223 | | |
217 | 224 | | |
| |||
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
1061 | 1064 | | |
1062 | 1065 | | |
1063 | 1066 | | |
1064 | 1067 | | |
1065 | 1068 | | |
1066 | 1069 | | |
1067 | | - | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1068 | 1078 | | |
1069 | 1079 | | |
1070 | 1080 | | |
| |||
1081 | 1091 | | |
1082 | 1092 | | |
1083 | 1093 | | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1084 | 1118 | | |
1085 | 1119 | | |
1086 | 1120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
794 | 797 | | |
795 | 798 | | |
796 | 799 | | |
| |||
802 | 805 | | |
803 | 806 | | |
804 | 807 | | |
805 | | - | |
806 | 808 | | |
807 | 809 | | |
808 | 810 | | |
| |||
0 commit comments