Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.classpath
.gradle
.project

*.class
*.gen
*.swp

bin/
build/
.settings/
.idea
*.iml
local.properties
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: android
android:
components:
- platform-tools
- build-tools-23.0.1
- android-23

jdk:
- openjdk7

sudo: false

install:
- TERM=dumb ./gradlew assemble

script:
- TERM=dumb ./gradlew check --debug

notifications:
email:
- roberto.tyley@gmail.com
207 changes: 158 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,125 @@
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath "net.saliman:gradle-cobertura-plugin:2.2.8"
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath "net.saliman:gradle-cobertura-plugin:2.3.2"
classpath 'com.android.tools.build:gradle:2.1.2'
}
}

allprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.saliman.cobertura'
configure(allprojects - project(':mail')) {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.saliman.cobertura'

repositories {
mavenCentral()
}
repositories {
mavenCentral()
}

dependencies {
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
// Cobertura declares a dependency on the slf4j API, so we need to supply
// a runtime implementation to avoid NoClassDefFoundErrors
testRuntime "org.slf4j:slf4j-log4j12:1.7.5"
testRuntime "log4j:log4j:1.2.17"
}
}
}

ext {
bcTestDataHome = file('core/src/test/data').absolutePath
}

task printProperties << {
println bcTestDataHome
}

subprojects {
configure(subprojects - project(':mail')) {
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'

group = 'com.madgag.spongycastle'

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}

task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}

artifacts {
archives jar

archives javadocJar
archives sourcesJar
}

if (project.hasProperty("signing.keyId")) {
signing {
sign configurations.archives
}
}

if (project.hasProperty("sonatypeUsername")) {
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

pom.project {
name 'Spongy Castle'
packaging 'jar'
description 'Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle\n' +
'intended for the Android platform. Android unfortunately ships with a stripped-down version of\n' +
'Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full,\n' +
'up-to-date version of the Bouncy Castle cryptographic libs.'
url 'http://rtyley.github.io/spongycastle/'

scm {
url 'scm:git@github.com:rtyley/spongycastle.git'
connection 'scm:git@github.com:rtyley/spongycastle.git'
developerConnection 'scm:git@github.com:rtyley/spongycastle.git'
}

licenses {
license {
name 'Bouncy Castle Licence'
url 'http://www.bouncycastle.org/licence.html'
distribution 'repo'
}
}

developers {
developer {
id 'rtyley'
name 'Roberto Tyley'
}
}
}
}
}
}
}

repositories {
mavenCentral()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}

sourceCompatibility = 1.5
targetCompatibility = 1.5
version = '1.52'
version = '1.54.0.0'

test {
systemProperty 'bc.test.data.home', bcTestDataHome
Expand All @@ -52,32 +130,63 @@ subprojects {
}
}

test.dependsOn([':core:test', ':prov:test', ':pkix:test', ':mail:test', 'pg:test'])
test.dependsOn([':core:test', ':prov:test', ':pkix:test', 'pg:test'])

cobertura {
coverageDirs = [
"${rootProject.projectDir}/core/build/classes/main",
"${rootProject.projectDir}/mail/build/classes/main",
"${rootProject.projectDir}/pg/build/classes/main",
"${rootProject.projectDir}/pkix/build/classes/main",
"${rootProject.projectDir}/prov/build/classes/main"
]
coverageSourceDirs = [
"${rootProject.projectDir}/core/src/main/java",
"${rootProject.projectDir}/mail/src/main/java",
"${rootProject.projectDir}/pg/src/main/java",
"${rootProject.projectDir}/pkix/src/main/java",
"${rootProject.projectDir}/prov/src/main/java",
]
coverageMergeDatafiles = [
file("${rootProject.projectDir}/core/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/mail/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/pg/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/pkix/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/prov/build/cobertura/cobertura.ser"),
]
auxiliaryClasspath += files("${rootProject.projectDir}/core/build/classes/main")
coverageFormats = ['html', 'xml']
coverageReportDir = new File("${rootProject.projectDir}/build/reports/cobertura")
coverageDirs = [
"${rootProject.projectDir}/core/build/classes/main",
"${rootProject.projectDir}/mail/build/classes/main",
"${rootProject.projectDir}/pg/build/classes/main",
"${rootProject.projectDir}/pkix/build/classes/main",
"${rootProject.projectDir}/prov/build/classes/main"
]
coverageSourceDirs = [
"${rootProject.projectDir}/core/src/main/java",
"${rootProject.projectDir}/mail/src/main/java",
"${rootProject.projectDir}/pg/src/main/java",
"${rootProject.projectDir}/pkix/src/main/java",
"${rootProject.projectDir}/prov/src/main/java",
]
coverageMergeDatafiles = [
file("${rootProject.projectDir}/core/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/mail/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/pg/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/pkix/build/cobertura/cobertura.ser"),
file("${rootProject.projectDir}/prov/build/cobertura/cobertura.ser"),
]
auxiliaryClasspath += files("${rootProject.projectDir}/core/build/classes/main")
coverageFormats = ['html', 'xml']
coverageReportDir = new File("${rootProject.projectDir}/build/reports/cobertura")
}

subprojects {
buildscript {
repositories {
jcenter()
maven {
url "https://maven.java.net/content/groups/public/"
}

}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath "net.saliman:gradle-cobertura-plugin:2.3.2"
}
}

if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

}
project(':mail') {
repositories {
jcenter()
}
}

task wrapper(type: Wrapper) {
gradleVersion = '2.10'
}
2 changes: 1 addition & 1 deletion core/src/main/j2me/java/math/BigInteger.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Random;
import java.util.Stack;

import org.bouncycastle.util.Arrays;
import org.spongycastle.util.Arrays;

public class BigInteger
{
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/j2me/java/security/SecureRandom.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

import java.util.Random;

import org.bouncycastle.crypto.digests.SHA1Digest;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.bouncycastle.crypto.prng.RandomGenerator;
import org.bouncycastle.crypto.prng.DigestRandomGenerator;
import org.spongycastle.crypto.digests.SHA1Digest;
import org.spongycastle.crypto.digests.SHA256Digest;
import org.spongycastle.crypto.prng.RandomGenerator;
import org.spongycastle.crypto.prng.DigestRandomGenerator;

/**
* An implementation of SecureRandom specifically for the light-weight API, JDK
* 1.0, and the J2ME. Random generation is based on the traditional SHA1 with
* counter. Calling setSeed will always increase the entropy of the hash.
* <p>
* <b>Do not use this class without calling setSeed at least once</b>! There
* are some example seed generators in the org.bouncycastle.prng package.
* are some example seed generators in the org.spongycastle.prng package.
*/
public class SecureRandom extends java.util.Random
{
Expand Down
Loading