Skip to content

Commit e793ce5

Browse files
Merge branch 'release/2.2.1'
2 parents cc946dd + 19409e6 commit e793ce5

File tree

15 files changed

+138
-142
lines changed

15 files changed

+138
-142
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build
22
on:
3-
[push]
3+
push:
4+
pull_request_target:
5+
types: [labeled]
46
jobs:
57
build:
68
name: Build and Test
@@ -11,7 +13,7 @@ jobs:
1113
fetch-depth: 0
1214
- uses: actions/setup-java@v4
1315
with:
14-
java-version: 22
16+
java-version: 23
1517
distribution: 'temurin'
1618
cache: 'maven'
1719
- name: Cache SonarCloud packages
@@ -46,4 +48,4 @@ jobs:
4648
with:
4749
prerelease: true
4850
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
49-
generate_release_notes: true
51+
generate_release_notes: true

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fetch-depth: 2
2020
- uses: actions/setup-java@v4
2121
with:
22-
java-version: 22
22+
java-version: 23
2323
distribution: 'temurin'
2424
cache: 'maven'
2525
- name: Initialize CodeQL

.github/workflows/dependency-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
runner-os: 'ubuntu-latest'
1616
java-distribution: 'temurin'
17-
java-version: 22
17+
java-version: 23
1818
secrets:
1919
nvd-api-key: ${{ secrets.NVD_API_KEY }}
2020
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
name: Publish to Maven Central
22
on:
3-
workflow_dispatch:
4-
inputs:
5-
tag:
6-
description: 'Tag'
7-
required: true
8-
default: '0.0.0'
3+
release:
4+
types: [published]
95
jobs:
106
publish:
117
runs-on: ubuntu-latest
128
steps:
139
- uses: actions/checkout@v4
14-
with:
15-
ref: "refs/tags/${{ github.event.inputs.tag }}"
1610
- uses: actions/setup-java@v4
1711
with:
18-
java-version: 22
12+
java-version: 23
1913
distribution: 'temurin'
2014
cache: 'maven'
21-
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
22-
server-username: MAVEN_USERNAME # env variable for username in deploy
23-
server-password: MAVEN_PASSWORD # env variable for token in deploy
24-
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
25-
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
26-
- name: Enforce project version ${{ github.event.inputs.tag }}
27-
run: mvn versions:set -B -DnewVersion=$GIT_TAG
15+
server-id: central
16+
server-username: MAVEN_CENTRAL_USERNAME
17+
server-password: MAVEN_CENTRAL_PASSWORD
18+
- name: Enforce project version ${{ github.event.release.tag_name }}
19+
run: mvn versions:set -B -DnewVersion="$GIT_TAG"
20+
env:
21+
GIT_TAG: ${{ github.event.release.tag_name }}
2822
- name: Deploy
2923
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
3024
env:
31-
GIT_TAG: ${{ github.event.inputs.tag }}
32-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
33-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
34-
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
25+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
26+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
27+
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
28+
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
29+
MAVEN_GPG_KEY_FINGERPRINT: ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }}

.github/workflows/publish-github.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,15 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-java@v4
1212
with:
13-
java-version: 22
13+
java-version: 23
1414
distribution: 'temurin'
1515
cache: 'maven'
16-
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
17-
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
1816
- name: Enforce project version ${{ github.event.release.tag_name }}
1917
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
2018
- name: Deploy
2119
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
2220
env:
2321
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2422
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
25-
- name: Slack Notification
26-
uses: rtCamp/action-slack-notify@v2
27-
env:
28-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
29-
SLACK_USERNAME: 'Cryptobot'
30-
SLACK_ICON:
31-
SLACK_ICON_EMOJI: ':bot:'
32-
SLACK_CHANNEL: 'cryptomator-desktop'
33-
SLACK_TITLE: "Published ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}"
34-
SLACK_MESSAGE: "Ready to <https://github.com/${{ github.repository }}/actions/workflows/publish-central.yml|deploy to Maven Central>."
35-
SLACK_FOOTER:
36-
MSG_MINIMAL: true
23+
MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
24+
MAVEN_GPG_KEY_FINGERPRINT: ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }}

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 25 additions & 36 deletions
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.2.0</version>
5+
<version>2.2.1</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>
@@ -18,22 +18,22 @@
1818
<maven.compiler.release>8</maven.compiler.release>
1919

2020
<!-- dependencies -->
21-
<gson.version>2.10.1</gson.version>
22-
<guava.version>33.1.0-jre</guava.version>
23-
<siv-mode.version>1.5.2</siv-mode.version>
24-
<bouncycastle.version>1.78.1</bouncycastle.version>
25-
<slf4j.version>2.0.13</slf4j.version>
21+
<gson.version>2.12.1</gson.version>
22+
<guava.version>33.4.0-jre</guava.version>
23+
<siv-mode.version>1.6.1</siv-mode.version>
24+
<bouncycastle.version>1.80</bouncycastle.version>
25+
<slf4j.version>2.0.17</slf4j.version>
2626

