Processed review comments from @demobox. Thx!

This commit is contained in:
hierynomus
2015-01-20 09:31:24 +01:00
parent 18f364a283
commit 3cefda5bd3
3 changed files with 5 additions and 6 deletions

View File

@@ -78,6 +78,7 @@ public interface Transport
/** /**
* @return the interval in seconds at which a heartbeat message is sent to the server * @return the interval in seconds at which a heartbeat message is sent to the server
* @deprecated Moved to {@link net.schmizz.keepalive.KeepAlive#getKeepAliveInterval()}. This is accessible through the {@link net.schmizz.sshj.connection.Connection}. * @deprecated Moved to {@link net.schmizz.keepalive.KeepAlive#getKeepAliveInterval()}. This is accessible through the {@link net.schmizz.sshj.connection.Connection}.
* Scheduled to be removed in 0.12.0
*/ */
@Deprecated @Deprecated
int getHeartbeatInterval(); int getHeartbeatInterval();
@@ -85,6 +86,7 @@ public interface Transport
/** /**
* @param interval the interval in seconds, {@code 0} means no hearbeat * @param interval the interval in seconds, {@code 0} means no hearbeat
* @deprecated Moved to {@link net.schmizz.keepalive.KeepAlive#getKeepAliveInterval()}. This is accessible through the {@link net.schmizz.sshj.connection.Connection}. * @deprecated Moved to {@link net.schmizz.keepalive.KeepAlive#getKeepAliveInterval()}. This is accessible through the {@link net.schmizz.sshj.connection.Connection}.
* Scheduled to be removed in 0.12.0
*/ */
@Deprecated @Deprecated
void setHeartbeatInterval(int interval); void setHeartbeatInterval(int interval);

View File

@@ -127,10 +127,9 @@ public final class TransportImpl
this.sshClient = null; this.sshClient = null;
} }
/** /*
* Temporary constructor until we remove support for the set/get Heartbeat interval from transport. * Temporary constructor until we remove support for the set/get Heartbeat interval from transport.
* @param config * @deprecated To be removed in 0.12.0
* @param sshClient
*/ */
@Deprecated @Deprecated
public TransportImpl(Config config, SSHClient sshClient) { public TransportImpl(Config config, SSHClient sshClient) {

View File

@@ -139,9 +139,7 @@ public class PKCS8KeyFile
JcePEMDecryptorProviderBuilder decryptorBuilder = new JcePEMDecryptorProviderBuilder(); JcePEMDecryptorProviderBuilder decryptorBuilder = new JcePEMDecryptorProviderBuilder();
decryptorBuilder.setProvider("BC"); decryptorBuilder.setProvider("BC");
try { try {
// Do not return null, as JcePEMDecryptorProviderBuilder$1$1.decrypt would throw an exception passphrase = pwdf == null ? null : pwdf.reqPassword(resource);
// in that case because it requires a 'password' (i.e. passphrase).
passphrase = pwdf == null ? "".toCharArray() : pwdf.reqPassword(resource);
kp = pemConverter.getKeyPair(encryptedKeyPair.decryptKeyPair(decryptorBuilder.build(passphrase))); kp = pemConverter.getKeyPair(encryptedKeyPair.decryptKeyPair(decryptorBuilder.build(passphrase)));
} finally { } finally {
PasswordUtils.blankOut(passphrase); PasswordUtils.blankOut(passphrase);