Changeset 5166:e6f958b093b6

Show
Ignore:
Timestamp:
2007-06-09 19:58:22 (18 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Make GPGME backend generate a RFC3156-compliant micalg parameter
(blush). Based on a patch by Stefan Haun. Closes #2901.

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5163 r5166  
     12007-06-09 01:03 +0200  Thomas Roessler  <roessler@does-not-exist.org>  (53e5e1105fd2) 
     2 
     3        * sendlib.c: remove unnecessary dprints 
     4 
     5        * sendlib.c: Fix header encoding corner case. 
     6 
     72007-06-05 13:12 -0700  pywatson  <pywatson@gmail.com>  (9e90789518ad) 
     8 
     9        * ChangeLog, sort.c: Make sort by "To" stable (closes #2515). 
     10        compare_to() calls mutt_get_name(), which may return a static 
     11        pointer if it in turn calls mutt_addr_for_display(). If this static 
     12        pointer is used for a and b, the result is bad. The fix is to make a 
     13        copy of the first object. 
     14 
    1152007-05-17 14:40 +0200  Christoph Berg  <cb@df7cb.de>  (edefe5e1f2b4) 
    216 
  • ascii.h

    r4343 r5166  
    4040#define ascii_strncmp(a,b,c) mutt_strncmp(a,b,c) 
    4141 
     42static inline char* ascii_strlower (char *s) 
     43{ 
     44  char *p = s; 
     45 
     46  while (*p) 
     47  { 
     48    *p = ascii_tolower ((unsigned int) *p); 
     49    p++; 
     50  } 
     51 
     52  return s; 
     53} 
     54 
    4255#endif 
  • crypt-gpgme.c

    r5142 r5166  
    761761  gpgme_sign_result_t result = NULL; 
    762762  const char *algorithm_name = NULL; 
    763  
    764   if (!buflen) 
     763  char *bp; 
     764 
     765  if (buflen < 5) 
    765766    return -1; 
    766767 
     
    768769  result = gpgme_op_sign_result (ctx); 
    769770  if (result && result->signatures) 
    770     { 
    771       algorithm_name = gpgme_hash_algo_name (result->signatures->hash_algo); 
    772       if (algorithm_name) 
    773         { 
    774           strncpy (buf, algorithm_name, buflen - 1); 
    775           buf[buflen - 1] = 0; 
    776         } 
    777     } 
     771  { 
     772    algorithm_name = gpgme_hash_algo_name (result->signatures->hash_algo); 
     773    if (algorithm_name) 
     774    { 
     775      /* convert GPGME raw hash name to RFC 3156 format */ 
     776      snprintf (buf, buflen, "pgp-%s", algorithm_name); 
     777      ascii_strlower (buf + 4); 
     778    } 
     779  } 
    778780 
    779781  return *buf? 0:-1; 
     
    876878    mutt_set_parameter ("micalg", buf, &t->parameter); 
    877879  else if (use_smime) 
    878     mutt_set_parameter ("micalg", "sha1", &t->parameter); 
     880    mutt_set_parameter ("micalg", "pgp-sha1", &t->parameter); 
    879881  gpgme_release (ctx); 
    880882