2727
<!-- test dependencies -->
28-
<junit.jupiter.version>5.10.2</junit.jupiter.version>
29-
<mockito.version>5.11.0</mockito.version>
30-
<hamcrest.version>2.2</hamcrest.version>
28+
<junit.jupiter.version>5.12.0</junit.jupiter.version>
29+
<mockito.version>5.15.2</mockito.version>
30+
<hamcrest.version>3.0</hamcrest.version>
3131
<jmh.version>1.37</jmh.version>
3232

3333
<!-- build plugin dependencies -->
34-
<dependency-check.version>9.1.0</dependency-check.version>
34+
<dependency-check.version>12.1.0</dependency-check.version>
3535
<jacoco.version>0.8.12</jacoco.version>
36-
<nexus-staging.version>1.6.13</nexus-staging.version>
36+
<central-publishing.version>0.7.0</central-publishing.version>
3737
</properties>
3838

3939
<licenses>
@@ -131,7 +131,7 @@
131131
<plugin>
132132
<groupId>org.apache.maven.plugins</groupId>
133133
<artifactId>maven-enforcer-plugin</artifactId>
134-
<version>3.4.1</version>
134+
<version>3.5.0</version>
135135
<executions>
136136
<execution>
137137
<id>enforce-java</id>
@@ -151,7 +151,7 @@
151151
</plugin>
152152
<plugin>
153153
<artifactId>maven-compiler-plugin</artifactId>
154-
<version>3.13.0</version>
154+
<version>3.14.0</version>
155155
<configuration>
156156
<encoding>UTF-8</encoding>
157157
<showWarnings>true</showWarnings>
@@ -189,7 +189,7 @@
189189
</plugin>
190190
<plugin>
191191
<artifactId>maven-shade-plugin</artifactId>
192-
<version>3.5.3</version>
192+
<version>3.6.0</version>
193193
<executions>
194194
<execution>
195195
<phase>package</phase>
@@ -227,7 +227,7 @@
227227
<plugin>
228228
<groupId>org.codehaus.mojo</groupId>
229229
<artifactId>exec-maven-plugin</artifactId>
230-
<version>3.2.0</version>
230+
<version>3.5.0</version>
231231
<executions>
232232
<execution>
233233
<phase>package</phase>
@@ -251,12 +251,12 @@
251251
<plugin>
252252
<groupId>org.apache.maven.plugins</groupId>
253253
<artifactId>maven-surefire-plugin</artifactId>
254-
<version>3.2.5</version>
254+
<version>3.5.2</version>
255255
</plugin>
256256
<plugin>
257257
<groupId>org.apache.maven.plugins</groupId>
258258
<artifactId>maven-jar-plugin</artifactId>
259-
<version>3.4.1</version>
259+
<version>3.4.2</version>
260260
<configuration>
261261
<archive>
262262
<manifestEntries>
@@ -280,7 +280,7 @@
280280
</plugin>
281281
<plugin>
282282
<artifactId>maven-javadoc-plugin</artifactId>
283-
<version>3.6.3</version>
283+
<version>3.11.2</version>
284284
<executions>
285285
<execution>
286286
<id>attach-javadocs</id>
@@ -385,7 +385,7 @@
385385
<plugins>
386386
<plugin>
387387
<artifactId>maven-gpg-plugin</artifactId>
388-
<version>3.2.4</version>
388+
<version>3.2.7</version>
389389
<executions>
390390
<execution>
391391
<id>sign-artifacts</id>
@@ -394,10 +394,7 @@
394394
<goal>sign</goal>
395395
</goals>
396396
<configuration>
397-
<gpgArguments>
398-
<arg>--pinentry-mode</arg>
399-
<arg>loopback</arg>
400-
</gpgArguments>
397+
<signer>bc</signer>
401398
</configuration>
402399
</execution>
403400
</executions>
@@ -408,24 +405,16 @@
408405

409406
<profile>
410407
<id>deploy-central</id>
411-
<distributionManagement>
412-
<repository>
413-
<id>ossrh</id>
414-
<name>Maven Central</name>
415-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
416-
</repository>
417-
</distributionManagement>
418408
<build>
419409
<plugins>
420410
<plugin>
421-
<groupId>org.sonatype.plugins</groupId>
422-
<artifactId>nexus-staging-maven-plugin</artifactId>
423-
<version>${nexus-staging.version}</version>
411+
<groupId>org.sonatype.central</groupId>
412+
<artifactId>central-publishing-maven-plugin</artifactId>
413+
<version>${central-publishing.version}</version>
424414
<extensions>true</extensions>
425415
<configuration>
426-
<serverId>ossrh</serverId>
427-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
428-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
416+
<publishingServerId>central</publishingServerId>
417+
<autoPublish>true</autoPublish>
429418
</configuration>
430419
</plugin>
431420
</plugins>

src/main/java/org/cryptomator/cryptolib/api/FileContentCryptor.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/*******************************************************************************
2-
* Copyright (c) 2016 Sebastian Stenzel and others.
3-
* All rights reserved. This program and the accompanying materials
4-
* are made available under the terms of the accompanying LICENSE.txt.
5-
*
6-
* Contributors:
7-
* Sebastian Stenzel - initial API and implementation
8-
*******************************************************************************/
91
package org.cryptomator.cryptolib.api;
102

113
import java.nio.ByteBuffer;
@@ -32,17 +24,17 @@ public interface FileContentCryptor {
3224
/**
3325
* Encrypts a single chunk of cleartext.
3426
*
35-
* @param cleartextChunk Content to be encrypted
27+
* @param cleartextChunk Content to be encrypted (starting at the buffer's current position, ending at the buffer's limit)
3628
* @param chunkNumber Number of the chunk to be encrypted
3729
* @param header Header of the file, this chunk belongs to
38-
* @return Encrypted content.
30+
* @return Encrypted content. Position is set to <code>0</code> and limit to the end of the chunk.
3931
*/
4032
ByteBuffer encryptChunk(ByteBuffer cleartextChunk, long chunkNumber, FileHeader header);
4133

4234
/**
4335
* Encrypts a single chunk of cleartext.
4436
*
45-
* @param cleartextChunk Content to be encrypted
37+
* @param cleartextChunk Content to be encrypted (starting at the buffer's current position, ending at the buffer's limit)
4638
* @param ciphertextChunk Encrypted content buffer (with at least {@link #ciphertextChunkSize()} remaining bytes)
4739
* @param chunkNumber Number of the chunk to be encrypted
4840
* @param header Header of the file, this chunk belongs to
@@ -52,7 +44,7 @@ public interface FileContentCryptor {
5244
/**
5345
* Decrypts a single chunk of ciphertext.
5446
*
55-
* @param ciphertextChunk Content to be decrypted
47+
* @param ciphertextChunk Content to be decrypted (starting at the buffer's current position, ending at the buffer's limit)
5648
* @param chunkNumber Number of the chunk to be decrypted
5749
* @param header Header of the file, this chunk belongs to
5850
* @param authenticate Skip authentication by setting this flag to <code>false</code>. Should always be <code>true</code> by default.
@@ -65,7 +57,7 @@ public interface FileContentCryptor {
6557
/**
6658
* Decrypts a single chunk of ciphertext.
6759
*
68-
* @param ciphertextChunk Content to be decrypted
60+
* @param ciphertextChunk Content to be decrypted (starting at the buffer's current position, ending at the buffer's limit)
6961
* @param cleartextChunk Buffer for decrypted chunk (with at least {@link #cleartextChunkSize()} remaining bytes)
7062
* @param chunkNumber Number of the chunk to be decrypted
7163
* @param header Header of the file, this chunk belongs to

src/main/java/org/cryptomator/cryptolib/common/EncryptingWritableByteChannel.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/*******************************************************************************
2-
* Copyright (c) 2016 Sebastian Stenzel and others.
3-
* All rights reserved. This program and the accompanying materials
4-
* are made available under the terms of the accompanying LICENSE.txt.
5-
*
6-
* Contributors:
7-
* Sebastian Stenzel - initial API and implementation
8-
*******************************************************************************/
91
package org.cryptomator.cryptolib.common;
102

113
import org.cryptomator.cryptolib.api.Cryptor;
@@ -66,10 +58,8 @@ private void writeHeaderOnFirstWrite() throws IOException {
6658

6759
private void encryptAndFlushBuffer() throws IOException {
6860
cleartextBuffer.flip();
69-
if (cleartextBuffer.hasRemaining()) {
70-
ByteBuffer ciphertextBuffer = cryptor.fileContentCryptor().encryptChunk(cleartextBuffer, chunkNumber++, header);
71-
delegate.write(ciphertextBuffer);
72-
}
61+
ByteBuffer ciphertextBuffer = cryptor.fileContentCryptor().encryptChunk(cleartextBuffer, chunkNumber++, header);
62+
delegate.write(ciphertextBuffer);
7363
cleartextBuffer.clear();
7464
}
7565

0 commit comments

Comments
 (0)