mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 07:40:55 +03:00
Fixed formatting warnings of Codacy
This commit is contained in:
@@ -223,43 +223,6 @@ public final class TransportImpl
|
||||
if (ident.isEmpty()) {
|
||||
return ident;
|
||||
}
|
||||
//
|
||||
// byte[] data = new byte[256];
|
||||
// for (; ; ) {
|
||||
// int savedBufPos = buffer.rpos();
|
||||
// int pos = 0;
|
||||
// boolean needLF = false;
|
||||
// for (; ; ) {
|
||||
// if (buffer.available() == 0) {
|
||||
// // Need more data, so undo reading and return null
|
||||
// buffer.rpos(savedBufPos);
|
||||
// return "";
|
||||
// }
|
||||
// byte b = buffer.readByte();
|
||||
// if (b == '\r') {
|
||||
// needLF = true;
|
||||
// continue;
|
||||
// }
|
||||
// if (b == '\n')
|
||||
// break;
|
||||
// if (needLF) {
|
||||
// log.error("Incorrect identification, was expecting a '\n' after the '\r', got: '{}' (hex: {})", b, Integer.toHexString(b & 0xFF));
|
||||
// log.error("Data received up til here was: {}", new String(data, 0, pos));
|
||||
// throw new TransportException("Incorrect identification: bad line ending: " + ByteArrayUtils.toHex(data, 0, pos));
|
||||
// }
|
||||
// if (pos >= data.length) {
|
||||
// log.error("Incorrect identification String received, line was longer than expected: {}", new String(data, 0, pos));
|
||||
// log.error("Just for good measure, bytes were: {}", ByteArrayUtils.printHex(data, 0, pos));
|
||||
// throw new TransportException("Incorrect identification: line too long: " + ByteArrayUtils.printHex(data, 0, pos));
|
||||
// }
|
||||
// data[pos++] = b;
|
||||
// }
|
||||
// ident = new String(data, 0, pos);
|
||||
// if (ident.startsWith("SSH-"))
|
||||
// break;
|
||||
// if (buffer.rpos() > 16 * 1024)
|
||||
// throw new TransportException("Incorrect identification: too many header lines");
|
||||
// }
|
||||
|
||||
if (!ident.startsWith("SSH-2.0-") && !ident.startsWith("SSH-1.99-"))
|
||||
throw new TransportException(DisconnectReason.PROTOCOL_VERSION_NOT_SUPPORTED,
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
package net.schmizz.sshj.transport.digest;
|
||||
|
||||
public class SHA384 extends BaseDigest {
|
||||
/** Named factory for SHA384 digest */
|
||||
/**
|
||||
* Named factory for SHA384 digest
|
||||
*/
|
||||
public static class Factory
|
||||
implements net.schmizz.sshj.common.Factory.Named<Digest> {
|
||||
|
||||
@@ -31,7 +33,9 @@ public static class Factory
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a new instance of a SHA384 digest */
|
||||
/**
|
||||
* Create a new instance of a SHA384 digest
|
||||
*/
|
||||
public SHA384() {
|
||||
super("SHA-384", 48);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
package net.schmizz.sshj.transport.digest;
|
||||
|
||||
public class SHA512 extends BaseDigest {
|
||||
/** Named factory for SHA384 digest */
|
||||
/**
|
||||
* Named factory for SHA384 digest
|
||||
*/
|
||||
public static class Factory
|
||||
implements net.schmizz.sshj.common.Factory.Named<Digest> {
|
||||
|
||||
@@ -31,7 +33,9 @@ public static class Factory
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a new instance of a SHA384 digest */
|
||||
/**
|
||||
* Create a new instance of a SHA384 digest
|
||||
*/
|
||||
public SHA512() {
|
||||
super("SHA-512", 64);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@ import java.security.*;
|
||||
import java.security.spec.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
/** Represents a PKCS5-encoded key file. This is the format typically used by OpenSSH, OpenSSL, Amazon, etc. */
|
||||
/**
|
||||
* Represents a PKCS5-encoded key file. This is the format typically used by OpenSSH, OpenSSL, Amazon, etc.
|
||||
*/
|
||||
public class PKCS5KeyFile
|
||||
implements FileKeyProvider {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user