~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to agent/divert-scd.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2006-01-24 04:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060124043142-pbg192or6qxv3yk2
Tags: 1.9.20-1
* New Upstream version. Closes:#306890,#344530
  * Closes:#320490: gpg-protect-tool fails to decrypt PKCS-12 files 
* Depend on libopensc2-dev, not -1-. Closes:#348106

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
  const char *again_text = NULL;
205
205
  const char *prompt = "PIN";
206
206
 
207
 
  if (maxbuf < 2)
 
207
  if (buf && maxbuf < 2)
208
208
    return gpg_error (GPG_ERR_INV_VALUE);
209
209
 
210
210
  /* Parse the flags. */
223
223
  else if (info && *info == '|')
224
224
    log_debug ("pin_cb called without proper PIN info hack\n");
225
225
 
 
226
  /* If BUF has been passed as NULL, we are in keypad mode: The
 
227
     callback opens the popup and immediatley returns. */
 
228
  if (!buf)
 
229
    {
 
230
      if (maxbuf == 0) /* Close the pinentry. */
 
231
        {
 
232
          agent_popup_message_stop (ctrl);
 
233
          rc = 0;
 
234
        }
 
235
      else if (maxbuf == 1)  /* Open the pinentry. */
 
236
        {
 
237
          rc = agent_popup_message_start (ctrl, info, NULL, NULL);
 
238
        }
 
239
      else
 
240
        rc = gpg_error (GPG_ERR_INV_VALUE);
 
241
      return rc;
 
242
    }
226
243
 
227
244
  /* FIXME: keep PI and TRIES in OPAQUE.  Frankly this is a whole
228
245
     mess because we should call the card's verify function from the