This is an automated email from the ASF dual-hosted git repository. lgoldstein pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mina-sshd.git
commit 5aa10b3cb9ba2022ba38a1a4dc16ee9075ad1585 Author: Lyor Goldstein <lgoldst...@apache.org> AuthorDate: Wed Apr 8 00:55:00 2020 +0300 Updated JUnitTestSupport#assertKeyEquals to check DSA private key as well --- pom.xml | 3 +++ .../src/test/java/org/apache/sshd/util/test/JUnitTestSupport.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c072bc0..aa227e2 100644 --- a/pom.xml +++ b/pom.xml @@ -109,6 +109,9 @@ <groovy.compliance.level>2.0</groovy.compliance.level> <groovy.version>${groovy.major.version}.${groovy.minor.version}.${groovy.release.version}</groovy.version> + <!-- NOTE: BC 1.65+ seems to have an NPE bug in Key#getAlgorithm() + * see https://github.com/bcgit/bc-java/issues/684 + --> <bouncycastle.version>1.64</bouncycastle.version> <slf4j.version>1.7.30</slf4j.version> <spring.version>5.2.5.RELEASE</spring.version> diff --git a/sshd-common/src/test/java/org/apache/sshd/util/test/JUnitTestSupport.java b/sshd-common/src/test/java/org/apache/sshd/util/test/JUnitTestSupport.java index ed191a2..61703f3 100644 --- a/sshd-common/src/test/java/org/apache/sshd/util/test/JUnitTestSupport.java +++ b/sshd-common/src/test/java/org/apache/sshd/util/test/JUnitTestSupport.java @@ -422,10 +422,12 @@ public abstract class JUnitTestSupport extends Assert { assertECPublicKeyEquals(message, ECPublicKey.class.cast(expected), ECPublicKey.class.cast(actual)); } else if (expected instanceof RSAPrivateKey) { assertRSAPrivateKeyEquals(message, RSAPrivateKey.class.cast(expected), RSAPrivateKey.class.cast(actual)); + } else if (expected instanceof DSAPrivateKey) { + assertDSAPrivateKeyEquals(message, DSAPrivateKey.class.cast(expected), DSAPrivateKey.class.cast(actual)); } else if (expected instanceof ECPrivateKey) { assertECPrivateKeyEquals(message, ECPrivateKey.class.cast(expected), ECPrivateKey.class.cast(actual)); } - assertArrayEquals(message + "[encdoded-data]", expected.getEncoded(), actual.getEncoded()); + assertArrayEquals(message + "[encoded-data]", expected.getEncoded(), actual.getEncoded()); } public static void assertRSAPublicKeyEquals(String message, RSAPublicKey expected, RSAPublicKey actual) {