Skip to content

Commit 9d0ed76

Browse files
committed
Version 3.48.0.0
1 parent c8bd8b9 commit 9d0ed76

21 files changed

+198
-185
lines changed

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version=3.48.0
2-
artifactVersion=3.48.0.0-SNAPSHOT
3-
sqliteMCVersion=2.0.2
2+
artifactVersion=3.48.0.0
3+
sqliteMCVersion=2.0.2

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>io.github.willena</groupId>
66
<artifactId>sqlite-jdbc</artifactId>
7-
<version>3.48.0.0-SNAPSHOT</version>
7+
<version>3.48.0.0</version>
88
<name>SQLite JDBC</name>
99
<description>SQLite JDBC library with encryption and authentication support</description>
1010
<url>https://github.com/Willena/sqlite-jdbc-crypt</url>

src/main/java/org/sqlite/SQLiteConfig.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -633,18 +633,22 @@ public enum Pragma {
633633
"plaintext_header_size",
634634
"Allows to configure the cipher scheme to keep the database header partially unencrypted",
635635
null),
636-
TCOST("tcost",
637-
"Allows to specify the number of iterations used to derive the key material with the Argon2id function.",
638-
null),
639-
MCOST("mcost",
640-
"Allows to specify the amount of memory used to derive the key material with the Argon2id function. The amount is specified as the number of kB memory blocks.",
641-
null),
642-
PCOST("pcost",
643-
"Allows to modify the parallelism aka the number of threads used to derive the key material with the Argon2id function. The value corresponds to the hash algoritm for HMAC calculation" ,
644-
null),
645-
ALGORITHM("algorithm",
646-
"Allows to modify the AEGIS algorithm variant used for encryption",
647-
null);
636+
TCOST(
637+
"tcost",
638+
"Allows to specify the number of iterations used to derive the key material with the Argon2id function.",
639+
null),
640+
MCOST(
641+
"mcost",
642+
"Allows to specify the amount of memory used to derive the key material with the Argon2id function. The amount is specified as the number of kB memory blocks.",
643+
null),
644+
PCOST(
645+
"pcost",
646+
"Allows to modify the parallelism aka the number of threads used to derive the key material with the Argon2id function. The value corresponds to the hash algoritm for HMAC calculation",
647+
null),
648+
ALGORITHM(
649+
"algorithm",
650+
"Allows to modify the AEGIS algorithm variant used for encryption",
651+
null);
648652

649653
public final String pragmaName;
650654
public final String[] choices;

src/main/java/org/sqlite/mc/SQLiteMCAegisConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public SQLiteMCAegisConfig setAegisAlgorithm(AegisAlgorithm algorithm) {
2828
}
2929

