Changeset 5433:63cfab6d508b

Show
Ignore:
Timestamp:
2008-06-29 00:31:42 (5 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Show more information about problematic SMIME signatures under gpgme.
Also warn if the key is not known to be good. For some reason expired
keys in my environment are not flagged as expired in sig->status or
sig->summary.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5431 r5433  
     12008-06-28 20:33 -0700  Brendan Cully  <brendan@kublai.com>  (1492c24f2a4e) 
     2 
     3        * mutt_ssl_gnutls.c: Extract CN from client certificate in gnutls. 
     4        Nothing currently uses it, but I suspect we should be using it as 
     5        the external auth name in mutt_sasl_client_new. 
     6 
     7        * UPDATING, globals.h, init.h, mutt_sasl.c, mutt_ssl_gnutls.c: 
     8        Basic support for $ssl_client_cert when compiled with 
     9        gnutls. The key must not be encrypted. Closes #2911. 
     10 
    1112008-06-27 12:04 -0700  Petr Písař  <petr.pisar@atlas.cz>  (40c6e851bf76) 
    212 
  • crypt-gpgme.c

    r5422 r5433  
    12531253} 
    12541254 
     1255static void print_smime_keyinfo (gpgme_signature_t sig, gpgme_key_t key, 
     1256                                 STATE *s) 
     1257{ 
     1258  gpgme_user_id_t uids = NULL; 
     1259  int aka = 0; 
     1260 
     1261  for (uids = key->uids; uids; uids = uids->next) 
     1262  { 
     1263    if (uids->revoked) 
     1264      continue; 
     1265    if (aka) 
     1266      state_attach_puts (_("                aka: "), s); 
     1267    state_attach_puts (uids->uid, s); 
     1268    state_attach_puts ("\n", s); 
     1269     
     1270    aka = 1; 
     1271  } 
     1272  state_attach_puts (_("            created: "), s); 
     1273  print_time (sig->timestamp, s); 
     1274  state_attach_puts ("\n", s);   
     1275} 
     1276 
    12551277/* Show information about one signature.  This fucntion is called with 
    12561278   the context CTX of a sucessful verification operation and the 
     
    12621284static int show_one_sig_status (gpgme_ctx_t ctx, int idx, STATE *s) 
    12631285{ 
    1264   time_t created; 
    12651286  const char *fpr, *uid; 
    12661287  gpgme_key_t key = NULL; 
     
    12911312        } 
    12921313       
    1293       created = sig->timestamp; 
    12941314      fpr = sig->fpr; 
    12951315      sum = sig->summary; 
     
    13161336      else if (err) 
    13171337        { 
    1318           state_attach_puts (_("Error getting key information: "), s); 
    1319          state_attach_puts ( gpg_strerror (err), s ); 
    1320           state_attach_puts ("\n", s); 
    1321          anybad = 1; 
     1338          state_attach_puts (_("Error getting key information: "), s); 
     1339          state_attach_puts ( gpg_strerror (err), s ); 
     1340          state_attach_puts ("\n", s); 
     1341          anybad = 1; 
    13221342        } 
    13231343      else if ((sum & GPGME_SIGSUM_GREEN)) 
    1324         { 
    1325           state_attach_puts (_("Good signature from: "), s); 
    1326           state_attach_puts (uid, s); 
    1327           state_attach_puts ("\n", s); 
    1328           for (i = 1, uids = key->uids; uids; i++, uids = uids->next) 
    1329             { 
    1330               if (i == 1) 
    1331                 /* Skip primary UID.  */ 
    1332                 continue; 
    1333               if (uids->revoked) 
    1334                 continue; 
    1335               state_attach_puts (_("                aka: "), s); 
    1336               state_attach_puts (uids->uid, s); 
    1337               state_attach_puts ("\n", s); 
    1338             } 
    1339           state_attach_puts (_("            created: "), s); 
    1340           print_time (created, s); 
    1341           state_attach_puts ("\n", s); 
    1342           if (show_sig_summary (sum, ctx, key, idx, s, sig)) 
    1343             anywarn = 1; 
    1344           show_one_sig_validity (ctx, idx, s); 
    1345         } 
     1344      { 
     1345        state_attach_puts (_("Good signature from: "), s); 
     1346        print_smime_keyinfo (sig, key, s); 
     1347        state_attach_puts (_("            expires: "), s); 
     1348        print_time (sig->exp_timestamp, s); 
     1349        state_attach_puts ("\n", s); 
     1350        if (show_sig_summary (sum, ctx, key, idx, s, sig)) 
     1351          anywarn = 1; 
     1352        show_one_sig_validity (ctx, idx, s); 
     1353      } 
    13461354      else if ((sum & GPGME_SIGSUM_RED)) 
    1347         { 
    1348           state_attach_puts (_("*BAD* signature claimed to be from: "), s); 
    1349           state_attach_puts (uid, s); 
    1350           state_attach_puts ("\n", s); 
    1351           show_sig_summary (sum, ctx, key, idx, s, sig); 
    1352         } 
     1355      { 
     1356        state_attach_puts (_("*BAD* signature claimed to be from: "), s); 
     1357        print_smime_keyinfo (sig, key, s); 
     1358        show_sig_summary (sum, ctx, key, idx, s, sig); 
     1359      } 
    13531360      else if (!anybad && key && (key->protocol == GPGME_PROTOCOL_OpenPGP)) 
    13541361        { /* We can't decide (yellow) but this is a PGP key with a good 
     
    13601367          state_attach_puts ("\n", s); 
    13611368          state_attach_puts (_("            created: "), s); 
    1362           print_time (created, s); 
     1369          print_time (sig->timestamp, s); 
    13631370          state_attach_puts ("\n", s); 
    13641371          show_one_sig_validity (ctx, idx, s); 
     
    13681375        } 
    13691376      else /* can't decide (yellow) */ 
    1370         { 
    1371           state_attach_puts (_("Error checking signature"), s); 
    1372           state_attach_puts ("\n", s); 
    1373           show_sig_summary (sum, ctx, key, idx, s, sig); 
    1374         } 
     1377      { 
     1378        state_attach_puts (_("Problem signature from: "), s); 
     1379        print_smime_keyinfo (sig, key, s); 
     1380        state_attach_puts (_("            expires: "), s); 
     1381        print_time (sig->exp_timestamp, s); 
     1382        state_attach_puts ("\n", s); 
     1383        show_sig_summary (sum, ctx, key, idx, s, sig); 
     1384        anywarn = 1; 
     1385      } 
    13751386 
    13761387      if (key != signature_key)