eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.1k stars 880 forks source link

MqttAuth getMessageInfo() should return 0 not 1 #980

Open mbuckton opened 1 year ago

mbuckton commented 1 year ago

Please fill out the form below before submitting, thank you!

The MQTT 5 Auth packet sends a 1 in the 4 reserved bits instead of 0, as per the MQTT spec

"Bits 3,2,1 and 0 of the Fixed Header of the AUTH packet are reserved and MUST all be set to 0. The Client or Server MUST treat any other value as malformed and close the Network Connection [MQTT-3.15.1-1]."

This causes any broker to receive a Auth packet from paho to close the connection.

The simple fix is to simple return 0 in the getMessageInfo() function in MqttAuth.java line 107