Skip to content

Issue 372 keep pass phrase in memory - #1249

Merged
DenBond7 merged 38 commits into
masterfrom
issue_372_keep_pass_phrase_in_memory
May 27, 2021
Merged

Issue 372 keep pass phrase in memory#1249
DenBond7 merged 38 commits into
masterfrom
issue_372_keep_pass_phrase_in_memory

Conversation

@DenBond7

@DenBond7DenBond7 commented May 25, 2021

Copy link
Copy Markdown
Collaborator

This PR adds a base realization of "keep pass phrase in memory" support
close#372 //

Tests(delete all except exactly one):

  • Tests will be added later. As it is a base realization issues for tests will be added later

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities

DenBond7 added 30 commits May 6, 2021 21:37
# Conflicts:
#	FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/CheckPrivateKeysViewModel.kt
#	FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/PrivateKeysViewModel.kt
#	FlowCrypt/src/main/java/com/flowcrypt/email/security/KeysStorageImpl.kt
#	FlowCrypt/src/main/java/com/flowcrypt/email/security/SecurityUtils.kt
#	FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpKey.kt
#	FlowCrypt/src/main/java/com/flowcrypt/email/service/actionqueue/actions/BackupPrivateKeyToInboxAction.kt
#	FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt
… a pass phrase for passphraseType == KeyEntity.PassphraseType.RAM.| #372
@tomholub

Copy link
Copy Markdown
Collaborator

Instead of Pass phrase was erased please say Pass phrase purged from memory

@tomholub

Copy link
Copy Markdown
Collaborator

The node key caching is causing confusion indeed - just purged pass phrase from memory, but can still decrypt. Since it will take some time before we can completely drop node (while Ivan works on re-implementing parsing messages), we should consider keeping this feature enabled only on debug builds for now.

@DenBond7

Copy link
Copy Markdown
CollaboratorAuthor

The node key caching is causing confusion indeed - just purged pass phrase from memory, but can still decrypt. Since it will take some time before we can completely drop node (while Ivan works on re-implementing parsing messages), we should consider keeping this feature enabled only on debug builds for now.

Yup. I totally agree. It confuses me too.

@tomholub

Copy link
Copy Markdown
Collaborator

Is it possible to restart the node process? That would clear the cache. Otherwise I'd need to add a call for purging cache. Maybe actually there already is one.

@tomholub

Copy link
Copy Markdown
Collaborator

Unfortunately, I didn't expose this through an endpoint earlier.

@tomholub

Copy link
Copy Markdown
Collaborator

Otherwise it works as expected 👍

@tomholub

Copy link
Copy Markdown
Collaborator

(except the missing UI functionality to re-enter pass phrase in various places)

@DenBond7

Copy link
Copy Markdown
CollaboratorAuthor

Is it possible to restart the node process? That would clear the cache. Otherwise I'd need to add a call for purging cache. Maybe actually there already is one.

I'm not sure that restart it's a good idea. That process is not fast. On slow devices it can take up to 5-7 seconds

@tomholub

Copy link
Copy Markdown
Collaborator

That may be ok if it only happens when I click "forget pass phrase" - a rare thing to do

@tomholub

Copy link
Copy Markdown
Collaborator

It would allow us to start testing this new functionality with users already now before node is dropped

@DenBond7

Copy link
Copy Markdown
CollaboratorAuthor

(except the missing UI functionality to re-enter pass phrase in various places)

Yup. I've created a few issues where we can discuss that. Too many changes need to make for that.

@DenBond7

Copy link
Copy Markdown
CollaboratorAuthor

It would allow us to start testing this new functionality with users already now before node is dropped

Got it. Please let me think about that. I'll create a separate issue.

@DenBond7
DenBond7 marked this pull request as ready for review May 27, 2021 07:34
@DenBond7
DenBond7 requested a review from tomholubMay 27, 2021 07:34
@DenBond7

Copy link
Copy Markdown
CollaboratorAuthor

it's ready for a review

@DenBond7
DenBond7 merged commit 4980e51 into masterMay 27, 2021
@DenBond7
DenBond7 deleted the issue_372_keep_pass_phrase_in_memory branch May 27, 2021 08:08
@tomholubtomholub mentioned this pull request May 27, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

option to only keep pass phrase in memory

2 participants

@DenBond7@tomholub