[jira] [Created] (DIRMINA-980) Missing implementation of write() method in SerialSessionImpl.SerialIoProcessor

2014-06-12 Thread Saar Partush (JIRA)
Saar Partush created DIRMINA-980:


 Summary: Missing implementation of write() method in 
SerialSessionImpl.SerialIoProcessor
 Key: DIRMINA-980
 URL: https://issues.apache.org/jira/browse/DIRMINA-980
 Project: MINA
  Issue Type: Bug
  Components: Transport
Affects Versions: 2.0.7, 2.0.2
 Environment: Windows server 2012, Java8, mina-core-2.07.jar, 
mina-transport-serial-2.0.2.jar
Reporter: Saar Partush
Priority: Blocker


After creating MINA object for serial connection successfully I try to send 
data over the serial connection.
My IoHandler implementation exceptionCought() is called.
The throwable object contain the following:
org.apache.mina.core.session.AbstractIoSession.init(Lorg/apache/mina/core/service/IoService;)V

After debugging using the mina-transport-serial-2.0.2 sources I found out that 
the method write is missing from the implementation of 
SerialSessionImpl.SerialIoProcess. I could not build it.
So I added the method like this:

public void write(SerialSessionImpl session, WriteRequest writeRequest) {
getWriterRequestQueue.offer(session, writeRequest) ;
}

and it worked fine.




--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (SSHD-330) Handshake fails (wrong shared secret) 1 out of 256 times

2014-06-12 Thread Pasi Eronen (JIRA)
Pasi Eronen created SSHD-330:


 Summary: Handshake fails (wrong shared secret) 1 out of 256 times
 Key: SSHD-330
 URL: https://issues.apache.org/jira/browse/SSHD-330
 Project: MINA SSHD
  Issue Type: Bug
Affects Versions: 0.11.0
Reporter: Pasi Eronen



The shared secret returned by KeyAgreement.generateSecret() is a byte array, 
which can (by chance, roughly 1 out of 256 times) begin with zero byte. In SSH, 
the shared secret is an integer, so we need to strip the leading zero(es).

