Skip to content

Handler.options should only be cleared when the connection ends #219

@rendaw

Description

@rendaw

I think.

The first time I invoke gpg, the agent gets OPTIONs, the commands to sign/encrypt/get key/whatever, then RESET is passed time.

The 2nd time and after I invoke gpg, the gpg agent is sent RESET after the HAVEKEY's finish, and before PKSIGN, so the pinentry doesn't get any options.

It looks like in the GPG code all options are kept until the client connection is closed via session_env_* commands:
session_env_new is called here: https://github.com/gpg/gnupg/blob/f574aabeeb873f14a586f80cac16b857e6088534/agent/gpg-agent.c#L3079
Then a thread to handle the connection is started which eventually gets to this:
https://github.com/gpg/gnupg/blob/f574aabeeb873f14a586f80cac16b857e6088534/agent/gpg-agent.c#L2708 - start_command_handler runs until EOF handling assuan commands, then agent_deinit_default_ctrl calls session_env_release.

At least, I think that's the issue. Right now my pinentry is failing to appear unless I restart trezor-gpg-agent in any case.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions