<GPG Agent> - invalid length of cacheID

View: New views
3 Messages — Rating Filter:   Alert me  

<GPG Agent> - invalid length of cacheID

by Thomas-Bahn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

i have the problem, that gpg-agent throws errors when launching the pinentry.
I analyzed the problem and would give you my results in the hope, that the bug can be fixed.
I have no idea what else can be faulty…
I searched the code snippet for you to help simplify the work on this problem as good as i can.
I think its the code snippet that causes this error but i can't analyze this furthermore because my skills not as good as needed.

Following the gpg-agent.conf:

   debug-level guru
   log-file socket:///home/thomas/.gnupg/log-socket
   pinentry-program /usr/bin/pinentry-gtk-2
   no-grab
   default-cache-ttl 1800

The settings are correct i'm sure.
Here is a part of the log from KWatchGnuPG:

  5 - 2009-10-27 19:22:17 gpg-agent[3840.9] DBG: <- GET_PASSPHRASE --data --repeat=0 -- X X Passphrase: Please+enter+the+passphrase+to+unprotect+the+PKCS#12+object.
  5 - 2009-10-27 19:22:17 gpg-agent[3840]: starting a new PIN Entry
  5 - 2009-10-27 19:22:17 gpg-agent[3840]: DBG: connection to PIN entry established
  5 - 2009-10-27 19:22:17 gpg-agent[3840.9] DBG: -> INQUIRE PINENTRY_LAUNCHED 4205
  5 - 2009-10-27 19:22:17 gpg-agent[3840.9] DBG: <- END
  5 - 2009-10-27 19:22:17 gpg-agent[3840]: command get_passphrase failed: End of File
  5 - 2009-10-27 19:22:17 gpg-agent[3840.9] DBG: -> OK closing connection

But this log wasn't enough information so i looked for reproducing the error directly in gpg-agent. And i found gpg-connect-agent.
Here the error when i connect to gpg-agent and give him the command:

   gpg-connect-agent
   > GET_PASSPHRASE
   ERR 67109144 IPC Parameterfehler <GPG Agent> - invalid length of cacheID
   >

This error was enough information for me and i found following code in gnupg-2.0.13/agent/command.c :
In function cmd_get_passphrase:

static int
cmd_get_passphrase (assuan_context_t ctx, char *line)
{
  ctrl_t ctrl = assuan_get_pointer (ctx);
  int rc;
  const char *pw;
  char *response;
  char *cacheid = NULL, *desc = NULL, *prompt = NULL, *errtext = NULL;
  const char *desc2 = _("Please re-enter this passphrase");
  char *p;
  void *cache_marker;
  int opt_data, opt_check, opt_no_ask, opt_qualbar;
  int opt_repeat = 0;
  char *repeat_errtext = NULL;

  opt_data = has_option (line, "--data");
  opt_check = has_option (line, "--check");
  opt_no_ask = has_option (line, "--no-ask");
  if (has_option_name (line, "--repeat"))
    {
      p = option_value (line, "--repeat");
      if (p)
        opt_repeat = atoi (p);
      else
        opt_repeat = 1;
    }
  opt_qualbar = has_option (line, "--qualitybar");
  line = skip_options (line);

  cacheid = line;
  p = strchr (cacheid, ' ');
  if (p)
    {
      *p++ = 0;
      while (*p == ' ')
        p++;
      errtext = p;
      p = strchr (errtext, ' ');
      if (p)
        {
          *p++ = 0;
          while (*p == ' ')
            p++;
          prompt = p;
          p = strchr (prompt, ' ');
          if (p)
            {
              *p++ = 0;
              while (*p == ' ')
                p++;
              desc = p;
              p = strchr (desc, ' ');
              if (p)
                *p = 0; /* Ignore trailing garbage. */
            }
        }
    }

  if (!cacheid || !*cacheid || strlen (cacheid) > 50)
    return set_error (GPG_ERR_ASS_PARAMETER, "invalid length of cacheID");
  if (!desc)
    return set_error (GPG_ERR_ASS_PARAMETER, "no description given");

--- CUT --- (the pasted code is long enough ;))


if (!cacheid || !*cacheid || strlen (cacheid) > 50)
    return set_error (GPG_ERR_ASS_PARAMETER, "invalid length of cacheID");

This statement must be the cause of the error... but what value was in cacheid and why it can be faulty? I can't answer this question and hope you can?

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@...
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

Re: <GPG Agent> - invalid length of cacheID

by Werner Koch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 27 Oct 2009 21:28, Thomas-Bahn@... said:

>    gpg-connect-agent
>    > GET_PASSPHRASE
>    ERR 67109144 IPC Parameterfehler <GPG Agent> - invalid length of cacheID

You need to give the mandatory arguments.  If you don't one of them you
give a 'X', like this:

  > GET_PASSPHRASE X X X X
  OK 616263

or this

  > GET_PASSPHRASE --data X X X X
  D abc
  OK

Sorry, I can't look into you pinentry problems.  Using a wrapper script
as pinentry is usually helpful in this case.


Shalom-Salam,

   Werner


--
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@...
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

Re: <GPG Agent> - invalid length of cacheID

by Thomas-Bahn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh, excuse me, with the arguments it gives me the prompt as it should.

But whats then the problem?
I will reseach it and give you more information when its time.

Thank you, this helped me a lot ;)

> On Tue, 27 Oct 2009 21:28, Thomas-Bahn@... said:
> >    gpg-connect-agent
> >
> >    > GET_PASSPHRASE
> >
> >    ERR 67109144 IPC Parameterfehler <GPG Agent> - invalid length of
> > cacheID
>
> You need to give the mandatory arguments.  If you don't one of them you
>
> give a 'X', like this:
>   > GET_PASSPHRASE X X X X
>
>   OK 616263
>
> or this
>
>   > GET_PASSPHRASE --data X X X X
>
>   D abc
>   OK
>
> Sorry, I can't look into you pinentry problems.  Using a wrapper script
> as pinentry is usually helpful in this case.
>
>
> Shalom-Salam,
>
>    Werner
>

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@...
http://lists.gnupg.org/mailman/listinfo/gnupg-devel