[Gnuk-users] gpg: signing failed: Zero prefix in S-expression

NIIBE Yutaka gniibe at fsij.org
Thu Feb 12 03:11:00 UTC 2015


Thank you for your report.

On 02/12/2015 06:23 AM, Jonathan Schleifer wrote:
> What could cause this? The signature counter did not increase when
> that happened. Now that it works again, the signature counter
> increases properly.

'Zero prefix in S-expression' is the error in libgcrypt when parsing
S-expression (the data format for libgcrypt).  The data format has
the length field and the content, and the length field should not
begin with 0.

It might be:

    * Some error in the computation of signature by Gnuk Token but the
      wrong/irrelevant error code was returned.

    * Error between gpg front-end and gpg-agent for some data protocol
      mismatch.

    * Error between gpg-agent and scdaemon for some data protocol
      mismatch.

To debug, you can supply --debug-all argument to gpg, and you can put
following lines for gpg-agent and scdaemon.

----------- .gnupg/gpg-agent.conf
debug-level guru
debug-all
log-file /var/tmp/gpg-agent-debug.log
-----------

----------- .gnupg/scdaemon.conf
debug-level guru
debug-all
log-file /var/tmp/scd-debug.log
-----------

For an experiment to find reproducible case, it is better for you to
set a specific PIN beforehand, since the PIN information might be
in the log.
-- 



More information about the gnuk-users mailing list