GPG Assuan protocol usage

Alan Meekins alan.meekins at gmail.com
Wed Jan 8 00:30:23 CET 2014


Hi gpg-ers,

I'm interested in utilizing GnuPG in software that I'm writing and it seems
that communicating with the gpg-agent over a unix socket using the Assuan
protocol is best suited for my use case but am open to other options if
there are better approaches.

My problem lies in getting the assuan protocol in practice to match up with
the documentation
here<http://www.gnupg.org/documentation/manuals/gnupg-devel/Agent-Protocol.html#Agent-Protocol>
.

When attempting to use the GENKEY command as described
here<http://www.gnupg.org/documentation/manuals/gnupg-devel/Agent-GENKEY.html#Agent-GENKEY>
as
new user I always get an invalid data error when using the example client
requests:

socat /tmp/gpg-xxxxx/S.gpg-agent -
> OK Pleased to meet you, process 280
> GENKEY
> INQUIRE KEYPARAM
> D (genkey (rsa (nbits 4096)))
> END
> ERR 67108943 Invalid data <GPG Agent>
> GENKEY
> INQUIRE KEYPARAM
> D (genkey (rsa (nbits 2048)))
> END
> ERR 67108943 Invalid data <GPG Agent>
> GENKEY
> INQUIRE KEYPARAM
> D (genkey (rsa (nbits  1024)))
> END
> ERR 67108943 Invalid data <GPG Agent>


Starting gpg-agent with --debug 10 I get the following debug output:

[user at host]:~$ gpg-agent --daemon --no-detach --debug 10
gpg-agent[]: directory `/home/user/.gnupg' created
gpg-agent[]: directory `/home/user/.gnupg/private-keys-v1.d' created
gpg-agent[]: failed to convert keyparam: Invalid length specifier in
S-expression
gpg-agent[]: command genkey failed: Invalid data
gpg-agent[]: failed to convert keyparam: Invalid length specifier in
S-expression
gpg-agent[]: command genkey failed: Invalid data
gpg-agent[]: failed to convert keyparam: Invalid length specifier in
S-expression
gpg-agent[]: command genkey failed: Invalid data

This seems to suggest that there exist more parameters to the GENKEY
command than are documented. What am I missing here? Taking a step back is
this a good solution for 3rd party software to use GPG or are there
libraries I should be using instead to accomplish the communication? Diving
into the code to see if I can't figure it out but maybe you can help.

Thanks,
-Alan Meekins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20140107/edac0641/attachment-0001.html>


More information about the Gnupg-users mailing list