Skip to content

Commit 58f836b

Browse files
Merge branch 'release/1.4.3'
2 parents edd8615 + 0347f47 commit 58f836b

File tree

4 files changed

+45
-11
lines changed

4 files changed

+45
-11
lines changed

pom.xml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.cryptomator</groupId>
55
<artifactId>siv-mode</artifactId>
6-
<version>1.4.2</version>
6+
<version>1.4.3</version>
77

88
<name>SIV Mode</name>
99
<description>RFC 5297 SIV mode: deterministic authenticated encryption</description>
@@ -37,12 +37,12 @@
3737
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3838

3939
<!-- dependencies -->
40-
<bouncycastle.version>1.68</bouncycastle.version>
40+
<bouncycastle.version>1.69</bouncycastle.version>
4141

4242
<!-- test dependencies -->
43-
<junit.version>5.7.1</junit.version>
44-
<mockito.version>3.10.0</mockito.version>
45-
<jmh.version>1.31</jmh.version>
43+
<junit.version>5.7.2</junit.version>
44+
<mockito.version>3.11.2</mockito.version>
45+
<jmh.version>1.32</jmh.version>
4646
<hamcrest.version>2.2</hamcrest.version>
4747
<guava.version>30.1.1-jre</guava.version>
4848
</properties>
@@ -174,7 +174,7 @@
174174
</plugin>
175175
<plugin>
176176
<artifactId>maven-javadoc-plugin</artifactId>
177-
<version>3.2.0</version>
177+
<version>3.3.0</version>
178178
<executions>
179179
<execution>
180180
<id>attach-javadocs</id>
@@ -235,7 +235,7 @@
235235
<plugin>
236236
<groupId>org.owasp</groupId>
237237
<artifactId>dependency-check-maven</artifactId>
238-
<version>6.1.0</version>
238+
<version>6.2.2</version>
239239
<configuration>
240240
<cveValidForHours>24</cveValidForHours>
241241
<failBuildOnCVSS>0</failBuildOnCVSS>
@@ -259,7 +259,7 @@
259259
<plugin>
260260
<groupId>org.jacoco</groupId>
261261
<artifactId>jacoco-maven-plugin</artifactId>
262-
<version>0.8.6</version>
262+
<version>0.8.7</version>
263263
<executions>
264264
<execution>
265265
<id>prepare-agent</id>
@@ -268,6 +268,12 @@
268268
</goals>
269269
</execution>
270270
</executions>
271+
<!-- workaround for https://github.com/jacoco/jacoco/issues/407 -->
272+
<configuration>
273+
<excludes>
274+
<exclude>META-INF/**</exclude>
275+
</excludes>
276+
</configuration>
271277
</plugin>
272278
</plugins>
273279
</build>
@@ -279,7 +285,7 @@
279285
<plugins>
280286
<plugin>
281287
<artifactId>maven-gpg-plugin</artifactId>
282-
<version>1.6</version>
288+
<version>3.0.1</version>
283289
<executions>
284290
<execution>
285291
<id>sign-artifacts</id>

src/main/java/org/cryptomator/siv/SivMode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public SivMode() {
5151
* @see #SivMode(BlockCipherFactory)
5252
*/
5353
public SivMode(final Provider jceSecurityProvider) {
54-
this(ThreadLocal.withInitial(() -> new JceAesBlockCipher(jceSecurityProvider)), new JceAesCtrComputer(jceSecurityProvider));
54+
this(ThreadLocals.withInitial(() -> new JceAesBlockCipher(jceSecurityProvider)), new JceAesCtrComputer(jceSecurityProvider));
5555
}
5656

5757
/**
@@ -60,7 +60,7 @@ public SivMode(final Provider jceSecurityProvider) {
6060
* @param cipherFactory A factory method creating a Blockcipher.get(). Must use a block size of 128 bits (16 bytes).
6161
*/
6262
public SivMode(final BlockCipherFactory cipherFactory) {
63-
this(ThreadLocal.withInitial(() -> cipherFactory.create()));
63+
this(ThreadLocals.withInitial(() -> cipherFactory.create()));
6464
}
6565

6666
private SivMode(final ThreadLocal<BlockCipher> threadLocalCipher) {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.cryptomator.siv;
2+
3+
import java.util.function.Supplier;
4+
5+
class ThreadLocals {
6+
7+
static <S> ThreadLocal<S> withInitial(Supplier<S> supplier) {
8+
// ThreadLocal.withInitial is unavailable on Android 7.x
9+
return new ThreadLocal<S>() {
10+
@Override
11+
protected S initialValue() {
12+
return supplier.get();
13+
}
14+
};
15+
}
16+
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.cryptomator.siv;
2+
3+
import java.util.function.Supplier;
4+
5+
class ThreadLocals {
6+
7+
static <S> ThreadLocal<S> withInitial(Supplier<S> supplier) {
8+
return ThreadLocal.withInitial(supplier);
9+
}
10+
11+
}

0 commit comments

Comments
 (0)