[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15983502#comment-15983502
 ] 

ASF GitHub Bot commented on ARTEMIS-826:


Github user asfgit closed the pull request at:

https://github.com/apache/activemq-artemis/pull/1227


> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-25 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15983501#comment-15983501
 ] 

ASF subversion and git services commented on ARTEMIS-826:
-

Commit 1c84bd39c45a8f3cf91d7d60d212d693905c9ad8 in activemq-artemis's branch 
refs/heads/master from [~martyntaylor]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=1c84bd3 ]

ARTEMIS-826 Fix MQTT protocol detection


> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-25 Thread Christopher L. Shannon (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15982782#comment-15982782
 ] 

Christopher L. Shannon commented on ARTEMIS-826:


I see [~clebertsuconic] is already looking at this, so I will let him merge it 
instead :)

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-25 Thread Christopher L. Shannon (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15982780#comment-15982780
 ] 

Christopher L. Shannon commented on ARTEMIS-826:


[~martyntaylor], This patch looks good to me and I will merge it.  I also 
tested it on 5.x with the auto transport with MQTT and everything looks good.

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15982697#comment-15982697
 ] 

ASF GitHub Bot commented on ARTEMIS-826:


GitHub user mtaylor opened a pull request:

https://github.com/apache/activemq-artemis/pull/1227

ARTEMIS-826 Fix MQTT protocol detection



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/mtaylor/activemq-artemis ARTEMIS-826

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/activemq-artemis/pull/1227.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1227


commit 4e225c272493b99cebd55a1889b40b5f88e90e85
Author: Martyn Taylor 
Date:   2017-04-24T15:27:46Z

ARTEMIS-826 Fix MQTT protocol detection




> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-17 Thread Justin Bertram (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15971105#comment-15971105
 ] 

Justin Bertram commented on ARTEMIS-826:


[~martyntaylor]'s comments notwithstanding, open source is a beautiful thing. 
Anybody can fix any problem. Contributions are always welcome. It really makes 
the community stronger.

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-17 Thread Martyn Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15971098#comment-15971098
 ] 

Martyn Taylor commented on ARTEMIS-826:
---

I will have this fixed and ready for Apache Artemis 2.0.1 (and back ported onto 
the Artemis 1.x branch) within the next week or so.  Apologies for the delay 
guys.  I'm snowed under with other things atm...

Thanks.

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-17 Thread Ram C (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15971092#comment-15971092
 ] 

Ram C commented on ARTEMIS-826:
---

[~martyntaylor] : Will there be any timeline to pick up this issue? since this 
was holding us to move forward.  Can you please update. Thanks!

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-17 Thread Christopher L. Shannon (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15971072#comment-15971072
 ] 

Christopher L. Shannon commented on ARTEMIS-826:


This also affects the 5.x broker auto transport (because I ended up using the 
same MQTT protocol detection logic that was in Artemis).  Whenever this gets 
resolved I can also look at a merging in a similar fix for the 5.x auto 
transport.

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-06 Thread Martyn Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15958651#comment-15958651
 ] 

Martyn Taylor commented on ARTEMIS-826:
---

[~tabish121] The long story short, is that we don't take into account the 
remaining length of the CONNECT packet which can either be 1 or 3 bytes long.  
We use Netty decoder/encoder to handle the usual bytes to message, this 
protocol check happens before we put the encoder into the pipeline.  I'll 
update accordingly.

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-06 Thread Martyn Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15958646#comment-15958646
 ] 

Martyn Taylor commented on ARTEMIS-826:
---

[~c.ramsubbu] [~tabish121] Thanks for the test and diagnosis.  I'll have a fix 
soon.

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-05 Thread Timothy Bish (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15957952#comment-15957952
 ] 

Timothy Bish commented on ARTEMIS-826:
--

I took a look quickly as this rang a bell from an issue for ActiveMQ from way 
back.  The trouble here seems to be that the protocol detection code in Artemis 
is expecting the layout of the CONNECT packet to always be the same but that 
isn't the case in MQTT.  The CONNECT command consists of a Fixed header, 
followed by an encoded value which indicates the remaining length of the packet 
and then the variable length header plus a possible payload section.  The bit 
that is not taken into account here is the 'remaining length' portion which can 
be up to four bytes in length to indicate the length of the variable header + 
the payload.  

