From 677c2347c6afdae56cf345c1634585a81f38f82a Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Thu, 16 Apr 2020 13:35:15 +0300 Subject: [PATCH] JCOP4 workaround --- build.gradle | 2 +- src/main/java/im/status/keycard/SecureChannel.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 307d9b8..2a5158c 100644 --- a/build.gradle +++ b/build.gradle @@ -56,7 +56,7 @@ dependencies { testCompile('org.web3j:core:2.3.1') testCompile('org.bitcoinj:bitcoinj-core:0.14.5') testCompile('com.github.status-im.status-keycard-java:desktop:3.0.0') - testCompile('org.bouncycastle:bcprov-jdk15on:1.60') + testCompile('org.bouncycastle:bcprov-jdk15on:1.65') testCompile("org.junit.jupiter:junit-jupiter-api:5.1.1") testRuntime("org.junit.jupiter:junit-jupiter-engine:5.1.1") } diff --git a/src/main/java/im/status/keycard/SecureChannel.java b/src/main/java/im/status/keycard/SecureChannel.java index a77e6a7..dbaf38a 100644 --- a/src/main/java/im/status/keycard/SecureChannel.java +++ b/src/main/java/im/status/keycard/SecureChannel.java @@ -65,7 +65,7 @@ public class SecureChannel { scKeypair.genKeyPair(); remainingSlots = pairingLimit; - + pairingSecret = new byte[SC_SECRET_LENGTH]; } /** @@ -75,9 +75,6 @@ public class SecureChannel { * @param off the offset in the buffer */ public void initSecureChannel(byte[] aPairingSecret, short off) { - if (pairingSecret != null) return; - - pairingSecret = new byte[SC_SECRET_LENGTH]; Util.arrayCopy(aPairingSecret, off, pairingSecret, (short) 0, SC_SECRET_LENGTH); scKeypair.genKeyPair(); }