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

prompt address: only derive PK once #108

Closed
emturner opened this issue Nov 1, 2023 · 1 comment · Fixed by #113
Closed

prompt address: only derive PK once #108

emturner opened this issue Nov 1, 2023 · 1 comment · Fixed by #113
Assignees
Labels
app::wallet issues relating to the wallet app

Comments

@emturner
Copy link
Collaborator

emturner commented Nov 1, 2023

Goal

When handling INS_PROMPT_PUBLIC_KEY, we should only derive the public key once.

Context

          One thing spotted: we derive pk twice in the prompt flow!

Originally posted by @emturner in #106 (comment)

@emturner emturner added the app::wallet issues relating to the wallet app label Nov 1, 2023
@ajinkyaraj-23
Copy link
Collaborator

PK is derived twice in promt flow because

  1. To show on the device screen the derivation of the PK, we need to derive pk and then create hash. The pk is stored in local variable and the hash is passed along as variable to be displayed on the screen. After which both the hash and pk are not present in memory.
  2. After receiving Accept, the pk is derived again and sent to I/O.

Effectively the solution is to store the PK in global memory when we derive it for the first time. Then if we get Accept we send the pk in global memory via I/O after which we clear the pk in global memory for security purposes. Similarly if the user presses reject, we immediately clear the pk in global memory.
Does that sound proper approach. Can we reuse some global memory buffer for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app::wallet issues relating to the wallet app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants