Changeset 5166:e6f958b093b6
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5163
|
r5166
|
|
| | 1 | 2007-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 | |
| | 7 | 2007-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 | |
| 1 | 15 | 2007-05-17 14:40 +0200 Christoph Berg <cb@df7cb.de> (edefe5e1f2b4) |
| 2 | 16 | |
-
|
r4343
|
r5166
|
|
| 40 | 40 | #define ascii_strncmp(a,b,c) mutt_strncmp(a,b,c) |
| 41 | 41 | |
| | 42 | static 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 | |
| 42 | 55 | #endif |
-
|
r5142
|
r5166
|
|
| 761 | 761 | gpgme_sign_result_t result = NULL; |
| 762 | 762 | const char *algorithm_name = NULL; |
| 763 | | |
| 764 | | if (!buflen) |
| | 763 | char *bp; |
| | 764 | |
| | 765 | if (buflen < 5) |
| 765 | 766 | return -1; |
| 766 | 767 | |
| … |
… |
|
| 768 | 769 | result = gpgme_op_sign_result (ctx); |
| 769 | 770 | 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 | } |
| 778 | 780 | |
| 779 | 781 | return *buf? 0:-1; |
| … |
… |
|
| 876 | 878 | mutt_set_parameter ("micalg", buf, &t->parameter); |
| 877 | 879 | else if (use_smime) |
| 878 | | mutt_set_parameter ("micalg", "sha1", &t->parameter); |
| | 880 | mutt_set_parameter ("micalg", "pgp-sha1", &t->parameter); |
| 879 | 881 | gpgme_release (ctx); |
| 880 | 882 | |