meshtastic / Meshtastic-Android

Android application for Meshtastic
https://meshtastic.org
GNU General Public License v3.0
681 stars 196 forks source link

Android/Apple Client Disparity, Cannot Share PSKs of 192bits #1086

Closed AddisonTustin closed 3 months ago

AddisonTustin commented 3 months ago

Summary

It does not seem possible to share PSKs between Apple/Android clients when the PSK is created/generated by the Apple client with a key size of 192 bits.

Steps to reproduce

There's no warnings or error messages for why this is an invalid channel key for Android, while it's supported on the Apple client.

Apple Image

apple-meshtastic-192-bits

Android Image

android-meshtastic-192-bits

AddisonTustin commented 3 months ago

Trying to spin-up on some of the Android package, but is there any reason we shouldn't be able to accept an additional key size here of 24 bytes?

andrekir commented 3 months ago

firmware doesn't support 192 bit keys

https://github.com/meshtastic/protobufs/blob/master/meshtastic/channel.proto#L36 https://github.com/meshtastic/firmware/blob/master/src/mesh/CryptoEngine.h#L38

AddisonTustin commented 3 months ago

I'd take a look at the comment @ianmcorvidae added to #1087.

The firmware pads the key to be 256-bits and the Meshtastic-Apple client 'accepts' a 192-bit key.