comparison libpurple/certificate.c @ 27925:93950851db8c

propagate from branch 'im.pidgin.pidgin' (head 586bc4a7e754d6b26a95c0d69dd5f2967c7a98a1) to branch 'im.pidgin.pidgin.yaz' (head a133b1255cf2e94684f42e5e8fd335d6db91c053)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 28 Jan 2009 04:09:41 +0000
parents fc8fd4fef166 421857b25052
children d8e6a2d592a4
comparison
equal deleted inserted replaced
25003:86ba0d87c04b 27925:93950851db8c
1326 /* Next, check that the certificate chain is valid */ 1326 /* Next, check that the certificate chain is valid */
1327 if ( ! purple_certificate_check_signature_chain(chain) ) { 1327 if ( ! purple_certificate_check_signature_chain(chain) ) {
1328 /* TODO: Tell the user where the chain broke? */ 1328 /* TODO: Tell the user where the chain broke? */
1329 /* TODO: This error will hopelessly confuse any 1329 /* TODO: This error will hopelessly confuse any
1330 non-elite user. */ 1330 non-elite user. */
1331 gchar *secondary; 1331 if(purple_prefs_get_bool("/purple/network/warn_cert")) {
1332 1332 gchar *secondary;
1333 secondary = g_strdup_printf(_("The certificate chain presented" 1333
1334 " for %s is not valid."), 1334 secondary = g_strdup_printf(_("The certificate chain presented"
1335 vrq->subject_name); 1335 " for %s is not valid."),
1336 1336 vrq->subject_name);
1337 /* TODO: Make this error either block the ensuing SSL 1337
1338 connection error until the user dismisses this one, or 1338 /* TODO: Make this error either block the ensuing SSL
1339 stifle it. */ 1339 connection error until the user dismisses this one, or
1340 purple_notify_error(NULL, /* TODO: Probably wrong. */ 1340 stifle it. */
1341 _("SSL Certificate Error"), 1341 purple_notify_error(NULL, /* TODO: Probably wrong. */
1342 _("Invalid certificate chain"), 1342 _("SSL Certificate Error"),
1343 secondary ); 1343 _("Invalid certificate chain"),
1344 g_free(secondary); 1344 secondary );
1345 g_free(secondary);
1346 }
1345 1347
1346 /* Okay, we're done here */ 1348 /* Okay, we're done here */
1347 purple_certificate_verify_complete(vrq, 1349 purple_certificate_verify_complete(vrq,
1348 PURPLE_CERTIFICATE_INVALID); 1350 PURPLE_CERTIFICATE_INVALID);
1349 return; 1351 return;
1397 that, too. */ 1399 that, too. */
1398 /* TODO: Also mention the CA involved. While I could do this 1400 /* TODO: Also mention the CA involved. While I could do this
1399 now, a full DN is a little much with which to assault the 1401 now, a full DN is a little much with which to assault the
1400 user's poor, leaky eyes. */ 1402 user's poor, leaky eyes. */
1401 /* TODO: This error message makes my eyes cross, and I wrote it */ 1403 /* TODO: This error message makes my eyes cross, and I wrote it */
1402 gchar * secondary = 1404 if(purple_prefs_get_bool("/purple/network/warn_cert")) {
1403 g_strdup_printf(_("The certificate chain presented by " 1405
1404 "%s does not have a valid digital " 1406 gchar * secondary =
1405 "signature from the Certificate " 1407 g_strdup_printf(_("The certificate chain presented by "
1406 "Authority from which it claims to " 1408 "%s does not have a valid digital "
1407 "have a signature."), 1409 "signature from the Certificate "
1408 vrq->subject_name); 1410 "Authority from which it claims to "
1411 "have a signature."),
1412 vrq->subject_name);
1409 1413
1410 purple_notify_error(NULL, /* TODO: Probably wrong */ 1414 purple_notify_error(NULL, /* TODO: Probably wrong */
1411 _("SSL Certificate Error"), 1415 _("SSL Certificate Error"),
1412 _("Invalid certificate authority" 1416 _("Invalid certificate authority"
1413 " signature"), 1417 " signature"),
1414 secondary); 1418 secondary);
1415 g_free(secondary); 1419 g_free(secondary);
1416 1420 }
1417 /* Signal "bad cert" */ 1421 /* Signal "bad cert" */
1418 purple_certificate_verify_complete(vrq, 1422 purple_certificate_verify_complete(vrq,
1419 PURPLE_CERTIFICATE_INVALID); 1423 PURPLE_CERTIFICATE_INVALID);
1420 return; 1424 return;
1421 } /* if (CA signature not good) */ 1425 } /* if (CA signature not good) */