3030
public static SQLiteMCAegisConfig getDefault() {
31-
return new SQLiteMCAegisConfig()
31+
return new SQLiteMCAegisConfig()
3232
.setAegisAlgorithm(AegisAlgorithm.AEGIS_256)
3333
.setTCost(2)
3434
.setMCost(19456)

src/main/java/org/sqlite/mc/SQLiteMCConfig.java

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.util.Map;
1010
import java.util.Properties;
1111
import java.util.function.Function;
12-
1312
import org.sqlite.SQLiteConfig;
1413
import org.sqlite.SQLiteConfigFactory;
1514

@@ -26,24 +25,24 @@ public class SQLiteMCConfig extends SQLiteConfig {
2625
}
2726

2827
private static final Pragma[] CIPHER_PRAGMA_ORDER =
29-
new Pragma[]{
30-
Pragma.CIPHER,
31-
Pragma.LEGACY,
32-
Pragma.HMAC_CHECK,
33-
Pragma.MC_LEGACY_WAL,
34-
Pragma.LEGACY_PAGE_SIZE,
35-
Pragma.KDF_ITER,
36-
Pragma.FAST_KDF_ITER,
37-
Pragma.HMAC_USE,
38-
Pragma.HMAC_PGNO,
39-
Pragma.HMAC_SALT_MASK,
40-
Pragma.KDF_ALGORITHM,
41-
Pragma.HMAC_ALGORITHM,
42-
Pragma.PLAINTEXT_HEADER_SIZE,
43-
Pragma.TCOST,
44-
Pragma.MCOST,
45-
Pragma.PCOST,
46-
Pragma.ALGORITHM
28+
new Pragma[] {
29+
Pragma.CIPHER,
30+
Pragma.LEGACY,
31+
Pragma.HMAC_CHECK,
32+
Pragma.MC_LEGACY_WAL,
33+
Pragma.LEGACY_PAGE_SIZE,
34+
Pragma.KDF_ITER,
35+
Pragma.FAST_KDF_ITER,
36+
Pragma.HMAC_USE,
37+
Pragma.HMAC_PGNO,
38+
Pragma.HMAC_SALT_MASK,
39+
Pragma.KDF_ALGORITHM,
40+
Pragma.HMAC_ALGORITHM,
41+
Pragma.PLAINTEXT_HEADER_SIZE,
42+
Pragma.TCOST,
43+
Pragma.MCOST,
44+
Pragma.PCOST,
45+
Pragma.ALGORITHM
4746
};
4847

4948
private SQLiteMCConfig(Properties existingProperties) {
@@ -89,9 +88,12 @@ protected void setupConnection(
8988
String property = pragmaTable.getProperty(pragma.getPragmaName(), null);
9089

9190
if (property != null) {
92-
Function<String, String> converter = CONVERTERS.getOrDefault(pragma, IDENTITY_CONVERTER);
91+
Function<String, String> converter =
92+
CONVERTERS.getOrDefault(pragma, IDENTITY_CONVERTER);
9393
statement.execute(
94-
String.format("PRAGMA %s = %s", pragma.getPragmaName(), converter.apply(property)));
94+
String.format(
95+
"PRAGMA %s = %s",
96+
pragma.getPragmaName(), converter.apply(property)));
9597
}
9698
}
9799
}

src/main/java/org/sqlite/mc/SQLiteMCSqlCipherConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public SQLiteMCSqlCipherConfig setHmacAlgorithm(HmacAlgorithm value) {
7676
@Override
7777
public SQLiteMCSqlCipherConfig setPlaintextHeaderSize(int value) {
7878
if (!isValid(value, 0, 100) || value % 16 != 0) {
79-
throw new IllegalArgumentException("PlainTextHeaderSize must be a multiple of 16 and between 0 and 100");
79+
throw new IllegalArgumentException(
80+
"PlainTextHeaderSize must be a multiple of 16 and between 0 and 100");
8081
}
8182
super.setPlaintextHeaderSize(value);
8283
return this;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package org.sqlite.mc;
22

3-
import org.junit.jupiter.api.Test;
4-
53
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
64
import static org.junit.jupiter.api.Assertions.*;
75

6+
import org.junit.jupiter.api.Test;
7+
88
class AegisAlgorithmTest {
99

1010
@Test
1111
void getValue() {
1212
assertThat(AegisAlgorithm.AEGIS_256X4.getStringValue()).isEqualTo("aegis-256x4");
1313
assertThat(AegisAlgorithm.AEGIS_256X4.getInValue()).isEqualTo(6);
1414
}
15-
}
15+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.sqlite.mc;
22

3-
import org.junit.jupiter.api.Test;
4-
53
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
64
import static org.junit.jupiter.api.Assertions.*;
75

6+
import org.junit.jupiter.api.Test;
7+
88
class CipherAlgorithmTest {
99

1010
@Test
1111
void getValue() {
1212
assertThat(CipherAlgorithm.AEGIS.getValue()).isEqualTo("aegis");
1313
}
14-
}
14+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.sqlite.mc;
22

3-
import org.junit.jupiter.api.Test;
4-
53
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
64
import static org.junit.jupiter.api.Assertions.*;
75

6+
import org.junit.jupiter.api.Test;
7+
88
class HmacAlgorithmTest {
99

1010
@Test
1111
void getValue() {
1212
assertThat(HmacAlgorithm.SHA256.getValue()).isEqualTo(1);
1313
}
14-
}
14+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.sqlite.mc;
22

3-
import org.junit.jupiter.api.Test;
4-
53
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
64
import static org.junit.jupiter.api.Assertions.*;
75

6+
import org.junit.jupiter.api.Test;
7+
88
class HmacPgnoTest {
99

1010
@Test
1111
void getValue() {
1212
assertThat(HmacPgno.LITTLE_ENDIAN.getValue()).isEqualTo(1);
1313
}
14-
}
14+
}

0 commit comments

Comments
 (0)