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

« back to all changes in this revision

Viewing changes to sm/sign.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:
426
426
          goto leave;
427
427
        }
428
428
    }
 
429
 
 
430
 
 
431
  /* Check whether one of the certificates is qualified.  Note that we
 
432
     already validated the certificate and thus the user data stored
 
433
     flag must be available. */
 
434
  for (cl=signerlist; cl; cl = cl->next)
 
435
    {
 
436
      size_t buflen;
 
437
      char buffer[1];
 
438
      
 
439
      err = ksba_cert_get_user_data (cl->cert, "is_qualified", 
 
440
                                     &buffer, sizeof (buffer), &buflen);
 
441
      if (err || !buflen)
 
442
        {
 
443
          log_error (_("checking for qualified certificate failed: %s\n"),
 
444
                     gpg_strerror (err)); 
 
445
          rc = err;
 
446
          goto leave;
 
447
        }
 
448
      if (*buffer)
 
449
        err = gpgsm_qualified_consent (ctrl, cl->cert);
 
450
      else
 
451
        err = gpgsm_not_qualified_warning (ctrl, cl->cert);
 
452
      if (err)
 
453
        {
 
454
          rc = err;
 
455
          goto leave;
 
456
        }
 
457
    }
429
458
  
430
459
  /* Prepare hashing (actually we are figuring out what we have set above)*/
431
460
  rc = gcry_md_open (&data_md, 0, 0);
443
472
      if (!algo)
444
473
        {
445
474
          log_error ("unknown hash algorithm `%s'\n", algoid? algoid:"?");
 
475
          if (algoid
 
476
              && (  !strcmp (algoid, "1.2.840.113549.1.1.2")
 
477
                    ||!strcmp (algoid, "1.2.840.113549.2.2")))
 
478
            log_info (_("(this is the MD2 algorithm)\n"));
446
479
          rc = gpg_error (GPG_ERR_BUG);
447
480
          goto leave;
448
481
        }