mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 15:50:57 +03:00
Cleaning up unused code
This commit is contained in:
@@ -39,19 +39,6 @@ final class Encoder
|
|||||||
log = loggerFactory.getLogger(getClass());
|
log = loggerFactory.getLogger(getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
private SSHPacket checkHeaderSpace(SSHPacket buffer) {
|
|
||||||
if (buffer.rpos() < 5) {
|
|
||||||
log.warn("Performance cost: when sending a packet, ensure that "
|
|
||||||
+ "5 bytes are available in front of the buffer");
|
|
||||||
SSHPacket nb = new SSHPacket(buffer.available() + 5);
|
|
||||||
nb.rpos(5);
|
|
||||||
nb.wpos(5);
|
|
||||||
nb.putBuffer(buffer);
|
|
||||||
buffer = nb;
|
|
||||||
}
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void compress(SSHPacket buffer) {
|
private void compress(SSHPacket buffer) {
|
||||||
compression.compress(buffer);
|
compression.compress(buffer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,14 +16,10 @@
|
|||||||
package net.schmizz.sshj.transport.kex;
|
package net.schmizz.sshj.transport.kex;
|
||||||
|
|
||||||
import net.schmizz.sshj.transport.digest.SHA256;
|
import net.schmizz.sshj.transport.digest.SHA256;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
|
|
||||||
public class Curve25519SHA256 extends AbstractDHG {
|
public class Curve25519SHA256 extends AbstractDHG {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Curve25519SHA256.class);
|
|
||||||
|
|
||||||
/** Named factory for Curve25519SHA256 key exchange */
|
/** Named factory for Curve25519SHA256 key exchange */
|
||||||
public static class Factory
|
public static class Factory
|
||||||
implements net.schmizz.sshj.common.Factory.Named<KeyExchange> {
|
implements net.schmizz.sshj.common.Factory.Named<KeyExchange> {
|
||||||
|
|||||||
@@ -40,11 +40,6 @@ import static org.junit.Assert.assertThat;
|
|||||||
|
|
||||||
public class RemotePortForwarderTest {
|
public class RemotePortForwarderTest {
|
||||||
|
|
||||||
// Credentials for an remote SSH Server to test against.
|
|
||||||
private static final String REMOTE_HOST = "x.x.x.x";
|
|
||||||
private static final String USER = "xxxx";
|
|
||||||
private static final String PASSWORD = "yyyy";
|
|
||||||
|
|
||||||
private static final PortRange RANGE = new PortRange(9000, 9999);
|
private static final PortRange RANGE = new PortRange(9000, 9999);
|
||||||
private static final InetSocketAddress HTTP_SERVER_SOCKET_ADDR = new InetSocketAddress("127.0.0.1", 8080);
|
private static final InetSocketAddress HTTP_SERVER_SOCKET_ADDR = new InetSocketAddress("127.0.0.1", 8080);
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ public class HttpServer extends ExternalResource {
|
|||||||
|
|
||||||
private TemporaryFolder docRoot = new TemporaryFolder();
|
private TemporaryFolder docRoot = new TemporaryFolder();
|
||||||
|
|
||||||
public HttpServer() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void before() throws Throwable {
|
protected void before() throws Throwable {
|
||||||
docRoot.create();
|
docRoot.create();
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ public class PacketReaderTest {
|
|||||||
|
|
||||||
private DataOutputStream dataout;
|
private DataOutputStream dataout;
|
||||||
private PacketReader reader;
|
private PacketReader reader;
|
||||||
private SFTPEngine engine;
|
|
||||||
private Subsystem subsystem;
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
@@ -42,8 +40,8 @@ public class PacketReaderTest {
|
|||||||
PipedInputStream pipedin = new PipedInputStream(pipedout);
|
PipedInputStream pipedin = new PipedInputStream(pipedout);
|
||||||
dataout = new DataOutputStream(pipedout);
|
dataout = new DataOutputStream(pipedout);
|
||||||
|
|
||||||
engine = Mockito.mock(SFTPEngine.class);
|
SFTPEngine engine = Mockito.mock(SFTPEngine.class);
|
||||||
subsystem = Mockito.mock(Subsystem.class);
|
Subsystem subsystem = Mockito.mock(Subsystem.class);
|
||||||
Mockito.when(engine.getLoggerFactory()).thenReturn(LoggerFactory.DEFAULT);
|
Mockito.when(engine.getLoggerFactory()).thenReturn(LoggerFactory.DEFAULT);
|
||||||
Mockito.when(engine.getSubsystem()).thenReturn(subsystem);
|
Mockito.when(engine.getSubsystem()).thenReturn(subsystem);
|
||||||
Mockito.when(subsystem.getInputStream()).thenReturn(pipedin);
|
Mockito.when(subsystem.getInputStream()).thenReturn(pipedin);
|
||||||
|
|||||||
Reference in New Issue
Block a user