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
Conversation
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Gives CLI users an
AccessDenied
exception instead ofMACMismatch
on incorrect password