[Gpg4win-devel] How to read help output?

Ingo Klöcker kloecker at kde.org
Sat Sep 24 15:17:12 CEST 2022


On Freitag, 23. September 2022 14:03:01 CEST Jan Mosig (itemis AG) wrote:
> Hi there,
> 
> I have a Java based program here that is able to send commands to
> scdaemon. Things are working ok but when I send "help", there is no
> error (so the server understood the command) but also no output whatsoever.
> 
>  From the sources I figured that the help command uses assuan_write_line
> to write things.
> 
> Question is: How to read these lines? I tried using assuan_read_line but
> to no avail.
> 
> Any hints would be appreciated.

I think you want to use assuan_transact with appropriate call backs for 
reading the responses instead of assuan_write_line. Have a look at libassuan's 
pipeconnect test and at the documentation of assuan_transact.

scdaemon replies either on the status channel or on the data channel. 
assuan_read_line reads from the control channel which probably only makes 
sense for Assuan servers, but not for Assuan clients.

Use gpg-connect-agent to try out what scdaemon replies. I'm not sure whether 
you can talk directly to scdaemon using this tool, but you can always talk to 
scdaemon via gpg-agent (which is the default agent the tool connects to). 
Simply prepend each command you send to gpg-agent with "SCD " to make it 
forward the request to scdaemon.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.wald.intevation.org/pipermail/gpg4win-devel/attachments/20220924/554f57f7/attachment.sig>


More information about the Gpg4win-devel mailing list