After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 396645 - Import certificate dialogs aren't filtering by mime-type
Import certificate dialogs aren't filtering by mime-type
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
2.8.x (obsolete)
Other All
: Normal minor
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2007-01-14 20:38 UTC by Gilles Dartiguelongue
Modified: 2007-04-20 05:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
evolution-2.8.2.1-certificate-manager-filtering.patch (2.96 KB, patch)
2007-01-14 20:40 UTC, Gilles Dartiguelongue
none Details | Review
evolution-2.8.2.1-certificate-manager-filter.patch (2.97 KB, patch)
2007-02-14 19:38 UTC, Gilles Dartiguelongue
committed Details | Review

Description Gilles Dartiguelongue 2007-01-14 20:38:10 UTC
These dialogs should be able to filter files based on their mime-type so that the user is presented only the files he can import

Other information:
I'll post a preliminary patch in a minute
Comment 1 Gilles Dartiguelongue 2007-01-14 20:40:46 UTC
Created attachment 80266 [details] [review]
evolution-2.8.2.1-certificate-manager-filtering.patch

this patch modifies the 3 import dialogs to filter the content based on the mime-type it is supposed to handle. It works very well for PKCS#12 files but x509-ca-cert and x509-email-cert aren't shown, so it might be a bug in the chooser. Anyway those 2 needs more testing.
Comment 2 Gilles Dartiguelongue 2007-02-14 19:38:41 UTC
Created attachment 82558 [details] [review]
evolution-2.8.2.1-certificate-manager-filter.patch

Ok, this one works for all certificates evolution supports. It was a simple typo.
Comment 3 Srinivasa Ragavan 2007-02-15 05:18:12 UTC
The patch looks neat and clean. But Im not sure about all the mime types. Is this all about or are there any more formats too? If some one can confirm the mime types, this patch can be committed. Thanks
Comment 4 Gilles Dartiguelongue 2007-02-15 07:16:58 UTC
looking on the web I found 4 type of certifitcates but the present mimetypes I selected are those evolution takes care of according to the sources (by searching in the same file).
Comment 5 Gilles Dartiguelongue 2007-02-17 09:47:38 UTC
ok much details:

look in evolution/smime/lib/e-cert-db.c at function:

gboolean
e_cert_db_import_certs_from_file (ECertDB *cert_db,
                                  const char *file_path,
                                  ECertType cert_type,
                                  GError **error)

you will find 

switch (cert_type) {
    case E_CERT_CA:
        rv = e_cert_db_import_certs (cert_db, buf, bytes_read, cert_type, error);
        break;

    case E_CERT_SITE:
        rv = e_cert_db_import_server_cert (cert_db, buf, bytes_read, error);
        break;

    case E_CERT_CONTACT:
        rv = e_cert_db_import_email_cert (cert_db, buf, bytes_read, error);
        break;

    default:
        rv = FALSE;
        break;
}

and then on http://www.sfsu.edu/training/mimetype.htm, you will find :
type	application/x-x509-ca-cert	cacert
type	application/x-x509-server-cert	scert
type	application/x-x509-user-cert	ucert
type	application/x-x509-email-cert	ecert

As evolution didn't let me import a PEM encoded user certificate, I thought it would only take pkcs12 formated user certificates but maybe I did something wrong with the pem file. The pkcs12 stuff has function /e_cert_db_import_pkcs12_file/ anf finaly for E_CERT_SITE, looking at the fonction, there is no UI for it that's why it's not present here.

Anyway, that's how I came to write this patch. Hope I'm clear enough.
Comment 6 Srinivasa Ragavan 2007-03-30 11:10:55 UTC
Commit to HEAD only.
Comment 7 Kjartan Maraas 2007-04-17 21:29:14 UTC
Gilles, do you have commit rights?
Comment 8 Gilles Dartiguelongue 2007-04-17 21:35:46 UTC
no I don't.
Comment 9 Srinivasa Ragavan 2007-04-20 05:26:20 UTC
Fixed.