Import dialog shows up even with entered incorrect privkey #142

Closed
opened 4 months ago by onryo · 4 comments
onryo commented 4 months ago
Collaborator
![image](/attachments/fcd11f70-ef50-4fa6-9347-0241f0c3859a) https://git.hush.is/hush/SilentDragon/src/branch/dev/src/mainwindow.cpp#L1289
onryo added the
bug
label 4 months ago
Owner

Also "it may take several minutes" is a severe underestimate , we should probably change that text.

Also "it may take several minutes" is a severe underestimate , we should probably change that text.
onryo added the
beginners
label 4 months ago
onryo self-assigned this 4 months ago
Owner

@onryo what incorrect privkey did you use to find this bug? It would be good to have a test case.

This bug seems to be caused because doImport returns void, so the code that calls it doesn't know when it fails. Also, the private keys are not validated to look reasonable before calling doImport . We have a function isValidSaplingPrivateKey() we can use but we need a similar function for taddr privkeys.

@onryo what incorrect privkey did you use to find this bug? It would be good to have a test case. This bug seems to be caused because `doImport` returns void, so the code that calls it doesn't know when it fails. Also, the private keys are not validated to look reasonable before calling `doImport` . We have a function `isValidSaplingPrivateKey()` we can use but we need a similar function for taddr privkeys.
Owner

I just pushed a commit to the branch that implements a isValidTransparentPrivateKey function (not perfect but better than nothing), which is not used anywhere yet. We should be able to use it, along with isValidSaplingPrivateKey to filter out invalid privkeys from being imported and avoid this bug.

I just pushed a commit to the branch that implements a `isValidTransparentPrivateKey` function (not perfect but better than nothing), which is not used anywhere yet. We should be able to use it, along with `isValidSaplingPrivateKey` to filter out invalid privkeys from being imported and avoid this bug.
Owner

Since the import branch was merged to dev we now validate private keys for taddrs/zaddr much more strictly, so I am considering this bug fixed

Since the `import` branch was merged to `dev` we now validate private keys for taddrs/zaddr much more strictly, so I am considering this bug fixed
duke closed this issue 4 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.