Skip to content

Commit f6a07db

Browse files
author
gefeili
committed
Merge branch 'main' into shamir-secret-splitting
2 parents 552e55c + 39cd39a commit f6a07db

File tree

155 files changed

+3589
-3091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+3589
-3091
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ ant-build:
3131
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/build_1_8.sh\""
3232

3333

34-
test-code-8:
34+
test-code:
3535
stage: test
3636
needs: [ "check-code" ]
3737
script:
3838
- "ecr_login"
3939
- "ecr_pull vm_base_intel latest"
40-
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_8.sh\""
40+
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test.sh\""
4141
artifacts:
4242
when: always
4343
reports:
@@ -51,67 +51,6 @@ test-code-8:
5151
- "tls/build/test-results/**/*.xml"
5252
- "mls/build/test-results/**/*.xml"
5353

54-
test-code-11:
55-
stage: test
56-
needs: [ "check-code" ]
57-
script:
58-
- "ecr_login"
59-
- "ecr_pull vm_base_intel latest"
60-
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_11.sh\""
61-
artifacts:
62-
when: always
63-
reports:
64-
junit:
65-
- "core/build/test-results/**/*.xml"
66-
- "prov/build/test-results/**/*.xml"
67-
- "pg/build/test-results/**/*.xml"
68-
- "pkix/build/test-results/**/*.xml"
69-
- "mail/build/test-results/**/*.xml"
70-
- "util/build/test-results/**/*.xml"
71-
- "tls/build/test-results/**/*.xml"
72-
- "mls/build/test-results/**/*.xml"
73-
74-
75-
test-code-17:
76-
stage: test
77-
needs: [ "check-code" ]
78-
script:
79-
- "ecr_login"
80-
- "ecr_pull vm_base_intel latest"
81-
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_17.sh\""
82-
artifacts:
83-
when: always
84-
reports:
85-
junit:
86-
- "core/build/test-results/**/*.xml"
87-
- "prov/build/test-results/**/*.xml"
88-
- "pg/build/test-results/**/*.xml"
89-
- "pkix/build/test-results/**/*.xml"
90-
- "mail/build/test-results/**/*.xml"
91-
- "util/build/test-results/**/*.xml"
92-
- "tls/build/test-results/**/*.xml"
93-
- "mls/build/test-results/**/*.xml"
94-
95-
96-
test-code-21:
97-
stage: test
98-
needs: [ "check-code" ]
99-
script:
100-
- "ecr_login"
101-
- "ecr_pull vm_base_intel latest"
102-
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test_21.sh\""
103-
artifacts:
104-
when: always
105-
reports:
106-
junit:
107-
- "core/build/test-results/**/*.xml"
108-
- "prov/build/test-results/**/*.xml"
109-
- "pg/build/test-results/**/*.xml"
110-
- "pkix/build/test-results/**/*.xml"
111-
- "mail/build/test-results/**/*.xml"
112-
- "util/build/test-results/**/*.xml"
113-
- "tls/build/test-results/**/*.xml"
114-
- "mls/build/test-results/**/*.xml"
11554

11655

11756
spongycastle:

CONTRIBUTORS.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@
551551
<li>Markus Sommer &lt;https://github.com/marsom&gt; - BCStyle lookup table fix for jurisdiction values.</li>
552552
<li>TaZbon &lt;https://github.com/TaZbon&gt; - Optional lax parsing patch for PEM parser.</li>
553553
<li>han-ji &lt;https://github.com/han-jl&gt; - Fix to sign extension issue in CTR random seek code.</li>
554+
<li>https://github.com/crlorentzen &lt;https://github.com/crlorentzen&gt; - Addition of system property for configuring GCM ciphers in 1.2 FIPS mode in the JSSE.</li>
554555
</ul>
555556
</body>
556557
</html>

README.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,39 @@ Except where otherwise stated, this software is distributed under a license base
1010

1111
**Note**: this source tree is not the FIPS version of the APIs - if you are interested in our FIPS version please contact us directly at [[email protected]](mailto:[email protected]).
1212

13+
## Maven Public Key
14+
15+
The file [bc_maven_public_key.asc](bc_maven_public_key.asc) contains the public key used to sign our artifacts on Maven Central. You will need to use
16+
17+
```
18+
gpg -o bc_maven_public_key.gpg --dearmor bc_maven_public_key.asc
19+
```
20+
21+
to dearmor the key before use. Once that is done, a file can be verified by using:
22+
23+
```
24+
gpg --no-default-keyring --keyring ./bc_maven_public_key.gpg --verify file_name.jar.asc file_name.jar
25+
```
26+
27+
Note: the ./ is required in front of the key file name to tell gpg to look locally.
28+
29+
## Building overview
30+
31+
This project can now be built and tested with JDK21.
32+
33+
If the build script detects BC_JDK8, BC_JDK11, BC_JDK17 it will add to the usual test task a dependency on test tasks
34+
that specifically use the JVMs addressed by those environmental variables. The script relies on JAVA_HOME for picking up Java 21 if it is use.
35+
36+
We support testing on specific JVMs as it is the only way to be certain the library is compatible.
1337

