From 35c34a549cc933dc2d1d23ad4bfa88187fe77e7a Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sun, 27 Jan 2019 23:27:00 +0000 Subject: [PATCH 1/2] EdDSAEngine.initVerify(): Handle any non-EdDSAPublicKey X.509-encoded pubkey sun.security.x509.X509Key is a JDK-internal API, and should not be used directly. Instead of looking for an instance of that class, we check the primary encoding format of the PublicKey, and proceed if it is "X.509". --- src/net/i2p/crypto/eddsa/EdDSAEngine.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/net/i2p/crypto/eddsa/EdDSAEngine.java b/src/net/i2p/crypto/eddsa/EdDSAEngine.java index 1f0ba6dd..6b254102 100644 --- a/src/net/i2p/crypto/eddsa/EdDSAEngine.java +++ b/src/net/i2p/crypto/eddsa/EdDSAEngine.java @@ -29,7 +29,6 @@ import net.i2p.crypto.eddsa.math.Curve; import net.i2p.crypto.eddsa.math.GroupElement; import net.i2p.crypto.eddsa.math.ScalarOps; -import sun.security.x509.X509Key; /** * Signing and verification for EdDSA. @@ -157,7 +156,7 @@ protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException } } else if (!key.getParams().getHashAlgorithm().equals(digest.getAlgorithm())) throw new InvalidKeyException("Key hash algorithm does not match chosen digest"); - } else if (publicKey instanceof X509Key) { + } else if (publicKey.getFormat().equals("X.509")) { // X509Certificate will sometimes contain an X509Key rather than the EdDSAPublicKey itself; the contained // key is valid but needs to be instanced as an EdDSAPublicKey before it can be used. EdDSAPublicKey parsedPublicKey; From 8d90c59baeb6bdc6a8604b9ec4aa6658e300b057 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 3 Aug 2019 22:31:43 +0100 Subject: [PATCH 2/2] Travis CI: Use Trusty build environment Travis CI recently bumped the default build environment from Trusty to Xenial. The latter does not enable installing Java 7 or 8, which we still test against. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3101f457..0d2a73aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: java +dist: trusty jdk: - oraclejdk11