update bouncycastle, junit, logback and slf4j dependencies

This commit is contained in:
Craig Raw 2024-02-15 09:22:15 +02:00
parent 3dbcdfcf4e
commit e82e5c8218
4 changed files with 11 additions and 29 deletions

View file

@ -31,7 +31,7 @@ dependencies {
exclude group: 'org.hamcrest', module: 'hamcrest-core' exclude group: 'org.hamcrest', module: 'hamcrest-core'
exclude group: 'junit', module: 'junit' exclude group: 'junit', module: 'junit'
} }
implementation ('org.bouncycastle:bcprov-jdk15on:1.64') { implementation ('org.bouncycastle:bcprov-jdk18on:1.77') {
exclude group: 'org.hamcrest', module: 'hamcrest-core' exclude group: 'org.hamcrest', module: 'hamcrest-core'
} }
implementation ('de.mkammerer:argon2-jvm:2.11') { implementation ('de.mkammerer:argon2-jvm:2.11') {
@ -40,16 +40,13 @@ dependencies {
exclude group: 'net.java.dev.jna', module: 'jna' exclude group: 'net.java.dev.jna', module: 'jna'
} }
implementation ('net.java.dev.jna:jna:5.8.0') implementation ('net.java.dev.jna:jna:5.8.0')
implementation ('ch.qos.logback:logback-classic:1.2.8') { implementation ('ch.qos.logback:logback-classic:1.4.14') {
exclude group: 'org.hamcrest', module: 'hamcrest-core' exclude group: 'org.hamcrest', module: 'hamcrest-core'
exclude group: 'org.slf4j' exclude group: 'org.slf4j'
} }
implementation ('org.slf4j:slf4j-api:1.7.30') implementation ('org.slf4j:slf4j-api:2.0.12')
testImplementation ('junit:junit:4.12') { testImplementation('org.junit.jupiter:junit-jupiter-api:5.10.0')
exclude group: 'org.hamcrest', module: 'hamcrest-core' testImplementation('org.junit.vintage:junit-vintage-engine:5.10.0')
}
testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version: '2.2'
testImplementation 'junit:junit:4.13.1'
} }
processResources { processResources {
@ -61,25 +58,10 @@ processResources {
} }
extraJavaModuleInfo { extraJavaModuleInfo {
module('logback-core-1.2.8.jar', 'logback.core', '1.2.8') {
exports('ch.qos.logback.core')
exports('ch.qos.logback.core.spi')
requires('java.xml')
}
module('logback-classic-1.2.8.jar', 'logback.classic', '1.2.8') {
exports('ch.qos.logback.classic')
exports('ch.qos.logback.classic.spi')
requires('org.slf4j')
requires('logback.core')
requires('java.xml')
requires('java.logging')
}
module('json-simple-1.1.1.jar', 'json.simple', '1.1.1') { module('json-simple-1.1.1.jar', 'json.simple', '1.1.1') {
exports('org.json.simple') exports('org.json.simple')
exports('org.json.simple.parser') exports('org.json.simple.parser')
} }
module('jnacl-1.0.0.jar', 'eu.neilalexander.jnacl', '1.0.0') module('jnacl-1.0.0.jar', 'eu.neilalexander.jnacl', '1.0.0')
module('junit-4.12.jar', 'junit', '4.12') { module('hamcrest-core-1.3.jar', 'org.hamcrest.core', '1.3')
exports('org.junit')
}
} }

View file

@ -41,7 +41,7 @@ public class AESKeyCrypter implements KeyCrypter {
ParametersWithIV keyWithIv = new ParametersWithIV(new KeyParameter(aesKey.getKeyBytes()), dataToDecrypt.getInitialisationVector()); ParametersWithIV keyWithIv = new ParametersWithIV(new KeyParameter(aesKey.getKeyBytes()), dataToDecrypt.getInitialisationVector());
// Decrypt the message. // Decrypt the message.
BufferedBlockCipher cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESEngine())); BufferedBlockCipher cipher = new PaddedBufferedBlockCipher(CBCBlockCipher.newInstance(AESEngine.newInstance()));
cipher.init(false, keyWithIv); cipher.init(false, keyWithIv);
byte[] cipherBytes = dataToDecrypt.getEncryptedBytes(); byte[] cipherBytes = dataToDecrypt.getEncryptedBytes();
@ -79,7 +79,7 @@ public class AESKeyCrypter implements KeyCrypter {
ParametersWithIV keyWithIv = new ParametersWithIV(new KeyParameter(aesKey.getKeyBytes()), iv); ParametersWithIV keyWithIv = new ParametersWithIV(new KeyParameter(aesKey.getKeyBytes()), iv);
// Encrypt using AES. // Encrypt using AES.
BufferedBlockCipher cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESEngine())); BufferedBlockCipher cipher = new PaddedBufferedBlockCipher(CBCBlockCipher.newInstance(AESEngine.newInstance()));
cipher.init(true, keyWithIv); cipher.init(true, keyWithIv);
byte[] encryptedBytes = new byte[cipher.getOutputSize(plainBytes.length)]; byte[] encryptedBytes = new byte[cipher.getOutputSize(plainBytes.length)];
final int length1 = cipher.processBytes(plainBytes, 0, plainBytes.length, encryptedBytes, 0); final int length1 = cipher.processBytes(plainBytes, 0, plainBytes.length, encryptedBytes, 0);

View file

@ -552,7 +552,7 @@ public class ECKey {
throw new IllegalArgumentException("Input has 'publicKey' with bad tag number"); throw new IllegalArgumentException("Input has 'publicKey' with bad tag number");
} }
byte[] pubbits = ((DERBitString)pubkey.getObject()).getBytes(); byte[] pubbits = ((DERBitString)pubkey.getBaseObject()).getBytes();
if(pubbits.length != 33 && pubbits.length != 65) { if(pubbits.length != 33 && pubbits.length != 65) {
throw new IllegalArgumentException("Input has 'publicKey' with invalid length"); throw new IllegalArgumentException("Input has 'publicKey' with invalid length");
}; };

View file

@ -2,8 +2,8 @@ open module com.sparrowwallet.drongo {
requires org.bouncycastle.provider; requires org.bouncycastle.provider;
requires de.mkammerer.argon2.nolibs; requires de.mkammerer.argon2.nolibs;
requires org.slf4j; requires org.slf4j;
requires logback.core; requires ch.qos.logback.core;
requires logback.classic; requires ch.qos.logback.classic;
requires json.simple; requires json.simple;
exports com.sparrowwallet.drongo; exports com.sparrowwallet.drongo;
exports com.sparrowwallet.drongo.psbt; exports com.sparrowwallet.drongo.psbt;