-
-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Labels
Description
The function ReKey() does not make use of the provided cipher whether it was provided or not, this causes the Open() function to fail to open a database if the cipher was used for a database that was encrypted using ReKey().
Here is the code snippet from wxsqlite.cpp:
void wxSQLite3Database::ReKey(const wxSQLite3Cipher& cipher, const wxMemoryBuffer& newKey)
{
#if WXSQLITE3_HAVE_CODEC
CheckDatabase();
int rc = sqlite3_rekey(m_db->m_db, newKey.GetData(), (int) newKey.GetDataLen());
if (rc != SQLITE_OK)
{
const char* localError = sqlite3_errmsg(m_db->m_db);
throw wxSQLite3Exception(rc, wxString::FromUTF8(localError));
}
#else
wxUnusedVar(newKey);
throw wxSQLite3Exception(WXSQLITE_ERROR, wxERRMSG_NOCODEC);
#endif
}
The cipher parameter was not mentioned in the whole function.
Reactions are currently unavailable