Skip to content

Commit 526432a

Browse files
committed
Merge branch 'master' into 3.0.0
2 parents 44654f2 + 2a2eef0 commit 526432a

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

docs/dependencies.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
Required mainly for writing keys to PEM files or for special keys/ciphers/etc. that are not part of the standard
66
[Java Cryptography Extension](https://en.wikipedia.org/wiki/Java_Cryptography_Extension). See
77
[Java Cryptography Architecture (JCA) Reference Guide](https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html)
8-
for key classes and explanations as to how _Bouncy Castle_ is plugged in (other security providers).
8+
for key classes and explanations as to how _Bouncy Castle_ is plugged in (other security providers).
9+
Also necessary for [certain algorithms](./standards.md#implementedavailable-support) that are supported only
10+
if Bouncy Castle is present.
911

1012
**Caveat**: If _Bouncy Castle_ modules are registered, then the code will use its implementation of the ciphers,
1113
keys, signatures, etc. rather than the default JCE provided in the JVM.

sshd-common/src/main/java/org/apache/sshd/common/config/keys/OpenSshCertificate.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.Collections;
2626
import java.util.List;
2727
import java.util.SortedMap;
28-
import java.util.concurrent.TimeUnit;
2928

3029
import org.apache.sshd.common.NamedFactory;
3130
import org.apache.sshd.common.signature.Signature;
@@ -210,8 +209,7 @@ public static Type fromCode(int code) {
210209
* @return {@code true} if the certificate is valid according to its timestamps, {@code false} otherwise
211210
*/
212211
static boolean isValidNow(OpenSshCertificate cert) {
213-
long now = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());
214-
return Long.compareUnsigned(cert.getValidAfter(), now) <= 0 && Long.compareUnsigned(now, cert.getValidBefore()) < 0;
212+
return isValidAt(cert, Instant.now());
215213
}
216214

217215
/**

sshd-contrib/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<dependency>
9999
<groupId>org.assertj</groupId>
100100
<artifactId>assertj-core</artifactId>
101-
<version>3.27.4</version>
101+
<version>3.27.5</version>
102102
<scope>test</scope>
103103
</dependency>
104104
</dependencies>

sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpTransferTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,23 @@
2929
import java.util.List;
3030

3131
import org.apache.sshd.client.session.ClientSession;
32+
import org.apache.sshd.common.session.Session;
33+
import org.apache.sshd.common.session.SessionListener;
3234
import org.apache.sshd.core.CoreModuleProperties;
3335
import org.apache.sshd.sftp.client.fs.SftpFileSystem;
36+
import org.junit.jupiter.api.BeforeAll;
3437
import org.junit.jupiter.api.MethodOrderer.MethodName;
3538
import org.junit.jupiter.api.TestMethodOrder;
3639
import org.junit.jupiter.params.ParameterizedTest;
3740
import org.junit.jupiter.params.provider.MethodSource;
41+
import org.slf4j.Logger;
42+
import org.slf4j.LoggerFactory;
3843

3944
@TestMethodOrder(MethodName.class)
4045
class SftpTransferTest extends AbstractSftpClientTestSupport {
4146

47+
private static final Logger LOG = LoggerFactory.getLogger(SftpTransferTest.class);
48+
4249
private static final int BUFFER_SIZE = 8192;
4350

4451
static List<Long> getParameters() {
@@ -48,6 +55,16 @@ static List<Long> getParameters() {
4855
return params;
4956
}
5057

58+
@BeforeAll
59+
static void logExceptions() {
60+
sshd.addSessionListener(new SessionListener() {
61+
@Override
62+
public void sessionException(Session session, Throwable t) {
63+
LOG.warn("**** Session {} caught exception", session, t);
64+
}
65+
});
66+
}
67+
5168
@MethodSource("getParameters")
5269
@ParameterizedTest(name = "REKEY_BLOCK_SIZE {0}")
5370
void transferIntegrity(long rekeyBlockSize) throws IOException {

0 commit comments

Comments
 (0)