comparison libpurple/certificate.c @ 28392:64fbf431d952

Print that specific message only when there is a CN; otherwise fall back to the error from invalidity_reason_to_string(). Fixes #10519. Thanks for pointing this out, QuLogic.
author Paul Aurich <paul@darkrain42.org>
date Fri, 16 Oct 2009 04:42:39 +0000
parents b7d60f0e1df2
children f1437342cc0e
comparison
equal deleted inserted replaced
28391:b7d60f0e1df2 28392:64fbf431d952
1400 1400
1401 /* Special case a name mismatch because we want to display the two names... */ 1401 /* Special case a name mismatch because we want to display the two names... */
1402 if (flags & PURPLE_CERTIFICATE_NAME_MISMATCH) { 1402 if (flags & PURPLE_CERTIFICATE_NAME_MISMATCH) {
1403 gchar *sn = purple_certificate_get_subject_name(peer_crt); 1403 gchar *sn = purple_certificate_get_subject_name(peer_crt);
1404 1404
1405 g_string_append_printf(errors, _("The certificate claims to be " 1405 if (sn) {
1406 "from \"%s\" instead. This could mean that you are " 1406 g_string_append_printf(errors, _("The certificate claims to be "
1407 "not connecting to the service you believe you are."), 1407 "from \"%s\" instead. This could mean that you are "
1408 sn ? sn : "(null)"); 1408 "not connecting to the service you believe you are."),
1409 g_free(sn); 1409 sn);
1410 1410 g_free(sn);
1411 flags &= ~PURPLE_CERTIFICATE_NAME_MISMATCH; 1411
1412 flags &= ~PURPLE_CERTIFICATE_NAME_MISMATCH;
1413 }
1412 } 1414 }
1413 1415
1414 while (i != PURPLE_CERTIFICATE_LAST) { 1416 while (i != PURPLE_CERTIFICATE_LAST) {
1415 if (flags & i) { 1417 if (flags & i) {
1416 errors = g_string_append_c(errors, '\n'); 1418 errors = g_string_append_c(errors, '\n');