Some JCE providers might strip leading zeroes, though. SunJCE used to do this 
in Java 6, I think, but not anymore in Java 7 -- and there was an almost 
identical bug (handshake fails 1 out of 256 times) in Java's SSL/TLS 
implementation in early Java 7 versions (see 
http://bugs.java.com/view_bug.do?bug_id=8014618).

How to reproduce with OpenSSH client (assuming Mina SSH server running in port 
9922):

for x in {1..500}; do sshpass -p wrong ssh -p9922 
-oKexAlgorithms=diffie-hellman-group-exchange-sha1 someuser@localhost; done 

for x in {1..500}; do sshpass -p wrong ssh -p9922 
-oKexAlgorithms=ecdh-sha2-nistp256 someuser@localhost; done 




--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (SSHD-330) Handshake fails (wrong shared secret) 1 out of 256 times

2014-06-12 Thread Pasi Eronen (JIRA)

 [ 
https://issues.apache.org/jira/browse/SSHD-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pasi Eronen updated SSHD-330:
-

Description: 
The shared secret returned by KeyAgreement.generateSecret() is a byte array, 
which can (by chance, roughly 1 out of 256 times) begin with zero byte. In SSH, 
the shared secret is an integer, so we need to strip the leading zero(es).

Some JCE providers might strip leading zeroes, though. SunJCE used to do this 
in Java 6, I think, but not anymore in Java 7 -- and there was an almost 
identical bug (handshake fails 1 out of 256 times) in Java's SSL/TLS 
implementation in early Java 7 versions (see 
http://bugs.java.com/view_bug.do?bug_id=8014618).

Pull request here:
https://github.com/apache/mina-sshd/pull/5

How to reproduce with OpenSSH client (assuming Mina SSH server running in port 
9922):

for x in {1..500}; do sshpass -p wrong ssh -p9922 
-oKexAlgorithms=diffie-hellman-group-exchange-sha1 someuser@localhost; done 

for x in {1..500}; do sshpass -p wrong ssh -p9922 
-oKexAlgorithms=ecdh-sha2-nistp256 someuser@localhost; done 


  was:

The shared secret returned by KeyAgreement.generateSecret() is a byte array, 
which can (by chance, roughly 1 out of 256 times) begin with zero byte. In SSH, 
the shared secret is an integer, so we need to strip the leading zero(es).

Some JCE providers might strip leading zeroes, though. SunJCE used to do this 
in Java 6, I think, but not anymore in Java 7 -- and there was an almost 
identical bug (handshake fails 1 out of 256 times) in Java's SSL/TLS 
implementation in early Java 7 versions (see 
http://bugs.java.com/view_bug.do?bug_id=8014618).

How to reproduce with OpenSSH client (assuming Mina SSH server running in port 
9922):

for x in {1..500}; do sshpass -p wrong ssh -p9922 
-oKexAlgorithms=diffie-hellman-group-exchange-sha1 someuser@localhost; done 

for x in {1..500}; do sshpass -p wrong ssh -p9922 
-oKexAlgorithms=ecdh-sha2-nistp256 someuser@localhost; done 



 Handshake fails (wrong shared secret) 1 out of 256 times
 

 Key: SSHD-330
 URL: https://issues.apache.org/jira/browse/SSHD-330
 Project: MINA SSHD
  Issue Type: Bug
Affects Versions: 0.11.0
Reporter: Pasi Eronen

 The shared secret returned by KeyAgreement.generateSecret() is a byte array, 
 which can (by chance, roughly 1 out of 256 times) begin with zero byte. In 
 SSH, the shared secret is an integer, so we need to strip the leading 
 zero(es).
 Some JCE providers might strip leading zeroes, though. SunJCE used to do this 
 in Java 6, I think, but not anymore in Java 7 -- and there was an almost 
 identical bug (handshake fails 1 out of 256 times) in Java's SSL/TLS 
 implementation in early Java 7 versions (see 
 http://bugs.java.com/view_bug.do?bug_id=8014618).
 Pull request here:
 https://github.com/apache/mina-sshd/pull/5
 How to reproduce with OpenSSH client (assuming Mina SSH server running in 
 port 9922):
 for x in {1..500}; do sshpass -p wrong ssh -p9922 
 -oKexAlgorithms=diffie-hellman-group-exchange-sha1 someuser@localhost; done 
 for x in {1..500}; do sshpass -p wrong ssh -p9922 
 -oKexAlgorithms=ecdh-sha2-nistp256 someuser@localhost; done 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SSHD-330) Handshake fails (wrong shared secret) 1 out of 256 times

2014-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SSHD-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14028968#comment-14028968
 ] 

ASF GitHub Bot commented on SSHD-330:
-

GitHub user pasieronen opened a pull request:

https://github.com/apache/mina-sshd/pull/5

SSHD-330 Strip leading zero(es) from the shared secret



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

$ git pull https://github.com/pasieronen/mina-sshd 
SSHD-330-shared-secret-zeroes

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

https://github.com/apache/mina-sshd/pull/5.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 #5


commit e7ebbc6bf1e13ac0da00b75b12814cc7827eb18d
Author: Pasi Eronen p...@iki.fi
Date:   2014-06-12T09:27:33Z

Strip leading zero(es) from the shared secret




 Handshake fails (wrong shared secret) 1 out of 256 times
 

 Key: SSHD-330
 URL: https://issues.apache.org/jira/browse/SSHD-330
 Project: MINA SSHD
  Issue Type: Bug
Affects Versions: 0.11.0
Reporter: Pasi Eronen

 The shared secret returned by KeyAgreement.generateSecret() is a byte array, 
 which can (by chance, roughly 1 out of 256 times) begin with zero byte. In 
 SSH, the shared secret is an integer, so we need to strip the leading 
 zero(es).
 Some JCE providers might strip leading zeroes, though. SunJCE used to do this 
 in Java 6, I think, but not anymore in Java 7 -- and there was an almost 
 identical bug (handshake fails 1 out of 256 times) in Java's SSL/TLS 
 implementation in early Java 7 versions (see 
 http://bugs.java.com/view_bug.do?bug_id=8014618).
 How to reproduce with OpenSSH client (assuming Mina SSH server running in 
 port 9922):
 for x in {1..500}; do sshpass -p wrong ssh -p9922 
 -oKexAlgorithms=diffie-hellman-group-exchange-sha1 someuser@localhost; done 
 for x in {1..500}; do sshpass -p wrong ssh -p9922 
 -oKexAlgorithms=ecdh-sha2-nistp256 someuser@localhost; done 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[GitHub] mina-sshd pull request: SSHD-330 Strip leading zero(es) from the s...

2014-06-12 Thread pasieronen
GitHub user pasieronen opened a pull request:

https://github.com/apache/mina-sshd/pull/5

SSHD-330 Strip leading zero(es) from the shared secret



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

$ git pull https://github.com/pasieronen/mina-sshd 
SSHD-330-shared-secret-zeroes

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

https://github.com/apache/mina-sshd/pull/5.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 #5


commit e7ebbc6bf1e13ac0da00b75b12814cc7827eb18d
Author: Pasi Eronen p...@iki.fi
Date:   2014-06-12T09:27:33Z

Strip leading zero(es) from the shared secret




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (DIRMINA-980) Missing implementation of write() method in SerialSessionImpl.SerialIoProcessor

2014-06-12 Thread Mike van Goor (JIRA)

[ 
https://issues.apache.org/jira/browse/DIRMINA-980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14028976#comment-14028976
 ] 

Mike van Goor commented on DIRMINA-980:
---

Hello,

Please do not use version 2.0.2.
Download mina transport serial 2.0.7

Link:
http://repo1.maven.org/maven2/org/apache/mina/mina-transport-serial/2.0.7/
All versions:
http://repo1.maven.org/maven2/org/apache/mina/mina-transport-serial/

I am actively using the mina transport serial (version 2.0.7) without any 
issues for a long time.

Regards,
Mike

 Missing implementation of write() method in 
 SerialSessionImpl.SerialIoProcessor
 ---

 Key: DIRMINA-980
 URL: https://issues.apache.org/jira/browse/DIRMINA-980
 Project: MINA
  Issue Type: Bug
  Components: Transport
Affects Versions: 2.0.2, 2.0.7
 Environment: Windows server 2012, Java8, mina-core-2.07.jar, 
 mina-transport-serial-2.0.2.jar
Reporter: Saar Partush
Priority: Blocker
   Original Estimate: 24h
  Remaining Estimate: 24h

 After creating MINA object for serial connection successfully I try to send 
 data over the serial connection.
 My IoHandler implementation exceptionCought() is called.
 The throwable object contain the following:
 org.apache.mina.core.session.AbstractIoSession.init(Lorg/apache/mina/core/service/IoService;)V
 After debugging using the mina-transport-serial-2.0.2 sources I found out 
 that the method write is missing from the implementation of 
 SerialSessionImpl.SerialIoProcess. I could not build it.
 So I added the method like this:
 public void write(SerialSessionImpl session, WriteRequest writeRequest) {
 getWriterRequestQueue.offer(session, writeRequest) ;
 }
 and it worked fine.



--
This message was sent by Atlassian JIRA
(v6.2#6252)