Skip to content

Commit 2e32765

Browse files
committed
switch to byte[] for primary passphrase representation
1 parent 907200f commit 2e32765

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

android-database-sqlcipher/src/main/java/net/sqlcipher/database/SupportFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
import androidx.sqlite.db.SupportSQLiteOpenHelper;
2020

2121
public class SupportFactory implements SupportSQLiteOpenHelper.Factory {
22-
private final char[] passphrase;
22+
private final byte[] passphrase;
2323
private final String postKeySql;
2424

25-
public SupportFactory(char[] passphrase) {
25+
public SupportFactory(byte[] passphrase) {
2626
this(passphrase, null);
2727
}
2828

29-
public SupportFactory(char[] passphrase, String postKeySql) {
29+
public SupportFactory(byte[] passphrase, String postKeySql) {
3030
this.passphrase = passphrase;
3131
this.postKeySql = postKeySql;
3232
}

android-database-sqlcipher/src/main/java/net/sqlcipher/database/SupportHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
public class SupportHelper implements SupportSQLiteOpenHelper {
2323
private SQLiteOpenHelper standardHelper;
24-
private char[] passphrase;
24+
private byte[] passphrase;
2525

2626
SupportHelper(final SupportSQLiteOpenHelper.Configuration configuration,
27-
char[] passphrase, final String postKeySql) {
27+
byte[] passphrase, final String postKeySql) {
2828
SQLiteDatabase.loadLibs(configuration.context);
2929
this.passphrase = passphrase;
3030

@@ -91,7 +91,7 @@ public SupportSQLiteDatabase getWritableDatabase() {
9191
SQLiteDatabase result = standardHelper.getWritableDatabase(passphrase);
9292

9393
for (int i = 0; i < passphrase.length; i++) {
94-
passphrase[i] = (char)0;
94+
passphrase[i] = (byte)0;
9595
}
9696

9797
return result;

0 commit comments

Comments
 (0)