Skip to content

Commit 67553a2

Browse files
committed
Merge branch 'release/2.1.2'
2 parents 93c0810 + 6e3fe63 commit 67553a2

File tree

9 files changed

+36
-48
lines changed

9 files changed

+36
-48
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ jobs:
77
runs-on: ubuntu-latest
88
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
with:
1212
fetch-depth: 0
13-
- uses: actions/setup-java@v1
13+
- uses: actions/setup-java@v3
1414
with:
1515
java-version: 11
16-
- uses: actions/cache@v2
17-
with:
18-
path: ~/.m2/repository
19-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
20-
restore-keys: |
21-
${{ runner.os }}-maven-
16+
distribution: 'temurin'
17+
cache: 'maven'
2218
- name: Cache SonarCloud packages
23-
uses: actions/cache@v2
19+
uses: actions/cache@v3
2420
with:
2521
path: ~/.sonar/cache
2622
key: ${{ runner.os }}-sonar
@@ -41,18 +37,12 @@ jobs:
4137
env:
4238
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4339
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
44-
- name: Upload code coverage report
45-
id: codacyCoverageReporter
46-
run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
47-
env:
48-
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
49-
continue-on-error: true
50-
- uses: actions/upload-artifact@v2
40+
- uses: actions/upload-artifact@v3
5141
with:
5242
name: artifacts
5343
path: target/*.jar
5444
- name: Create Release
55-
uses: actions/create-release@v1
45+
uses: actions/create-release@v1 # NOTE: action is unmaintained and repo archived
5646
if: startsWith(github.ref, 'refs/tags/')
5747
env:
5848
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,19 @@ jobs:
1515
runs-on: ubuntu-latest
1616
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 2
21-
- uses: actions/setup-java@v1
21+
- uses: actions/setup-java@v3
2222
with:
2323
java-version: 11
24-
- uses: actions/cache@v2
25-
with:
26-
path: ~/.m2/repository
27-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28-
restore-keys: |
29-
${{ runner.os }}-maven-
24+
distribution: 'temurin'
25+
cache: 'maven'
3026
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@v1
27+
uses: github/codeql-action/init@v2
3228
with:
3329
languages: java
3430
- name: Build and Test
3531
run: mvn -B install -DskipTests
3632
- name: Perform CodeQL Analysis
37-
uses: github/codeql-action/analyze@v1
33+
uses: github/codeql-action/analyze@v2

.github/workflows/publish-central.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,19 @@ jobs:
1010
publish:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
ref: "refs/tags/${{ github.event.inputs.tag }}"
16-
- uses: actions/setup-java@v1
16+
- uses: actions/setup-java@v3
1717
with:
1818
java-version: 11
19+
distribution: 'temurin'
20+
cache: 'maven'
1921
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
2022
server-username: MAVEN_USERNAME # env variable for username in deploy
2123
server-password: MAVEN_PASSWORD # env variable for token in deploy
2224
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
2325
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
24-
- uses: actions/cache@v2
25-
with:
26-
path: ~/.m2/repository
27-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28-
restore-keys: |
29-
${{ runner.os }}-maven-
3026
- name: Enforce project version ${{ github.event.inputs.tag }}
3127
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
3228
- name: Deploy

.github/workflows/publish-github.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,14 @@ jobs:
77
runs-on: ubuntu-latest
88
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-java@v1
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-java@v3
1212
with:
1313
java-version: 11
14+
distribution: 'temurin'
15+
cache: 'maven'
1416
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
1517
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
16-
- uses: actions/cache@v2
17-
with:
18-
path: ~/.m2/repository
19-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
20-
restore-keys: |
21-
${{ runner.os }}-maven-
2218
- name: Enforce project version ${{ github.event.release.tag_name }}
2319
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
2420
- name: Deploy

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.cryptomator</groupId>
44
<artifactId>cryptolib</artifactId>
5-
<version>2.1.1</version>
5+
<version>2.1.2</version>
66
<name>Cryptomator Crypto Library</name>
77
<description>This library contains all cryptographic functions that are used by Cryptomator.</description>
88
<url>https://github.com/cryptomator/cryptolib</url>

src/main/java/org/cryptomator/cryptolib/v2/FileContentCryptorImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public void encryptChunk(ByteBuffer cleartextChunk, ByteBuffer ciphertextChunk,
7575

7676
@Override
7777
public ByteBuffer decryptChunk(ByteBuffer ciphertextChunk, long chunkNumber, FileHeader header, boolean authenticate) throws AuthenticationFailedException {
78-
ByteBuffer cleartextChunk = ByteBuffer.allocate(PAYLOAD_SIZE);
78+
// FileHeaderImpl.Payload.SIZE + GCM_TAG_SIZE is required to fix a bug in Android API level pre 29, see https://issuetracker.google.com/issues/197534888 and #35
79+
ByteBuffer cleartextChunk = ByteBuffer.allocate(PAYLOAD_SIZE + GCM_TAG_SIZE);
7980
decryptChunk(ciphertextChunk, cleartextChunk, chunkNumber, header, authenticate);
8081
cleartextChunk.flip();
8182
return cleartextChunk;

src/main/java/org/cryptomator/cryptolib/v2/FileHeaderCryptorImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public FileHeader decryptHeader(ByteBuffer ciphertextHeaderBuf) throws Authentic
9090
buf.position(FileHeaderImpl.PAYLOAD_POS);
9191
buf.get(ciphertextAndTag);
9292

93-
// FileHeaderImpl.Payload.SIZE + GCM_TAG_SIZE is required to fix a bug in Android API level pre 29, see https://issuetracker.google.com/issues/197534888
93+
// FileHeaderImpl.Payload.SIZE + GCM_TAG_SIZE is required to fix a bug in Android API level pre 29, see https://issuetracker.google.com/issues/197534888 and #24
9494
ByteBuffer payloadCleartextBuf = ByteBuffer.allocate(FileHeaderImpl.Payload.SIZE + GCM_TAG_SIZE);
9595
try (DestroyableSecretKey ek = masterkey.getEncKey()) {
9696
// decrypt payload:

src/main/java/org/cryptomator/cryptolib/v2/FileHeaderImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class FileHeaderImpl implements FileHeader, Destroyable {
1919

2020
static final int NONCE_POS = 0;
2121
static final int NONCE_LEN = Constants.GCM_NONCE_SIZE;
22-
static final int PAYLOAD_POS = 12;
22+
static final int PAYLOAD_POS = NONCE_POS + NONCE_LEN; // 12
2323
static final int PAYLOAD_LEN = Payload.SIZE;
24-
static final int TAG_POS = 56;
24+
static final int TAG_POS = PAYLOAD_POS + PAYLOAD_LEN; // 52
2525
static final int TAG_LEN = Constants.GCM_TAG_SIZE;
2626
static final int SIZE = NONCE_LEN + PAYLOAD_LEN + TAG_LEN;
2727

suppression.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,13 @@
99
<cpe>cpe:/a:cryptomator:cryptomator</cpe>
1010
<cve>CVE-2022-25366</cve>
1111
</suppress>
12+
13+
<suppress>
14+
<notes><![CDATA[
15+
Suppress false positive, because com.google.common.io.Files.getTempDir() is not used
16+
]]></notes>
17+
<packageUrl regex="true">^pkg:maven/com\.google\.guava/guava@.*$</packageUrl>
18+
<vulnerabilityName>CVE-2020-8908</vulnerabilityName>
19+
<cve>CVE-2020-8908</cve>
20+
</suppress>
1221
</suppressions>

0 commit comments

Comments
 (0)