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

Cannot post transaction after updating wallet's passphrase #326

Closed
2 tasks done
piotr-iohk opened this issue May 27, 2019 · 1 comment
Closed
2 tasks done

Cannot post transaction after updating wallet's passphrase #326

piotr-iohk opened this issue May 27, 2019 · 1 comment
Assignees

Comments

@piotr-iohk
Copy link
Contributor

piotr-iohk commented May 27, 2019

Release Operating System Cause
next Linux Code

Context

Steps to Reproduce

  1. Create wallet (with some funds)
  2. update wallet's password
  3. Try to post transaction using newly updated password

Expected behavior

Transaction should be posted.

Actual behavior

HTTP 500

{
  "code": "rejected_by_core_node",
  "message": "I successfully submitted a transaction, but unfortunately it was rejected by a relay. This could be because the fee was not large enough, or because the transaction conflicts with another transaction that uses one or more of the same inputs, or it may be due to some other reason. Here's an error message that may help with debugging: Failed to send to peers: Blockchain protocol error"
}

Resolution Plan

After investigation, it is clear that the encrypted key isn't actually re-encrypted when changing the passphrase. Only the new passphrase hash is stored and the new key is left untouched :(

  • Write a functional test that shows that 'signTx' should produce identical witnesses for the identical transactions and private keys, regardless of the encryption passphrase used. This should fail with the current state of the code.

  • Fix the updateWalletPassphrase handler and make sure to re-encrypt the root private key with the new provided passphrase!

PR

Number Base
#330 master

QA

  • Added a test to capture the failure described above (trying to sign an identical transaction before and after updating the encryption passphrase, checking it returns same witnesses both times). See Cardano.WalletSpec.

  • Fixed the issue by actually re-encrypting the private key with a new passphrase when it is changed, see: Cardano.Wallet

@piotr-iohk
Copy link
Contributor Author

👍
Also there is integration tests covering this case in #335.

@KtorZ KtorZ added this to the Bugs Sprint 21-22 milestone May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants