fix bug 2960, 'rfc3156 deviation regarding hash symbols'
authorPaul <paul@claws-mail.org>
Fri, 12 Jul 2013 07:13:12 +0000 (08:13 +0100)
committerPaul <paul@claws-mail.org>
Fri, 12 Jul 2013 07:13:12 +0000 (08:13 +0100)
make micalg value lowercase as per RFC 3156

src/plugins/pgpmime/pgpmime.c
src/plugins/smime/smime.c

index a54e527ba46546460dd0c67f13999f9de4d93c91..30cf0431484629360b7410c7f459a913f3aa67d0 100644 (file)
@@ -553,8 +553,8 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
        if (result && result->signatures) {
                gpgme_new_signature_t sig = result->signatures;
                if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
        if (result && result->signatures) {
                gpgme_new_signature_t sig = result->signatures;
                if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
-                       micalg = g_strdup_printf("PGP-%s", gpgme_hash_algo_name(
-                               result->signatures->hash_algo));
+                       micalg = g_strdup_printf("pgp-%s", g_ascii_strdown(gpgme_hash_algo_name(
+                               result->signatures->hash_algo),-1));
                } else {
                        micalg = g_strdup(gpgme_hash_algo_name(
                                result->signatures->hash_algo));
                } else {
                        micalg = g_strdup(gpgme_hash_algo_name(
                                result->signatures->hash_algo));
index 0a8ac534e46d4a54fc0fb2517d2f99902428640a..07e2345875212d2516987ad77fc61eabede064b4 100644 (file)
@@ -629,8 +629,8 @@ gboolean smime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from
        result = gpgme_op_sign_result(ctx);
        if (result && result->signatures) {
            if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
        result = gpgme_op_sign_result(ctx);
        if (result && result->signatures) {
            if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
-               micalg = g_strdup_printf("PGP-%s", gpgme_hash_algo_name(
-                           result->signatures->hash_algo));
+               micalg = g_strdup_printf("pgp-%s", g_ascii_strdown(gpgme_hash_algo_name(
+                           result->signatures->hash_algo),-1));
            } else {
                micalg = g_strdup(gpgme_hash_algo_name(
                            result->signatures->hash_algo));
            } else {
                micalg = g_strdup(gpgme_hash_algo_name(
                            result->signatures->hash_algo));