Post AlNf6pxZLMEACAjOUa by lhp@mastodon.social
 (DIR) More posts by lhp@mastodon.social
 (DIR) Post #AlNf6p0is99jFfCOlk by dnkl@emacs.ch
       2024-08-26T12:17:23Z
       
       0 likes, 0 repeats
       
       I decided to add a pinentry backend to #fuzzel.Turns out it's not that difficult. The protocol is line based (on STDIN). That means we can re-use a lot of code from the dmenu mode. Then all we need to do is force a couple of options, like --prompt-only, and we're good to go. We ignore most of the pinentry options and commands, since they're not applicable in fuzzel.Biggest downside I've found so far: since fuzzel is a layer shell application, you can't switch window focus while fuzzel is running.
       
 (DIR) Post #AlNf6pxZLMEACAjOUa by lhp@mastodon.social
       2024-08-26T12:20:19Z
       
       0 likes, 0 repeats
       
       @dnkl however the protocol isn't really documented. There is an assuan doc for the wire protocol and there is one for the pinentry protocol, but they disagree with each other and with reality. Also sometimes they use "character" when it really should be "byte". Not that anything actually checks line lenghts. Pinentry protocol requires lines lengths which are technically illegal with assuan, but no one seems to care there either...
       
 (DIR) Post #AlNf6qjQTQVaab7c5Q by dnkl@emacs.ch
       2024-08-26T12:26:04Z
       
       0 likes, 0 repeats
       
       @lhp hey, that just makes it easier to implement; no annoying rules to follow. Right!?
       
 (DIR) Post #AlNf6rBQnIuTzSDyjo by lhp@mastodon.social
       2024-08-26T18:44:18Z
       
       0 likes, 0 repeats
       
       @dnkl when I implemented the pinentry protocol, first I copied the messages sent by the "official" pinentry implementations bit-for-bit. It did not work. Then I tried following the protocol spec, which did end up working, kinda. However this means the official ones are doing it wrong, but somehow still work in a way I could not reproduce nor did I ever figure out why they are allowed to do it wrong while my program gets killed by gpg-agent.
       
 (DIR) Post #AlNf6rj6m5qfftysEK by dnkl@emacs.ch
       2024-08-27T04:05:20Z
       
       0 likes, 0 repeats
       
       @lhp I'm almost more bothered by the fact that gpg-agent just assumes it can use command line arguments (like --display). I mean, why not extend the protocol if necessary? Why add an additional interface clients are just assumed to implement?
       
 (DIR) Post #AlNf6sNWLqAthEt9Dk by lhp@mastodon.social
       2024-08-27T04:08:41Z
       
       0 likes, 0 repeats
       
       @dnkl the protocol actually has a way to set $DISPLAY without needing a command arg. In fact, there are two different ways to set various variables.Also there is a handy error code to indicate your implementation doesn't support some feature. But don't think about using it, because gpg-agent will just abort. Instead always say OK and silently drop it.gpg is the best argument against hand-rolling IPC.