Skip to content

Commit

Permalink
Issue 372 keep pass phrase in memory (#1249)
Browse files Browse the repository at this point in the history
* Added PassPhrasesInRAMService. Refactored code.| #372

* Dropped using 'longId'. Migrated to use only 'fingerprint'. Updated the database version to 25. Refactored code.| #372

* Fixed bugs in tests.| #372

* Modified KeysStorage. Moved to use Passphrase instead of String where it is possible. Refactored code.| #372

* Moved NodeKeyDetails to 'security.model'.| #372

* Renamed KeyDetails.Type to KeyDetails.SourceType.| #372

* Renamed KeyDetails to KeyImportDetails.| #372

* Renamed NodeKeyDetails to PgpKeyDetails.| #372

* Refactored code.| #372

* Fixed refactoring errors.| #372

* Refactored code.| #372

* Refactored code.| #372

* Fixed PrivateKeysManager.| #372

* Refactored code.| #372

* Replaced KeyEntity with PgpKeyDetails where it is possible.| #372

* Modified the database schema to store different passphrase types.| #372

* Modified KeysDao to prevent saving passphrase if passphraseType == KeyEntity.PassphraseType.RAM.| #372

* Modified UI in CheckKeysActivity. Added some logic to CheckPrivateKeysViewModel. Refactored code.| #372

* Fixed conflicts after merge.| #372

* Modified PrivateKeysViewModel to be able to store passphrase in RAM. Refactored code in KeysStorageImpl.| #372

* Added auto manage of PassPhrasesInRAMService.| #372

* Improved KeysStorageImpl.updatePassPhrasesCache().| #372

* Modified PrivateKeyDetailsFragment to be able to update(set or erase) a pass phrase for passphraseType == KeyEntity.PassphraseType.RAM.| #372

* Updated a notification in PassPhrasesInRAMService.| #372

* Fixed a bug in CheckKeysActivity. Refactored code.| #372

* Fixed the database migration.| #372

* Fixed a bug in KeysStorageImpl.getPGPSecretKeyRingByFingerprint().| #372

* Added some logic to KeysStorageImpl.| #372

* Fixed a bug in AttachmentDownloadManagerService.| #372

* Fixed some tests.| #372

* Fixed lint warnings.| #372

* Marked some code as deprecated.| #372

* Renamed some strings.| #372

* Disabled "Keep pass phrase in memory" for release builds.| #372

* Made notifications for PassPhrasesInRAMService silent.| #372

* Removed unused code.| #372

* Fixed method names.| #372
  • Loading branch information
DenBond7 authored May 27, 2021
1 parent eedb9ee commit 4980e51
Show file tree
Hide file tree
Showing 114 changed files with 3,563 additions and 1,846 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 24,
"identityHash": "27b09b859233fc03abaab220d650bf92",
"identityHash": "66f9c3b99371f2874df7dd3184f8b604",
"entities": [
{
"tableName": "accounts_aliases",
Expand Down Expand Up @@ -608,7 +608,7 @@
},
{
"tableName": "keys",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `long_id` TEXT NOT NULL, `account` TEXT NOT NULL, `account_type` TEXT DEFAULT NULL, `source` TEXT NOT NULL, `public_key` BLOB NOT NULL, `private_key` BLOB NOT NULL, `passphrase` TEXT DEFAULT NULL, FOREIGN KEY(`account`, `account_type`) REFERENCES `accounts`(`email`, `account_type`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `fingerprint` TEXT NOT NULL, `account` TEXT NOT NULL, `account_type` TEXT DEFAULT NULL, `source` TEXT NOT NULL, `public_key` BLOB NOT NULL, `private_key` BLOB NOT NULL, `passphrase` TEXT DEFAULT NULL, FOREIGN KEY(`account`, `account_type`) REFERENCES `accounts`(`email`, `account_type`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "id",
Expand All @@ -617,8 +617,8 @@
"notNull": false
},
{
"fieldPath": "longId",
"columnName": "long_id",
"fieldPath": "fingerprint",
"columnName": "fingerprint",
"affinity": "TEXT",
"notNull": true
},
Expand Down Expand Up @@ -669,14 +669,14 @@
},
"indices": [
{
"name": "long_id_account_account_type_in_keys",
"name": "fingerprint_account_account_type_in_keys",
"unique": true,
"columnNames": [
"long_id",
"fingerprint",
"account",
"account_type"
],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `long_id_account_account_type_in_keys` ON `${TABLE_NAME}` (`long_id`, `account`, `account_type`)"
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `fingerprint_account_account_type_in_keys` ON `${TABLE_NAME}` (`fingerprint`, `account`, `account_type`)"
}
],
"foreignKeys": [
Expand Down Expand Up @@ -987,7 +987,7 @@
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '27b09b859233fc03abaab220d650bf92')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '66f9c3b99371f2874df7dd3184f8b604')"
]
}
}
Loading

0 comments on commit 4980e51

Please sign in to comment.