-
Notifications
You must be signed in to change notification settings - Fork 24
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
Passphrase spaces #86
Conversation
Fixes #74 |
@@ -116,7 +162,7 @@ public void backwards_compatibility_test_login() { | |||
CipherWrapper cipherWrapper = new CipherWrapper("RSA/ECB/PKCS1Padding"); | |||
|
|||
assert masterKey != null; | |||
String encryptedPhrase = cipherWrapper.encrypt(mnemonic + " " + passPhrase, masterKey.getPublic(), false); | |||
String encryptedPhrase = cipherWrapper.encrypt(mnemonic12 + " " + passPhrase, masterKey.getPublic(), false); |
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.
this is not he old way of encrypting mnemoni + passphrase?
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.
should u write a new test for the passphrase encryption only?
cipherWrapper.encrypt(passPhrase)
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.
yeah, this entire problem only exists in the old wallet lol, cause we are using a space separating the mnemonic and passphrase :P
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.
what line is that cipherWrapper.encrypt(passPhrase)
?
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.
never-mind, I got confused
@@ -103,7 +103,7 @@ class ShowMnemonicActivity : BaseActivity(), View.OnClickListener { | |||
} | |||
|
|||
mnemonicString = String(mnemonic) | |||
return String(mnemonic).split(" ".toRegex()).dropLastWhile { it.isEmpty() } as ArrayList | |||
return mnemonicString!!.split(" ".toRegex()).dropLastWhile { it.isEmpty() } as ArrayList |
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.
why did you put !!? it looks like mnemonicString
can not be null since is assigned to a new String object
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.
Kotlin's compiler apparently is not perfect and they don't allow it :(
Is the passphrase with spaces still not fixed for old wallets? |
This PR fixes passphrase only for old wallets, because in new wallets the mnemonic and passphrase are saved in two different strings. But since in old wallets they are space separated, we may have issues. So this addresses it |
Let's add in this version support for |
Priority
High
Description