~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to camel/camel-smime-context.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 
63
63
#define d(x)
64
64
 
 
65
void smime_cert_data_free (gpointer cert_data);
 
66
gpointer smime_cert_data_clone (gpointer cert_data);
 
67
 
65
68
struct _CamelSMIMEContextPrivate {
66
69
        CERTCertDBHandle *certdb;
67
70
 
439
442
        if ((cert = CERT_FindUserCertByUsage(p->certdb,
440
443
                                             (gchar *)nick,
441
444
                                             certUsageEmailSigner,
442
 
                                             PR_FALSE,
 
445
                                             PR_TRUE,
443
446
                                             NULL)) == NULL) {
444
447
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot find certificate for '%s'"), nick);
445
448
                return NULL;
504
507
                        if ((ekpcert = CERT_FindUserCertByUsage(
505
508
                                     p->certdb,
506
509
                                     p->encrypt_key,
507
 
                                     certUsageEmailRecipient, PR_FALSE, NULL)) == NULL) {
 
510
                                     certUsageEmailRecipient, PR_TRUE, NULL)) == NULL) {
508
511
                                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Encryption certificate for '%s' does not exist"), p->encrypt_key);
509
512
                                goto fail;
510
513
                        }
516
519
                        /* encrypt key uses same nick */
517
520
                        if ((ekpcert = CERT_FindUserCertByUsage(
518
521
                                     p->certdb, (gchar *)nick,
519
 
                                     certUsageEmailRecipient, PR_FALSE, NULL)) == NULL) {
 
522
                                     certUsageEmailRecipient, PR_TRUE, NULL)) == NULL) {
520
523
                                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Encryption certificate for '%s' does not exist"), nick);
521
524
                                goto fail;
522
525
                        }
716
719
        }
717
720
}
718
721
 
 
722
void
 
723
smime_cert_data_free (gpointer cert_data)
 
724
{
 
725
        g_return_if_fail (cert_data != NULL);
 
726
 
 
727
        CERT_DestroyCertificate (cert_data);
 
728
}
 
729
 
 
730
gpointer
 
731
smime_cert_data_clone (gpointer cert_data)
 
732
{
 
733
        g_return_val_if_fail (cert_data != NULL, NULL);
 
734
 
 
735
        return CERT_DupCertificate (cert_data);
 
736
}
 
737
 
719
738
static CamelCipherValidity *
720
739
sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *extstream, CamelException *ex)
721
740
{
841
860
                                                               cn?cn:"<unknown>", em?em:"<unknown>",
842
861
                                                               sm_status_description(status));
843
862
 
844
 
                                        camel_cipher_validity_add_certinfo(valid, CAMEL_CIPHER_VALIDITY_SIGN, cn, em);
 
863
                                        camel_cipher_validity_add_certinfo_ex (valid, CAMEL_CIPHER_VALIDITY_SIGN, cn, em, smime_cert_data_clone (NSS_CMSSignerInfo_GetSigningCertificate (si, p->certdb)), smime_cert_data_free, smime_cert_data_clone);
845
864
 
846
865
                                        if (cn)
847
866
                                                PORT_Free(cn);