1438
## Environmental Variables
1539

16-
Before invoking gradlew you need to ensure the following environmental variables are defined and point
17-
to valid JAVA_HOMEs for each JVM version:
40+
The following environmental variables can optionally point to the JAVA_HOME for each JVM version.
1841

1942
```
2043
export BC_JDK8=/path/to/java8
2144
export BC_JDK11=/path/to/java11
2245
export BC_JDK17=/path/to/java17
23-
export BC_JDK21=/path/to/java21
2446
```
2547

2648
## Building
@@ -30,7 +52,8 @@ The project now uses ```gradlew``` which can be invoked for example:
3052
```
3153
# from the root of the project
3254
33-
# Ensure JAVA_HOME points to JDK 17 or higher JAVA_HOME
55+
# Ensure JAVA_HOME points to JDK 21 or higher JAVA_HOME or that
56+
# gradlew can find a java 21 installation to use.
3457
3558
3659
./gradlew clean build
@@ -41,19 +64,17 @@ The gradle script will endeavour to verify their existence but not the correctne
4164

4265

4366
## Multi-release jars and testing
44-
Some subprojects produce multi-release jars and these jars are tested in different jvm versions.
45-
Default testing on these projects is done on java 1.8 and there are specific test tasks for other versions.
46-
47-
1. test11 test on java 11 JVM
48-
2. test17 test on java 17 JVM
49-
3. test21 test on java 21 JVM
50-
51-
To run all of them:
67+
Some subprojects produce multi-release jars and these jars are can be tested on different jvm versions specifically.
5268

69+
If the env vars are defined:
5370
```
54-
./gradlew clean build test11 test17 test21
71+
export BC_JDK8=/path/to/java8
72+
export BC_JDK11=/path/to/java11
73+
export BC_JDK17=/path/to/java17
5574
```
5675

76+
If only a Java 21 JDK is present then the normal test task and test21 are run only.
77+
5778

5879
## Code Organisation
5980

bc_maven_public_key.asc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
3+
mQGNBGR/8HUBDADJ+V5VgTXFG4xVI/1r07a/pTXoAQhHyJMkVdFScGARsps07VXI
4+
IsYgPsifOFU55E7uRMZPTLAx5F1uxoZAWGtXIz0d4ISKhobFquH8jZe7TnsJBJNV
5+
eo3u7G54iSfLifiJ4q17NvaESBNSirPaAPfEni93+gQvdn3zVnDPfO+mhO00l/fE
6+
5GnqHt/Q2z2WKVQt3Vg0R66phe2XaFnycY/d+an73FiXqhuhm4sXlcA++gfSt1H1
7+
K7+ApqJsX9yw79A1FlGTPOeimqZqE75+OyQ9Kz0XTvN/GmHeEygTrNEnMDTr1BWz
8+
P0/ut0UXmktJtJXgLi5wUCncwwi+UpCSwwou7/3r+eBh5aykxSo9OtYe4xPNKWSo
9+
EiPZXpCH5Wjq9TpXOuhnZvRFqbR24mWz5+J/DoaVP3pwEhGXxr5VjVc1f8gJ8A34
10+
YYPlxUGcl8f3kykzvl4X5HDIbHb9MAl+9qtwQo1tFA9umD2Da/8bSsxrnZdkkzEA
11+
OpJYwT1EkQRZRcUAEQEAAbRmVGhlIExlZ2lvbiBvZiB0aGUgQm91bmN5IENhc3Rs
12+
ZSBJbmMuIChNYXZlbiBSZXBvc2l0b3J5IEFydGlmYWN0IFNpZ25lcikgPGJjbWF2
13+
ZW5zeW5jQGJvdW5jeWNhc3RsZS5vcmc+iQHUBBMBCgA+FiEEexIbdqftbObmCtUX
14+
hOkTqOOnSMAFAmR/8HUCGwMFCQlmAYAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA
15+
CgkQhOkTqOOnSMCTYgv/c9RSHcO056c7G3mH94eTqCMNSzhaiVIMKPgRwro10vpu
16+
hOLdRfwkxe9nsa9tDGiv64sqUZADfnPxNP6mSE4la+fucwn5j1KxIicQt11zRO/e
17+
Ep2vqBZoq60D9p23foDi4/XGuKtnwYQxyaLrvkFaAUpKYzCr7aU1ftqFfE+lKyYB
18+
poQtib1PNqltKs/dX0IHACOeYbZ+j4YZnd6Qsl1XhDtVAYzIW60A3nDwDjOWTNaQ
19+
2W0qX4xrG5XetqnhQj+nwGtkJFXJj7FF1QkIcWiwkAQZTxZk3F0hxlNrZY2rq9BE
20+
nbmwMMCk8S/nn9gBeGriom2StkZC+1Bv/w7BS5fWUW9YzJ5803RVkOd+8Taeu2yn
21+
XUvPNfvijmRO1doTXl7uE5fXAxFmG0+09W5sLVf0KBtdrQ1jzFUZas5iPQiXDNTF
22+
aD3d7kQH7divX3PoZIbq1aaiI2yVI8k5MCYjQPQJbDiBGZumxgkm8J5ooOYVkR9F
23+
dETovzOLJ8QqCzo41kBp
24+
=gIeQ
25+
-----END PGP PUBLIC KEY BLOCK-----

build.gradle

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ plugins {
1515
}
1616

1717
println("Environment setup:")
18-
["BC_JDK8", "BC_JDK11", "BC_JDK17", "BC_JDK21"].each({ it ->
18+
["BC_JDK8", "BC_JDK11", "BC_JDK17"].each({ it ->
1919
println("Looking for JDK ENV '${it}' found ${System.getenv(it)}");
20-
if (System.getenv(it) == null) {
21-
throw new RuntimeException("Looking for JDK ENV '${it}' but found null, see README 'Environmental variables'");
22-
}
20+
// if (System.getenv(it) == null) {
21+
// throw new RuntimeException("Looking for JDK ENV '${it}' but found null, see README 'Environmental variables'");
22+
// }
2323
})
2424

2525

@@ -178,25 +178,25 @@ ext {
178178
ext.vmrange = 'jdk18on'
179179
}
180180

181-
bc_prov = "${rootProject.projectDir}/prov/build/libs/bcprov-${vmrange}-${version}.jar"
182-
bc_util = "${rootProject.projectDir}/util/build/libs/bcutil-${vmrange}-${version}.jar"
183-
bc_pkix = "${rootProject.projectDir}/pkix/build/libs/bcpkix-${vmrange}-${version}.jar"
184-
185181
}
186182

187183

188-
189-
190184
subprojects {
191185
apply plugin: 'eclipse'
192186

187+
193188
JavaVersion current = JavaVersion.current();
189+
int releaseVersion = 8;
194190
if (current.compareTo(JavaVersion.VERSION_1_8) <= 0) {
195-
sourceCompatibility = 1.5
196-
targetCompatibility = 1.5
197-
} else {
198-
sourceCompatibility = 1.8
199-
targetCompatibility = 1.8
191+
releaseVersion = 5
192+
}
193+
194+
compileJava {
195+
options.release = releaseVersion;
196+
}
197+
198+
compileTestJava {
199+
options.release = 8;
200200
}
201201

202202

@@ -220,7 +220,7 @@ subprojects {
220220
maxParallelForks = 1;
221221
systemProperty 'bc.test.data.home', bcTestDataHome
222222
maxHeapSize = "1536m"
223-
testLogging.showStandardStreams = true
223+
testLogging.showStandardStreams = false
224224

225225
javaLauncher = javaToolchains.launcherFor {
226226
languageVersion = JavaLanguageVersion.of(8)
@@ -270,6 +270,13 @@ subprojects {
270270
junitXml.outputLocation = layout.buildDirectory.dir("test-results")
271271
}
272272
}
273+
274+
tasks.withType(JavaCompile).configureEach {
275+
javaCompiler = javaToolchains.compilerFor {
276+
languageVersion = JavaLanguageVersion.of(21)
277+
}
278+
}
273279
}
274280

275-
test.dependsOn([':core:test', ':prov:test', ':prov:test11', ':prov:test17', ':prov:test21', ':pkix:test', 'pg:test', ':tls:test', 'mls:test', 'mail:test', 'jmail:test'])
281+
282+
test.dependsOn([':core:test', ':prov:test', ':prov:test11', ':prov:test15', ':prov:test21', ':pkix:test', 'pg:test', ':tls:test', 'mls:test', 'mail:test', 'jmail:test'])

ci/check_java.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ set -e
99
cd /workspace/bc-java
1010
source ci/common.sh
1111

12-
export BC_JDK8=`openjdk_8`
13-
export BC_JDK11=`openjdk_11`
14-
export BC_JDK15=`openjdk_15`
15-
export BC_JDK17=`openjdk_17`
16-
export BC_JDK21=`openjdk_21`
1712

18-
export JAVA_HOME=`openjdk_17`
13+
14+
export JAVA_HOME=`openjdk_21`
1915
export PATH=$JAVA_HOME/bin:$PATH
2016

2117
# Checkstyle

ci/test_11.sh renamed to ci/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ source ci/common.sh
1212
export BC_JDK8=`openjdk_8`
1313
export BC_JDK11=`openjdk_11`
1414
export BC_JDK17=`openjdk_17`
15-
export BC_JDK21=`openjdk_21`
1615

17-
18-
export JAVA_HOME=`openjdk_17`
16+
export JAVA_HOME=`openjdk_21`
1917
export PATH=$JAVA_HOME/bin:$PATH
2018

21-
./gradlew -stacktrace clean build test11 -x test
19+
./gradlew -stacktrace clean build
2220

2321

2422

ci/test_17.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

ci/test_21.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

ci/test_8.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)