You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/05 17:01:33 UTC

[GitHub] [netbeans] matthiasblaesing opened a new pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

matthiasblaesing opened a new pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713


   Closes: #3700


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1060244566


   > > @ebresie wrong question. The right question is: What would you test? Jsch is basicly just the original library with OSGI headers (specific for netbeans). Same is junixsocket. The rest are integrations that used now broken code paths.
   > 
   > Why the authentication failed given good user and password I'm not clear of but...
   
   The authentication failed using an SSH key, that was generated using a new enough `ssh-keygen` version. The reason is, that that the format changed and also new algorithms were introduced. Both not supported by the JSch version we bundled. JSch in its original version was not updated and a fork was created: https://github.com/mwiede/jsch, to which this PR switches.
   
   > so unit test the "now broken code path". Test (with existing or new test) a git fetch via ssh connection type that fails to authentication (and triggers the behavior described) to reproduces the problem before the fix and works after the fix.
   
   Thank you - I know what a test is and how it works. This integration test (it tests interdependent behaviour) would need to setup an SSH server, a git repository and the right keys and then check what you describe. But this would most probably not have caught this issue, as I would have used pre generated keys and this would continue to work. Even freshly generated keys need to have the algorithm selected, which would again yield compatible keys. What is more, you are talking about serious work here, the external SSH server must work on all architectures tests are run and needs to be reliable. We have enough such complex tests, that only cause headaches and lead to people to discarding problems reported by them.
   
   Feel free to create a test, I won't.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1060945172


   For anyone testing this on windows: You'll need a recent version of pagent. I tested the changes at work and could not connect to our git repository. Debugging showed, that the pagent version I used ignored the signature flag and returns a `ssh-rsa` signature, although a `ssh-rsa-sha512` one is requested. This of course fails.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1066167812


   LSP test is know to fail.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing merged pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing merged pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1059977831


   > I am one of the primary caretakers of this JSch fork and want to point out that `0.2.0` is the most recent release.
   
   I noticed that, but there already breaking changes and 0.2.0 explicitly states, that algorithms are disabled. If someone makes a case for 0.2.0 I can bump it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] norrisjeremy commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
norrisjeremy commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1059977019


   Also, if you have any questions, please let me know!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1060039827


   I pushed a different implementation a few minutes ago. Sorry for the complete replacement, but the differences would have touch many files anyway:
   
   - @vieiro rightly pointed out, that in the case, that if Pagent is used, the SSHAgent instatiation becomes useless. The updated implementation prefers the SSHAgent. If that is present, it is directly returned. That might change the situation for windows users, when both a Pagent _and_ an SSHAgent is present. However in this case I'd expect the SSHAgent to act as a proxy to the Pagent. So in sane setups nothing should change.
   - the dependencies for the OSGI module were also declared on the JSch wrapper module. It is unclear whether or not this is necessary, but it can't hurt.
   - Specification versions were bumped for junixsocket, libs.git and php.project
   - The removal of the libs.jsch.agentproxy module was reverted and instead the factory method for the AgentConnector was updated to the new JSch API (Release and specification version were bumped accordingly)
   
   An updated test build can be found here: http://doppel-helix.eu/NetBeans-dev-dev-5573b9c9e8794ba43374347606509a5a4206a00a-release.zip


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1059814613


   @sdedic you might want to have a look at this. I remember, that you asked to be included in changes, that might touch vscode. This is the case here, as vscode had a reference to the removed ssh agent integration module.
   
   For the IDE this should work, as all relevant dependency modules (jna, jna-platform, bouncy castle and junixsocket) are either in the IDE or the Platform cluster, it might be necessary to adjust the vscode build to include them too.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#discussion_r820139009



