Skip to content
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

Improve handling of incorrect password via software signer #2451

Merged
merged 4 commits into from Dec 8, 2020

Conversation

KPrasch
Copy link
Member

@KPrasch KPrasch commented Nov 24, 2020

Gives CLI users an AccessDenied exception instead of MACMismatch on incorrect password

@KPrasch KPrasch changed the title [WIP] Handle Incorrect password conditions [WIP] Handle incorrect password conditions Nov 24, 2020
@KPrasch KPrasch changed the title [WIP] Handle incorrect password conditions Improve handling of incorrect password via software signer Dec 5, 2020
@KPrasch KPrasch added CLI This effects the nucypher CLI ux design User experience enhancements labels Dec 5, 2020
KPrasch added a commit to KPrasch/nucypher that referenced this pull request Dec 5, 2020
@KPrasch KPrasch marked this pull request as ready for review December 5, 2020 16:02
@@ -355,18 +355,21 @@ def unlock_account(self, account: str, password: str, duration: int = None) -> b
Decrypt the signing material from the key metadata file and cache it on
the keystore instance is decryption is successful.
"""
if not password:
# It is possible that password is None here passed form the above layer,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# It is possible that password is None here passed form the above layer,
# It is possible that password is None here passed from the above layer,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

signing_key = Account.from_key(Account.decrypt(key_metadata, password))
self.__signers[account] = signing_key
except ValueError as e:
raise self.AccessDenied("Invalid or incorrect signer password") from e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be tested as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI This effects the nucypher CLI ux design User experience enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants