Skip to content

Commit 39f5d6e

Browse files
committed
SQLiteMC 3.34.0 - Small fixes
1 parent 0bb75ce commit 39f5d6e

File tree

5 files changed

+11
-33
lines changed

5 files changed

+11
-33
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/Willena/sqlite-jdbc-crypt.svg?branch=master)](https://travis-ci.org/Willena/sqlite-jdbc-crypt)
1+
[![Build Status](https://travis-ci.com/Willena/sqlite-jdbc-crypt.svg?branch=master)](https://travis-ci.com/Willena/sqlite-jdbc-crypt)
22
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.willena/sqlite-jdbc/badge.svg)](https://search.maven.org/artifact/io.github.willena/sqlite-jdbc/)
33

44
# SQLite JDBC Driver

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=3.33.0
1+
version=3.34.0

pom.xml

+1-1
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.33.0.1</version>
7+
<version>3.34.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/mc/SQLiteMCConfig.java

-2
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,9 @@ protected void applyCipherParametersByNames(Pragma[] pragmas, Connection conn, S
134134
else {
135135
if (pragma.equals(Pragma.CIPHER)) {
136136
String sql = String.format("SELECT sqlite3mc_config('default:%s', '%s');", pragma.getPragmaName(), cipherProperty);
137-
System.out.println(sql);
138137
conn.createStatement().execute(sql);
139138
} else {
140139
String sql = String.format("SELECT sqlite3mc_config('%s', 'default:%s', %s);", cipherProperty, pragma.getPragmaName(), property);
141-
System.out.println(sql);
142140
conn.createStatement().execute(sql);
143141
}
144142
}

src/test/java/org/sqlite/SQLiteMCURIInterfaceTest.java

+8-28
Original file line numberDiff line numberDiff line change
@@ -148,50 +148,30 @@ public void sqlCipherDatabaseHexKeyTest() throws SQLException, IOException {
148148

149149
}
150150

151-
152151
@Test
153-
public void sqlCipherDatabaseSpecialKeyTest() throws SQLException, IOException {
154-
152+
public void sqlCipherDatabaseSpecialKeyTest() throws SQLException, IOException{
155153
String dbfile = createFile();
156154
String Key1 = URLEncoder.encode("Key2&2ax", "utf8");
157-
String Key2 = "Key2";
155+
String Key2 = "Key2&2ax";
158156
cipherDatabaseCreate(dbfile, Key1);
159157

160-
//2. Ensure db is readable with good Password
158+
//2. Ensure db is readable with Key1 Password URL access
161159
Connection c = cipherDatabaseOpen(dbfile, Key1);
162160
assertTrue(
163161
String.format("1. Be sure the database with config %s can be read with the key '%s'", "SQLCipher", Key1)
164162
, databaseIsReadable(c));
165163
c.close();
166164

167-
//3. Ensure not readable with wrong key
168-
Connection c2 = cipherDatabaseOpen(dbfile, Key2);
169-
assertFalse(
170-
String.format("2. Be sure the database with config %s cannot be read with the key '%s'", "SQLCipher", Key2)
171-
, databaseIsReadable(c2));
172-
c.close();
173-
174-
}
175-
176-
177-
@Test
178-
public void sqlCipherDatabaseSpacialKeyTest() throws SQLException, IOException{
179-
String dbfile = createFile();
180-
String Key1 = URLEncoder.encode("Key2&2ax", "utf8");
181-
String Key2 = "Key2&2ax";
182-
cipherDatabaseCreate(dbfile, Key1);
183-
184-
//2. Ensure db is readable with Key1 Password URL access
185-
Connection c = cipherDatabaseOpen(dbfile, Key1);
165+
//3. Make sure we can read the database using the SQL interface
166+
c = new SQLiteMCSqlCipherConfig().setLegacy(1).setKdfIter(4000).withKey(Key2).createConnection("jdbc:sqlite:file:" + dbfile);
186167
assertTrue(
187-
String.format("1. Be sure the database with config %s can be read with the key '%s'", "SQLCipher", Key1)
168+
String.format("2. Be sure the database is readable using PRAGMA method and key containing special characters")
188169
, databaseIsReadable(c));
189170
c.close();
190171

191-
//3. Make sure we can read the database using the SQL interface
192-
c = new SQLiteMCSqlCipherConfig().setKdfIter(4000).setLegacy(1).withKey(Key2).useSQLInterface(true).createConnection("jdbc:sqlite:file:" + dbfile);
172+
c = new SQLiteMCSqlCipherConfig().setLegacy(1).setKdfIter(4000).withKey(Key2).useSQLInterface(true).createConnection("jdbc:sqlite:file:" + dbfile);
193173
assertTrue(
194-
String.format("2. Be sure the database is readable using two method and key containing special characters")
174+
String.format("3. Be sure the database is readable using SQL method and key containing special characters")
195175
, databaseIsReadable(c));
196176
c.close();
197177
}

0 commit comments

Comments
 (0)