else  log_debug ("%s:%s: hd=%p hd->pass=`%s'\n", __FILE__, __func__, hd, hd && hd->pass? hd->pass: "(null)");
else log_debug ("%s:%s: hd=%p hd->pass=`[censored]'\n", __FILE__, __func__, hd);
passphrase_callback_box (void *opaque, const char *uid_hint, 			 const char *pass_info,			 int prev_was_bad, int fd){  struct decrypt_key_s *hd = opaque;  DWORD nwritten = 0;  char keyidstr[16+1];  log_debug ("passphrase_callback_box: enter (uh=`%s',pi=`%s')\n",              uid_hint?uid_hint:"(null)", pass_info?pass_info:"(null)");  *keyidstr = 0;   /* First remove a possible passphrase from the return structure. */  if (hd->pass)    wipestring (hd->pass);  xfree (hd->pass);  hd->pass = NULL;  /* For some reasons the cancel flag has been set - write an empty     passphrase and close the handle to indicate the cancel state to     the backend. */  if (hd->opts & OPT_FLAG_CANCEL)    {      /* FIXME: Casting an FD to a handles is very questionable.  We         need to check this. */      WriteFile ((HANDLE)fd, "\n", 1, &nwritten, NULL);      CloseHandle ((HANDLE)fd);      log_debug ("passphrase_callback_box: leave (due to cancel flag)\n");      return -1;    }  /* Parse the information to get the keyid we use for caching of the     passphrase. If we got suitable information, we will have a proper     16 character string in KEYIDSTR; if not KEYIDSTR has been set to     empty. */  if (pass_info)    {      /* As of now (gpg 1.4.2) these information are possible:         1. Standard passphrase requested:            "<long main keyid> <long keyid> <keytype> <keylength>"         2. Passphrase for symmetric key requested:            "<cipher_algo> <s2k_mode> <s2k_hash>"         3. PIN for a card requested.            "<card_type> <chvno>"             For caching we need to use the long keyid from case 1; the main       keyid can't be used because a key may have different       passphrases on the subkeys.  Caching for symmetrical keys is       not possible becuase there is no information on what       key(i.e. passphrase) to use.  Caching of of PINs is not yet       possible because we don't have information on the card's serial       number yet; that must be solved by gpgme.        To detect case 1 we simply check whether the first token       consists in its entire of 16 hex digits.      */      const char *s;      int i;      for (s=pass_info, i=0; *s && strchr (allhexdigits, *s) ; s++, i++)        ;      if (i == 16)        {          while (*s == ' ')            s++;          for (i=0; *s && strchr (allhexdigits, *s) && i < 16; s++, i++)            keyidstr[i] = *s;          keyidstr[i] = 0;          if (*s)            s++;          if (i != 16 || !strchr (allhexdigits, *s))            {              log_debug ("%s: oops: does not look like pass_info\n", __func__);              *keyidstr = 0;            }        }    }     log_debug ("%s: using keyid 0x%s\n", __func__, keyidstr);  /* Now check how to proceed. */  if (prev_was_bad)     {      log_debug ("%s: last passphrase was bad\n", __func__);      /* Flush a possible cache entry for that keyID. */      if (*keyidstr)        passcache_put (keyidstr, NULL, 0);    }  else if (*keyidstr)    {      hd->pass = passcache_get (keyidstr);      log_debug ("%s: getting passphrase for 0x%s from cache: %s\n",                 __func__, keyidstr, hd->pass? "hit":"miss");    }  /* Copy the keyID into the context. */  assert (strlen (keyidstr) < sizeof hd->keyid);  strcpy (hd->keyid, keyidstr);  /* If we have no cached pssphrase, popup the passphrase dialog. */  if (!hd->pass)    {      int rc;      const char *s;      /* Construct the user ID. */      if (uid_hint)        {          /* Skip the first token (keyID). */          for (s=uid_hint; *s && *s != ' '; s++)             ;          while (*s == ' ')            s++;        }      else        s = "[no user Id]";      xfree (hd->user_id);      hd->user_id = xstrdup (s);                hd->last_was_bad = prev_was_bad;      hd->use_as_cb = 1; /* FIXME: For what is this used? */      if (hd->flags & 0x01)        rc = DialogBoxParam (glob_hinst, (LPCSTR)IDD_DEC,                             GetDesktopWindow (),                             decrypt_key_dlg_proc, (LPARAM)hd);      else        rc = DialogBoxParam (glob_hinst, (LPCTSTR)IDD_DEC_EXT,                             GetDesktopWindow (),                             decrypt_key_ext_dlg_proc, (LPARAM)hd);      if (rc <= 0)         log_debug_w32 (-1, "%s: dialog failed (rc=%d)", __func__, rc);    }  else /* FIXME: Don't write the passphrase to the log file. */    log_debug ("%s:%s: hd=%p hd->pass=`%s'\n",               __FILE__, __func__, hd, hd && hd->pass? hd->pass: "(null)");  /* If we got a passphrase, send it to the FD. */  if (hd->pass)     {      log_debug ("passphrase_callback_box: sending passphrase ...\n");      WriteFile ((HANDLE)fd, hd->pass, strlen (hd->pass), &nwritten, NULL);    }  WriteFile((HANDLE)fd, "\n", 1, &nwritten, NULL);  log_debug ("passphrase_callback_box: leave\n");  return 0;}