##########
File path: ide/libs.git/src/org/netbeans/libs/git/jgit/JGitSshSessionFactory.java
##########
@@ -167,9 +177,25 @@ protected Session createSession (Host hc, String user, String host, int port, FS
     private boolean setupJSchIdentityRepository (JSch jsch, String identityFile, boolean preferAgent) throws JSchException {
         boolean agentUsed = false;
         if (preferAgent) {
-            Connector con = ConnectorFactory.getInstance().createConnector(ConnectorFactory.ConnectorKind.ANY);
-            if (con != null) {
-                IdentityRepository irepo = new IdentityRepositoryImpl(con);
+            AgentConnector agentConnector = null;
+            try {
+                 agentConnector = new SSHAgentConnector();
+                 if(! agentConnector.isAvailable()) {
+                     agentConnector = null;
+                 }
+            } catch (Throwable ex) {
+                LOG.log(Level.FINE, null, ex);
+            }
+            try {
+                agentConnector = new PageantConnector();

Review comment:
       There are two possible outcomes of the creation of the SSHAgentConnector:
   
   - instantiation of `SSHAgentConnector` could fail because `junixsocket` can't be instatiated
   - the class might be loadable, but there is no agent running
   
   On window this is quite possible. In my work setup I have pagent running and an ssh-agent -> pagent bridge in cygwin, but NetBeans uses PAgent directly.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] ebresie commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
ebresie commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1060056805


   > @ebresie wrong question. The right question is: What would you test? Jsch is basicly just the original library with OSGI headers (specific for netbeans). Same is junixsocket. The rest are integrations that used now broken code paths.
   
   Why the authentication failed given good user and password I'm not clear of but...so unit test the "now broken code path".  Test (with existing or new test) a git fetch via ssh connection type that fails to authentication (and triggers the behavior described) to reproduces the problem before the fix and works after the fix. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] norrisjeremy commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
norrisjeremy commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1059976260


   I am one of the primary caretakers of this JSch fork and want to point out that `0.2.0` is the most recent release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] vieiro commented on a change in pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
vieiro commented on a change in pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#discussion_r820263389



##########
File path: ide/libs.git/src/org/netbeans/libs/git/jgit/JGitSshSessionFactory.java
##########
@@ -167,9 +177,25 @@ protected Session createSession (Host hc, String user, String host, int port, FS
     private boolean setupJSchIdentityRepository (JSch jsch, String identityFile, boolean preferAgent) throws JSchException {
         boolean agentUsed = false;
         if (preferAgent) {
-            Connector con = ConnectorFactory.getInstance().createConnector(ConnectorFactory.ConnectorKind.ANY);
-            if (con != null) {
-                IdentityRepository irepo = new IdentityRepositoryImpl(con);
+            AgentConnector agentConnector = null;
+            try {
+                 agentConnector = new SSHAgentConnector();
+                 if(! agentConnector.isAvailable()) {
+                     agentConnector = null;
+                 }
+            } catch (Throwable ex) {
+                LOG.log(Level.FINE, null, ex);
+            }
+            try {
+                agentConnector = new PageantConnector();

Review comment:
       What I was meaning is that you may want an `if (agentconnector != null) {}` wrapping the second try-catch, or not? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1060026261


   @ebresie wrong question. The right question is: What would you test? Jsch is basicly just the original library with OSGI headers (specific for netbeans). Same is junixsocket. The rest are integrations that used now broken code paths.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1064468760


   I intent to merge this on the weekend.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] vieiro commented on a change in pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
vieiro commented on a change in pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#discussion_r820138218



##########
File path: ide/libs.git/src/org/netbeans/libs/git/jgit/JGitSshSessionFactory.java
##########
@@ -167,9 +177,25 @@ protected Session createSession (Host hc, String user, String host, int port, FS
     private boolean setupJSchIdentityRepository (JSch jsch, String identityFile, boolean preferAgent) throws JSchException {
         boolean agentUsed = false;
         if (preferAgent) {
-            Connector con = ConnectorFactory.getInstance().createConnector(ConnectorFactory.ConnectorKind.ANY);
-            if (con != null) {
-                IdentityRepository irepo = new IdentityRepositoryImpl(con);
+            AgentConnector agentConnector = null;
+            try {
+                 agentConnector = new SSHAgentConnector();
+                 if(! agentConnector.isAvailable()) {
+                     agentConnector = null;
+                 }
+            } catch (Throwable ex) {
+                LOG.log(Level.FINE, null, ex);
+            }
+            try {
+                agentConnector = new PageantConnector();

Review comment:
       Why create a new "PageantConnector()" on line 190 if we've already created a SSHAgentConnector on line 182 above?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] ebresie edited a comment on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
ebresie edited a comment on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1060017320


   Are there any existing unit tests for this that need any changes because of this or should existing coverage still be good?  Any new tests needed?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] ebresie commented on pull request #3713: [NETBEANS-6067] Update JSch to 0.1.72 and junixsocket to 2.4.0

Posted by GitBox <gi...@apache.org>.
ebresie commented on pull request #3713:
URL: https://github.com/apache/netbeans/pull/3713#issuecomment-1060017320


   Are there any existing unit tests for this?  Or maybe add a new one?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists