Skip to content

Fix security issues where sensitive data is logged #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions src/net/sqlcipher/database/SQLiteDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1433,10 +1433,8 @@ public Cursor rawQueryWithFactory(

if (Config.LOGV || duration >= mSlowQueryThreshold) {
Log.v(TAG,
"query (" + duration + " ms): " + driver.toString() + ", args are "
+ (selectionArgs != null
? TextUtils.join(",", selectionArgs)
: "<null>") + ", count is " + count);
"query (" + duration + " ms): " + driver.toString() +
", args are <redacted>, count is " + count);
}
}
}
Expand Down Expand Up @@ -1486,7 +1484,7 @@ public long insert(String table, String nullColumnHack, ContentValues values) {
try {
return insertWithOnConflict(table, nullColumnHack, values, CONFLICT_NONE);
} catch (SQLException e) {
Log.e(TAG, "Error inserting " + values, e);
Log.e(TAG, "Error inserting <redacted values> into " + table, e);
return -1;
}
}
Expand Down Expand Up @@ -1525,7 +1523,7 @@ public long replace(String table, String nullColumnHack, ContentValues initialVa
return insertWithOnConflict(table, nullColumnHack, initialValues,
CONFLICT_REPLACE);
} catch (SQLException e) {
Log.e(TAG, "Error inserting " + initialValues, e);
Log.e(TAG, "Error inserting <redacted values> into " + table, e);
return -1;
}
}
Expand Down Expand Up @@ -1628,11 +1626,11 @@ public long insertWithOnConflict(String table, String nullColumnHack,

long insertedRowId = lastInsertRow();
if (insertedRowId == -1) {
Log.e(TAG, "Error inserting " + initialValues + " using " + sql);
Log.e(TAG, "Error inserting <redacted values> using <redacted sql> into " + table);
} else {
if (Config.LOGD && Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Inserting row " + insertedRowId + " from "
+ initialValues + " using " + sql);
Log.v(TAG, "Inserting row " + insertedRowId +
" from <redacted values> using <redacted sql> into " + table);
}
}
return insertedRowId;
Expand Down Expand Up @@ -1770,14 +1768,15 @@ public int updateWithOnConflict(String table, ContentValues values,
statement.execute();
int numChangedRows = lastChangeCount();
if (Config.LOGD && Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Updated " + numChangedRows + " using " + values + " and " + sql);
Log.v(TAG, "Updated " + numChangedRows +
" rows using <redacted values> and <redacted sql> for " + table);
}
return numChangedRows;
} catch (SQLiteDatabaseCorruptException e) {
onCorruption();
throw e;
} catch (SQLException e) {
Log.e(TAG, "Error updating " + values + " using " + sql);
Log.e(TAG, "Error updating <redacted values> using <redacted sql> for " + table);
throw e;
} finally {
if (statement != null) {
Expand Down