In the simpler cases Artemis receives a packet that looks something like "[16, 
36, 0, 4, 77, 81, 84, 84]" where the last four bytes are "MQTT" (or MQIs for 
3.1).  However, if the password + username + everything else is large the value 
of the remaining length gets bigger and spills over into more bytes at the 
start of the command and you might see something like "[16, -126, 3, 0, 4, 77, 
81, 84]" which breaks the current protocol checks.

It gets worse though in that if the length value reaches the four byte max then 
you might see something like "[16, -126, -126, -126, 10, 0, 4, 77]" in which 
case you can't decide if the protocol is MQTT 3.1.1 or 3.1 and really you can't 
even tell it's MQTT at that point.  

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-05 Thread Ram C (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15957447#comment-15957447
 ] 

Ram C commented on ARTEMIS-826:
---

[~martyntaylor] : Here I simulated the same issue as using the MQTTTest.java 
and MQTTTestSupport.java file.

Steps to recreate:
1. Update the MATTTestSupport > createMQTTTcpConnection method to pass username 
and password (JW token)
 
private MQTT createMQTTTcpConnection(String clientId, boolean clean) throws 
Exception {
  MQTT mqtt = new MQTT();
  mqtt.setConnectAttemptsMax(1);
  mqtt.setReconnectAttemptsMax(0);
  mqtt.setTracer(createTracer());
  mqtt.setVersion("3.1.1");
  mqtt.setUserName("test_user");
  
mqtt.setPassword("eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi");
  if (clientId != null) {
 mqtt.setClientId(clientId);
  }
  mqtt.setCleanSession(clean);
  mqtt.setHost("localhost", port);
  return mqtt;
   }

2. Compile and Run the MQTTTest.java > testResendMessageId method.

The validation was failed in MQTTProtocolManager > isProtocol method as the 
array[4] != 77 when we were using JW token as password field.

Thanks!


> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-04-05 Thread Martyn Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15956559#comment-15956559
 ] 

Martyn Taylor commented on ARTEMIS-826:
---

This has been raised by another user.  I'll aim to prioritise.  Is there any 
chance someone experiencing the issue could create a unit test?  It would speed 
things up.  There are a bunch of tests in the MQTTTest class that use the Fuse 
client, alternatively, look at the Paho test in the same directory.

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Assignee: Martyn Taylor
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.next
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARTEMIS-826) MQTT with a long password field causes NPE exception

2017-03-09 Thread luca capra (JIRA)

[ 
https://issues.apache.org/jira/browse/ARTEMIS-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15903157#comment-15903157
 ] 

luca capra commented on ARTEMIS-826:


Is there any chance to get this taken in consideration?

> MQTT with a long password field causes NPE exception
> 
>
> Key: ARTEMIS-826
> URL: https://issues.apache.org/jira/browse/ARTEMIS-826
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 1.4.0, 1.5.0
>Reporter: luca capra
>Priority: Critical
>  Labels: mqtt
> Fix For: 2.0.0
>
>
> Hi
> I'm using mqtt.js and Paho (java) as client for MQTT protocol. 
> The issue can be replicated both on (my embed) version pointing at master 
> (1.5.0-SNAPSHOT) and with a clean install of 1.4.0 release
> Happens by using a long password (a jwt token in my case) which causes this 
> exception on both versions
> Example password:
> eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNDc3NDg1NDc5OTEzLCJleHAiOjE0Nzc0ODcyNzksInV1aWQiOiI2NmVkNDc3Mi0wNDg5LTRlOTYtYmI2NS01NDhiMmVkMmM3MWQifQ.LbOAr8pPApDlVBLi32JWtCjmCa80ByAJYq9BnTnWQgh4SWka4WzykMU0D_atE5tYtgICj2QOg-OFglv2ZqLLNw
> Exception:
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:185)
>  [artemis-server-1.4.0.jar:1.4.0]
> Looking at the source Artemis receive a different set of bytes ("M"QTT starts 
> at array[5])
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java#L131
> ---
> MQTT spec on password length (0 to 65535 bytes of binary data + 2bytes for 
> length)
> http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246
> Client code is here:
> https://gist.github.com/muka/df7cac712a645b9f1895274adcbe3670
> Embed artemis code is here:
> https://github.com/muka/raptor/tree/master/raptor-broker
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)