Changeset View
Changeset View
Standalone View
Standalone View
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
Show First 20 Lines • Show All 733 Lines • ▼ Show 20 Lines | for (const auto &[idx, migration] : migrations) { | ||||
} | } | ||||
} | } | ||||
sqlite3_close(db); | sqlite3_close(db); | ||||
} | } | ||||
void SQLiteQueryExecutor::assign_encryption_key() { | void SQLiteQueryExecutor::assign_encryption_key() { | ||||
CommSecureStore commSecureStore{}; | CommSecureStore commSecureStore{}; | ||||
#if DEBUG | |||||
std::string encryptionKey{"DEBUG"}; | |||||
#else | |||||
std::string encryptionKey = comm::crypto::Tools::generateRandomHexString( | std::string encryptionKey = comm::crypto::Tools::generateRandomHexString( | ||||
SQLiteQueryExecutor::sqlcipherEncryptionKeySize); | SQLiteQueryExecutor::sqlcipherEncryptionKeySize); | ||||
#endif | |||||
commSecureStore.set( | commSecureStore.set( | ||||
SQLiteQueryExecutor::secureStoreEncryptionKeyID, encryptionKey); | SQLiteQueryExecutor::secureStoreEncryptionKeyID, encryptionKey); | ||||
SQLiteQueryExecutor::encryptionKey = encryptionKey; | SQLiteQueryExecutor::encryptionKey = encryptionKey; | ||||
} | } | ||||
auto &SQLiteQueryExecutor::getStorage() { | auto &SQLiteQueryExecutor::getStorage() { | ||||
static auto storage = make_storage( | static auto storage = make_storage( | ||||
SQLiteQueryExecutor::sqliteFilePath, | SQLiteQueryExecutor::sqliteFilePath, | ||||
▲ Show 20 Lines • Show All 358 Lines • Show Last 20 Lines |