Browse Source

Update SSHD dependency to version 1.2.0.

tags/r1.9.0
Florian Zschocke 4 years ago
parent
commit
15dda8f5c6

+ 1
- 1
.classpath View File

@@ -54,7 +54,7 @@
<classpathentry kind="lib" path="ext/bcprov-jdk15on-1.57.jar" sourcepath="ext/src/bcprov-jdk15on-1.57.jar" />
<classpathentry kind="lib" path="ext/bcmail-jdk15on-1.57.jar" sourcepath="ext/src/bcmail-jdk15on-1.57.jar" />
<classpathentry kind="lib" path="ext/bcpkix-jdk15on-1.57.jar" sourcepath="ext/src/bcpkix-jdk15on-1.57.jar" />
<classpathentry kind="lib" path="ext/sshd-core-1.1.0.jar" sourcepath="ext/src/sshd-core-1.1.0.jar" />
<classpathentry kind="lib" path="ext/sshd-core-1.2.0.jar" sourcepath="ext/src/sshd-core-1.2.0.jar" />
<classpathentry kind="lib" path="ext/mina-core-2.0.21.jar" sourcepath="ext/src/mina-core-2.0.21.jar" />
<classpathentry kind="lib" path="ext/rome-0.9.jar" sourcepath="ext/src/rome-0.9.jar" />
<classpathentry kind="lib" path="ext/jdom-1.0.jar" sourcepath="ext/src/jdom-1.0.jar" />

+ 1
- 1
build.moxie View File

@@ -112,7 +112,7 @@ properties: {
bouncycastle.version : 1.57
selenium.version : 2.28.0
wikitext.version : 1.4
sshd.version: 1.1.0
sshd.version: 1.2.0
mina.version: 2.0.21
guice.version : 4.0
# Gitblit maintains a fork of guice-servlet

+ 3
- 3
gitblit.iml View File

@@ -541,13 +541,13 @@
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="sshd-core-1.1.0.jar">
<library name="sshd-core-1.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/ext/sshd-core-1.1.0.jar!/" />
<root url="jar://$MODULE_DIR$/ext/sshd-core-1.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/ext/src/sshd-core-1.1.0.jar!/" />
<root url="jar://$MODULE_DIR$/ext/src/sshd-core-1.2.0.jar!/" />
</SOURCES>
</library>
</orderEntry>

+ 1
- 1
src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java View File

@@ -26,9 +26,9 @@ import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.sshd.common.config.keys.AuthorizedKeyEntry;
import org.apache.sshd.common.config.keys.KeyUtils;
import org.apache.sshd.common.util.GenericUtils;
import org.apache.sshd.server.config.keys.AuthorizedKeyEntry;

import com.gitblit.IStoredSettings;
import com.gitblit.Keys;

+ 1
- 1
src/main/java/com/gitblit/transport/ssh/NonForwardingFilter.java View File

@@ -15,8 +15,8 @@
*/
package com.gitblit.transport.ssh;

import org.apache.sshd.common.SshdSocketAddress;
import org.apache.sshd.common.session.Session;
import org.apache.sshd.common.util.net.SshdSocketAddress;
import org.apache.sshd.server.forward.ForwardingFilter;

public class NonForwardingFilter implements ForwardingFilter {

+ 1
- 1
src/main/java/com/gitblit/transport/ssh/SshDaemonClient.java View File

@@ -17,7 +17,7 @@ package com.gitblit.transport.ssh;

import java.net.SocketAddress;

import org.apache.sshd.common.session.Session.AttributeKey;
import org.apache.sshd.common.AttributeStore.AttributeKey;

import com.gitblit.models.UserModel;


+ 15
- 1
src/test/java/com/gitblit/tests/SshUnitTest.java View File

@@ -21,6 +21,7 @@ import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.SocketAddress;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PublicKey;
@@ -29,9 +30,12 @@ import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.sshd.client.SshClient;
import org.apache.sshd.client.channel.ClientChannel;
import org.apache.sshd.client.channel.ClientChannelEvent;
import org.apache.sshd.client.config.keys.ClientIdentityLoader;
import org.apache.sshd.client.future.AuthFuture;
import org.apache.sshd.client.keyverifier.ServerKeyVerifier;
import org.apache.sshd.client.session.ClientSession;
import org.apache.sshd.common.config.keys.FilePasswordProvider;
import org.apache.sshd.common.util.SecurityUtils;
import org.junit.After;
import org.junit.AfterClass;
@@ -98,6 +102,16 @@ public abstract class SshUnitTest extends GitblitUnitTest {

protected SshClient getClient() {
SshClient client = SshClient.setUpDefaultClient();
client.setClientIdentityLoader(new ClientIdentityLoader() { // Ignore the files under ~/.ssh
@Override
public boolean isValidLocation(String location) throws IOException {
return true;
}
@Override
public KeyPair loadClientIdentity(String location, FilePasswordProvider provider) throws IOException, GeneralSecurityException {
return null;
}
});
client.setServerKeyVerifier(new ServerKeyVerifier() {
@Override
public boolean verifyServerKey(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) {
@@ -135,7 +149,7 @@ public abstract class SshUnitTest extends GitblitUnitTest {
channel.setErr(err);
channel.open();

channel.waitFor(EnumSet.of(ClientChannel.ClientChannelEvent.CLOSED), 0);
channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED, ClientChannelEvent.EOF), 0);

String result = out.toString().trim();
channel.close(false);

Loading…
Cancel
Save