Mercurial > pidgin.yaz
changeset 27899:945a04f3019e
made pidgin warn only if "/purple/network/warn_cert" has been set.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 10 Oct 2008 04:30:42 +0000 |
parents | 6ed03eec37d9 |
children | a4a6dd5f5a1a |
files | libpurple/certificate.c |
diffstat | 1 files changed, 30 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/certificate.c Fri Oct 10 03:32:39 2008 +0000 +++ b/libpurple/certificate.c Fri Oct 10 04:30:42 2008 +0000 @@ -1327,20 +1327,22 @@ /* TODO: Tell the user where the chain broke? */ /* TODO: This error will hopelessly confuse any non-elite user. */ - gchar *secondary; + if(purple_prefs_get_bool("/purple/network/warn_cert")) { + gchar *secondary; - secondary = g_strdup_printf(_("The certificate chain presented" - " for %s is not valid."), - vrq->subject_name); + secondary = g_strdup_printf(_("The certificate chain presented" + " for %s is not valid."), + vrq->subject_name); - /* TODO: Make this error either block the ensuing SSL - connection error until the user dismisses this one, or - stifle it. */ - purple_notify_error(NULL, /* TODO: Probably wrong. */ - _("SSL Certificate Error"), - _("Invalid certificate chain"), - secondary ); - g_free(secondary); + /* TODO: Make this error either block the ensuing SSL + connection error until the user dismisses this one, or + stifle it. */ + purple_notify_error(NULL, /* TODO: Probably wrong. */ + _("SSL Certificate Error"), + _("Invalid certificate chain"), + secondary ); + g_free(secondary); + } /* Okay, we're done here */ purple_certificate_verify_complete(vrq, @@ -1398,21 +1400,23 @@ now, a full DN is a little much with which to assault the user's poor, leaky eyes. */ /* TODO: This error message makes my eyes cross, and I wrote it */ - gchar * secondary = - g_strdup_printf(_("The certificate chain presented by " - "%s does not have a valid digital " - "signature from the Certificate " - "Authority from which it claims to " - "have a signature."), - vrq->subject_name); + if(purple_prefs_get_bool("/purple/network/warn_cert")) { + + gchar * secondary = + g_strdup_printf(_("The certificate chain presented by " + "%s does not have a valid digital " + "signature from the Certificate " + "Authority from which it claims to " + "have a signature."), + vrq->subject_name); - purple_notify_error(NULL, /* TODO: Probably wrong */ - _("SSL Certificate Error"), - _("Invalid certificate authority" - " signature"), - secondary); - g_free(secondary); - + purple_notify_error(NULL, /* TODO: Probably wrong */ + _("SSL Certificate Error"), + _("Invalid certificate authority" + " signature"), + secondary); + g_free(secondary); + } /* Signal "bad cert" */ purple_certificate_verify_complete(vrq, PURPLE_CERTIFICATE_INVALID);