Dependency cleaning; more spongification; use composite build to include qilin (need qilin 1.3+ now)

android-scanner
Tal Moran 2017-06-26 01:59:32 +03:00
parent 3c52eb2e8d
commit 68e1737f22
32 changed files with 82 additions and 110 deletions

View File

@ -48,8 +48,13 @@ configurations.all {
// Avoid Android compilation error caused by two different javax.inject dependencies.
substitute module('org.glassfish.hk2.external:javax.inject:2.4.0-b34') with module('javax.inject:javax.inject:1')
}
// Exclude non-android logback modules
exclude group:"ch.qos.logback", module:"logback-core"
exclude group:"ch.qos.logback", module:"logback-classic"
}
dependencies {
// compile fileTree(dir: 'libs', include: ['*.jar'])

7
android-scanner/lint.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="InvalidPackage">
<!-- Ignore javax.mail from logback https://github.com/tony19/logback-android/issues/140-->
<ignore regexp="javax.mail"/>
</issue>
</lint>

View File

@ -160,21 +160,6 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) {
*===================================*/
repositories {
// Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral)
maven {
url nexusRepository
if (isSnapshot) {
credentials { username
password
username nexusUser
password nexusPassword
}
}
}
// Use local maven repository
mavenLocal()

View File

@ -26,7 +26,7 @@ ext {
description = "Meerkat Voting Common Library"
// Your project version
version = "0.0"
version = "0.1"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
@ -49,8 +49,6 @@ dependencies {
testCompile 'junit:junit:4.+'
testCompile 'org.hamcrest:hamcrest-all:1.3'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}
test {

View File

@ -54,10 +54,7 @@ dependencies {
// Depend on test resources from meerkat-common
testCompile project(path: ':meerkat-common', configuration: 'testOutput')
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}

View File

@ -32,7 +32,7 @@ ext {
description = "Distributed key generation code"
// Your project version
version = "0.0"
version = "0.1"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
@ -43,10 +43,7 @@ dependencies {
// Depend on test resources from meerkat-common
testCompile project(path: ':meerkat-common', configuration: 'testOutput')
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}

View File

@ -35,16 +35,16 @@ ext {
description = "Meerkat Voting Common Library"
// Your project version
version = "0.0"
version = "0.1"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
dependencies {
// Logging
compile 'org.slf4j:slf4j-api:1.7.21'
runtime 'ch.qos.logback:logback-classic:1.1.2'
runtime 'ch.qos.logback:logback-core:1.1.2'
compile 'org.slf4j:slf4j-api:1.7.25'
runtime 'ch.qos.logback:logback-classic:1.2.3'
runtime 'ch.qos.logback:logback-core:1.2.3'
// RESTful API
compile 'javax.ws.rs:javax.ws.rs-api:2.0.+'
@ -56,16 +56,15 @@ dependencies {
compile 'com.google.guava:guava:19.0'
// Crypto
compile 'org.factcenter.qilin:qilin:1.2.+'
compile 'org.factcenter.qilin:qilin:1.3.+'
// Use SpongyCastle instead of bouncycastle for android compatibility
// compile 'org.bouncycastle:bcprov-jdk15on:1.57'
// compile 'org.bouncycastle:bcpkix-jdk15on:1.57' // For certificate generation
// compile 'org.bouncy castle:bcprov-jdk15on:1.57'
// compile 'org.bouncy castle:bcpkix-jdk15on:1.57' // For certificate generation
compile 'com.madgag.spongycastle:prov:1.56.0.0'
compile 'com.madgag.spongycastle:bcpkix-jdk15on:1.56.0.0' // For certificate generation
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'

View File

@ -4,14 +4,14 @@ import com.google.protobuf.ByteString;
import com.google.protobuf.Message;
import meerkat.protobuf.Crypto;
import meerkat.protobuf.Crypto.Signature;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.signers.DSAKCalculator;
import org.bouncycastle.crypto.signers.ECDSASigner;
import org.bouncycastle.crypto.signers.HMacDSAKCalculator;
import org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil;
import org.spongycastle.asn1.ASN1Integer;
import org.spongycastle.asn1.DERSequence;
import org.spongycastle.crypto.params.AsymmetricKeyParameter;
import org.spongycastle.crypto.params.ECPrivateKeyParameters;
import org.spongycastle.crypto.signers.DSAKCalculator;
import org.spongycastle.crypto.signers.ECDSASigner;
import org.spongycastle.crypto.signers.HMacDSAKCalculator;
import org.spongycastle.jcajce.provider.asymmetric.util.ECUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -64,7 +64,7 @@ public class ECDSADeterministicSignature extends ECDSASignature {
}
public ECDSADeterministicSignature() {
DSAKCalculator kCalk = new HMacDSAKCalculator(new org.bouncycastle.crypto.digests.SHA256Digest());
DSAKCalculator kCalk = new HMacDSAKCalculator(new org.spongycastle.crypto.digests.SHA256Digest());
deterministicSigner = new ECDSASigner(kCalk);
}

View File

@ -6,15 +6,15 @@ import com.google.protobuf.Message;
import meerkat.crypto.Encryption;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Crypto;
import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.bouncycastle.crypto.params.ECKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.crypto.util.PublicKeyFactory;
import org.bouncycastle.jce.spec.ECParameterSpec;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.util.BigIntegers;
import org.spongycastle.crypto.params.AsymmetricKeyParameter;
import org.spongycastle.crypto.params.ECDomainParameters;
import org.spongycastle.crypto.params.ECKeyParameters;
import org.spongycastle.crypto.params.ECPublicKeyParameters;
import org.spongycastle.crypto.util.PublicKeyFactory;
import org.spongycastle.jce.spec.ECParameterSpec;
import org.spongycastle.math.ec.ECCurve;
import org.spongycastle.math.ec.ECPoint;
import org.spongycastle.util.BigIntegers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.factcenter.qilin.primitives.concrete.ECElGamal;

View File

@ -5,9 +5,9 @@ import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Crypto;
import org.bouncycastle.jce.spec.ECParameterSpec;
import org.bouncycastle.jce.spec.ECPublicKeySpec;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.jce.spec.ECParameterSpec;
import org.spongycastle.jce.spec.ECPublicKeySpec;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;
import org.factcenter.qilin.primitives.generic.ElGamal;

View File

@ -3,7 +3,7 @@ package meerkat.crypto.concrete;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Crypto;
import meerkat.protobuf.Voting;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;

View File

@ -7,9 +7,9 @@ import com.google.protobuf.Message;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.ConcreteCrypto.GroupElement;
import meerkat.protobuf.Crypto;
import org.bouncycastle.jce.spec.ECParameterSpec;
import org.bouncycastle.jce.spec.ECPublicKeySpec;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.jce.spec.ECParameterSpec;
import org.spongycastle.jce.spec.ECPublicKeySpec;
import org.spongycastle.math.ec.ECPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.factcenter.qilin.primitives.concrete.ECElGamal;

View File

@ -44,8 +44,6 @@ dependencies {
compile 'net.sf.jopt-simple:jopt-simple:6.+'
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}

View File

@ -5,7 +5,7 @@ import meerkat.crypto.concrete.Util;
import meerkat.mixer.proofs.SigmaProtocol;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Mixing;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECGroup;
import java.math.BigInteger;

View File

@ -5,7 +5,7 @@ import meerkat.crypto.concrete.ECElGamalEncryption;
import meerkat.protobuf.ConcreteCrypto.ElGamalCiphertext;
import meerkat.protobuf.Crypto;
import meerkat.protobuf.Crypto.EncryptionRandomness;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECGroup;
import java.math.BigInteger;

View File

@ -6,7 +6,7 @@ import meerkat.crypto.concrete.Util;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Crypto;
import meerkat.protobuf.Voting;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.RandomOracle;
import org.factcenter.qilin.primitives.concrete.DigestOracle;
import org.factcenter.qilin.primitives.concrete.ECElGamal;

View File

@ -1,6 +1,6 @@
package meerkat.mixer;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECGroup;
import org.junit.Before;

View File

@ -9,9 +9,9 @@ import meerkat.crypto.concrete.GlobalCryptoSetup;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Crypto;
import meerkat.protobuf.Voting;
import org.bouncycastle.jce.spec.ECParameterSpec;
import org.bouncycastle.jce.spec.ECPublicKeySpec;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.jce.spec.ECParameterSpec;
import org.spongycastle.jce.spec.ECPublicKeySpec;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;
import org.factcenter.qilin.primitives.generic.ElGamal;

View File

@ -7,7 +7,7 @@ import meerkat.mixer.proofs.SigmaProtocolTest;
import meerkat.mixer.proofs.concrete.SchnorrDlogEquivalence;
import meerkat.mixer.proofs.concrete.Statements;
import meerkat.protobuf.Mixing;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECGroup;
import org.factcenter.qilin.util.Pair;

View File

@ -10,7 +10,7 @@ import meerkat.protobuf.Crypto;
import meerkat.protobuf.Mixing;
import meerkat.protobuf.Voting;
//import meerkat.protobuf.Voting.PlaintextBallot;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;

View File

@ -6,7 +6,7 @@ import meerkat.crypto.concrete.Util;
import meerkat.mixer.Utils;
import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Voting;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;

View File

@ -3,7 +3,7 @@ package profiling.ECGroup;
import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.crypto.concrete.ECElGamalEncryption;
import meerkat.crypto.concrete.Util;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;

View File

@ -4,7 +4,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.crypto.concrete.ECElGamalEncryption;
import meerkat.crypto.concrete.Util;
import meerkat.mixer.Utils;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;

View File

@ -3,7 +3,7 @@ package profiling.ECGroup;
import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.crypto.concrete.ECElGamalEncryption;
import meerkat.crypto.concrete.Util;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;

View File

@ -3,7 +3,7 @@ package profiling.ECGroup;
import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.crypto.concrete.ECElGamalEncryption;
import meerkat.crypto.concrete.Util;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.concrete.ECElGamal;
import org.factcenter.qilin.primitives.concrete.ECGroup;

View File

@ -9,7 +9,7 @@ import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Crypto;
import meerkat.protobuf.Voting;
import meerkat.mixer.Utils;
import org.bouncycastle.math.ec.ECPoint;
import org.spongycastle.math.ec.ECPoint;
import org.factcenter.qilin.primitives.RandomOracle;
import org.factcenter.qilin.primitives.concrete.DigestOracle;
import org.factcenter.qilin.primitives.concrete.ECElGamal;

View File

@ -49,7 +49,6 @@ dependencies {
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}

View File

@ -34,7 +34,7 @@ ext {
description = "Common classes for implementing Meerkat's RESTful API"
// Your project version
version = "0.0.1"
version = "0.1.0"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
@ -45,10 +45,6 @@ dependencies {
// Jersey for RESTful API
compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.22.+'
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}

View File

@ -36,7 +36,7 @@ ext {
description = "Common files for polling-station scanner client API"
// Your project version
version = "0.0"
version = "0.1"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
@ -46,17 +46,7 @@ dependencies {
compile project(':meerkat-common')
compile project(':restful-api-common')
// Logging
compile 'org.slf4j:slf4j-api:1.7.7'
runtime 'ch.qos.logback:logback-classic:1.1.2'
runtime 'ch.qos.logback:logback-core:1.1.2'
// Google protobufs
compile 'com.google.protobuf:protobuf-java:3.+'
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}

View File

@ -1,3 +1,5 @@
rootProject.name = 'meerkat'
include 'meerkat-common'
include 'voting-booth'
include 'bulletin-board-server'
@ -15,3 +17,12 @@ include 'voting-booth-gui'
if(file('local.properties').exists() || System.getenv('ANDROID_HOME') != null) {
include 'android-scanner'
}
// Use a local version of qilin if one exists.
if (file('../qilin/settings.gradle').exists()) {
includeBuild ('../qilin') {
dependencySubstitution {
substitute module('org.factcenter.qilin:qilin') with project(':')
}
}
}

View File

@ -46,11 +46,8 @@ dependencies {
compile project(':meerkat-common')
compile project(':voting-booth')
// Logging
compile 'org.slf4j:slf4j-api:1.7.7'
runtime 'ch.qos.logback:logback-classic:1.1.2'
runtime 'ch.qos.logback:logback-core:1.1.2'
// TODO: Remove this dependency
compile project(':polling-station')
// Google protobufs
compile 'com.google.protobuf:protobuf-java:3.+'
@ -59,18 +56,18 @@ dependencies {
compile 'net.sf.jopt-simple:jopt-simple:5.0.3'
// Json configuraiton parsing
// TODO: Remove this dependency
compile group: 'org.json', name: 'json', version: '20160810'
// Jar that creates barcodes
compile group: 'net.sourceforge.barbecue', name: 'barbecue', version: '1.5-beta1'
// Json configuration parsing for the test
// TODO: Remove this dependency
testCompile group: 'org.json', name: 'json', version: '20160810'
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
// Jar that creates QRcodes
compile 'com.google.zxing:core:3.3.0'
}

View File

@ -30,7 +30,7 @@ ext {
description = "Meerkat voting booth application"
// Your project version
version = "0.0"
version = "0.1"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
@ -39,19 +39,12 @@ dependencies {
// Meerkat common
compile project(':meerkat-common')
compile project(':restful-api-common')
// Servlets
compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.3.+'
compile 'org.eclipse.jetty:jetty-server:9.3.+'
compile 'org.eclipse.jetty:jetty-servlet:9.3.+'
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
compile project(':scanner-api-common')
// Meerkat polling station
compile project(':polling-station')
testCompile project(':polling-station')
testCompile 'junit:junit:4.+'
}