Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PKI channel for MQTT #4464

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Add PKI channel for MQTT #4464

merged 2 commits into from
Aug 15, 2024

Conversation

jp-bennett
Copy link
Collaborator

If we are connecting to MQTT, this adds the root/2/e/PKI topic for PKI messages.

@jp-bennett jp-bennett merged commit ced8759 into 2.5-changes Aug 15, 2024
4 checks passed
@jp-bennett jp-bennett deleted the pki-mqtt branch August 15, 2024 00:32
@@ -161,8 +162,11 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
p->channel = ch.index;
}

// PKI messages get accepted even if we can't decrypt
if (router && p->which_payload_variant == meshtastic_MeshPacket_encrypted_tag && p->channel == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to check for (strcmp(e.channel_id, "PKI") to avoid not decrypting when you happen to have a channel hash of 0.

Also, I think here we want to check whether the to and from are in our NodeDB to avoid routing PKI messages for nodes that do not talk via your channels.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest change to 2.5 branch fixes all of this, except checking for to/from. I'm still pondering that one.

src/mqtt/MQTT.cpp Show resolved Hide resolved
src/mqtt/MQTT.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants