~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): Eric Dorland
  • Date: 2009-03-08 22:46:47 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090308224647-gq17gatcl71lrc2k
Tags: 2.0.11-1
* New upstream release. (Closes: #496663)
* debian/control: Make the description a little more distinctive than
  gnupg v1's. Thanks Jari Aalto. (Closes: #496323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
          else
121
121
            {
122
122
              rc = agent_get_confirmation (ctrl, desc, NULL, NULL);
123
 
              free (desc);
 
123
              xfree (desc);
124
124
            }
125
125
        }
126
126
      if (rc)
185
185
            PIN.  If the PIN is not correctly repeated it starts from
186
186
            all over.
187
187
      'A' = The PIN is an Admin PIN, SO-PIN, PUK or alike.
 
188
      'R' = The PIN is a Reset Code.
188
189
 
189
190
   Example:
190
191
 
202
203
  const char *ends, *s;
203
204
  int any_flags = 0;
204
205
  int newpin = 0;
 
206
  int resetcode = 0;
205
207
  const char *again_text = NULL;
206
208
  const char *prompt = "PIN";
207
209
 
217
219
            prompt = _("Admin PIN");
218
220
          else if (*s == 'N')
219
221
            newpin = 1;
 
222
          else if (*s == 'R')
 
223
            {
 
224
              prompt = _("Reset Code");
 
225
              resetcode = 1;
 
226
            }
220
227
        }
221
228
      info = ends+1;
222
229
      any_flags = 1;
272
279
          pi2->min_digits = 0;
273
280
          pi2->max_digits = 8;
274
281
          pi2->max_tries = 1;
275
 
          rc = agent_askpin (ctrl, _("Repeat this PIN"), prompt, NULL, pi2);
 
282
          rc = agent_askpin (ctrl,
 
283
                             (resetcode?
 
284
                              _("Repeat this Reset Code"):
 
285
                              _("Repeat this PIN")),
 
286
                             prompt, NULL, pi2);
276
287
          if (!rc && strcmp (pi->pin, pi2->pin))
277
288
            {
278
 
              again_text = N_("PIN not correctly repeated; try again");
 
289
              again_text = (resetcode? 
 
290
                            N_("Reset Code not correctly repeated; try again"):
 
291
                            N_("PIN not correctly repeated; try again"));
279
292
              xfree (pi2);
280
293
              xfree (pi);
281
294
              goto again;
293
306
                     info? "')":"") < 0)
294
307
        desc = NULL;
295
308
      rc = agent_askpin (ctrl, desc?desc:info, prompt, NULL, pi);
296
 
      free (desc);
 
309
      xfree (desc);
297
310
    }
298
311
 
299
312
  if (!rc)
322
335
  if (rc)
323
336
    return rc;
324
337
 
325
 
  if (algo == GCRY_MD_USER_TLS_MD5SHA1)
 
338
  if (algo == MD_USER_TLS_MD5SHA1)
326
339
    {
327
340
      int save = ctrl->use_auth_call;
328
341
      ctrl->use_auth_call = 1;