aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-12-08 02:23:33 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-12-08 02:23:33 +0000
commit4b0433b7a9173709efcd5a07cb04ee246f9e2d4c (patch)
tree4f918acfa27874c18d4018b87115d0c19354c3a9 /src
parent3b8b01d72b34c4dc549e48976a45c6ae8e8a0835 (diff)
prohibit acception of expired SSL certificates.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2366 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/sslmanager.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sslmanager.c b/src/sslmanager.c
index b303960d..66beafbe 100644
--- a/src/sslmanager.c
+++ b/src/sslmanager.c
@@ -59,6 +59,7 @@ gint ssl_manager_verify_cert(SockInfo *sockinfo, const gchar *hostname,
gchar not_before[64] = "", not_after[64] = "";
gint i;
gint result;
+ gboolean disable_always = FALSE;
if (verify_result == X509_V_OK)
return 0;
@@ -174,6 +175,10 @@ gint ssl_manager_verify_cert(SockInfo *sockinfo, const gchar *hostname,
}
#endif
+ /* prohibit acception of expired certificates */
+ if (verify_result == X509_V_ERR_CERT_HAS_EXPIRED)
+ disable_always = TRUE;
+
if (prefs_common.comply_gnome_hig)
gtk_dialog_add_buttons(GTK_DIALOG(dialog),
_("_Reject"), GTK_RESPONSE_REJECT,
@@ -187,6 +192,9 @@ gint ssl_manager_verify_cert(SockInfo *sockinfo, const gchar *hostname,
_("_Reject"), GTK_RESPONSE_REJECT,
NULL);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ if (disable_always)
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
+ GTK_RESPONSE_ACCEPT, FALSE);
gtk_widget_show_all(dialog);