meshtastic / Meshtastic-Android

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

fix: allow 192-bit PSKs #1087

Closed AddisonTustin closed 3 months ago

AddisonTustin commented 3 months ago

Adds support for 192-bit PSKs. Solves #1086

Android client currently considers 192-bit PSKs invalid, which causes usability issues when trying to share some PSKs generated on iOS clients (or any 192-bit PSK).

I've validated that a 192-bit PSK generated with an iOS client can be copy/pasted when setting up a new channel on a node using the Android client, and can successfully communicate.

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

CLAassistant commented 3 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

ianmcorvidae commented 3 months ago

Just as a point of information, I believe the firmware doesn't directly support aes192 and just pads the key out to aes256 with zeros: https://github.com/meshtastic/firmware/blob/master/src/mesh/Channels.cpp#L159 -- I guess it's not strictly invalid and it should be possible to share between clients, of course

AddisonTustin commented 3 months ago

That makes sense.

And actually running a test w/ two Heltec V3 dev-boards was successful when sharing a 192-bit psk.

andrekir commented 3 months ago

confirmed only 128 or 256 bit keys are valid. looks like the crypto engine can use 192 bit keys, if it gets added we can revisit this. closing for now.