Index: mail/ChangeLog
===================================================================
--- mail/ChangeLog	(revision 37363)
+++ mail/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2009-03-03  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #372435
+
+	* em-format-html-display.c: (efhd_xpkcs7mime_viewcert_clicked),
+	(efhd_xpkcs7mime_add_cert_table): Show information preferably
+	on certificate included in a mail, than some from a certificate db.
+
 2009-03-02  Matt McCutchen  <matt@mattmccutchen.net>
 
 	* evolution/mail/em-folder-view.c:
Index: mail/em-format-html-display.c
===================================================================
--- mail/em-format-html-display.c	(revision 37363)
+++ mail/em-format-html-display.c	(working copy)
@@ -1005,14 +1005,10 @@ static void
 efhd_xpkcs7mime_viewcert_clicked(GtkWidget *button, struct _smime_pobject *po)
 {
 	CamelCipherCertInfo *info = g_object_get_data((GObject *)button, "e-cert-info");
-	ECertDB *db = e_cert_db_peek();
 	ECert *ec = NULL;
 
-	if (info->email)
-		ec = e_cert_db_find_cert_by_email_address(db, info->email, NULL);
-
-	if (ec == NULL && info->name)
-		ec = e_cert_db_find_cert_by_nickname(db, info->name, NULL);
+	if (info->cert_data)
+		ec = e_cert_new (info->cert_data);
 
 	if (ec != NULL) {
 		GtkWidget *w = certificate_viewer_show(ec);
@@ -1055,7 +1051,6 @@ efhd_xpkcs7mime_add_cert_table(GtkWidget
 		if (l) {
 			GtkWidget *w;
 #if defined(HAVE_NSS)
-			ECertDB *db = e_cert_db_peek();
 			ECert *ec = NULL;
 #endif
 			w = gtk_label_new(l);
@@ -1068,10 +1063,8 @@ efhd_xpkcs7mime_add_cert_table(GtkWidget
 			g_object_set_data((GObject *)w, "e-cert-info", info);
 			g_signal_connect(w, "clicked", G_CALLBACK(efhd_xpkcs7mime_viewcert_clicked), po);
 
-			if (info->email)
-				ec = e_cert_db_find_cert_by_email_address(db, info->email, NULL);
-			if (ec == NULL && info->name)
-				ec = e_cert_db_find_cert_by_nickname(db, info->name, NULL);
+			if (info->cert_data)
+				ec = e_cert_new (info->cert_data);
 
 			if (ec == NULL)
 				gtk_widget_set_sensitive(w, FALSE);
