]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix "invalid key algorithm" warning
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 May 2018 13:34:04 +0000 (14:34 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 May 2018 13:34:04 +0000 (14:34 +0100)
src/libserver/dkim.c

index a51399a313dbd1ebbc11b1b8a7f2ea95fcd6a070..5af61daf75c90e8298029c4f80868bcfa7704252 100644 (file)
@@ -1430,6 +1430,7 @@ rspamd_dkim_parse_key (rspamd_dkim_context_t *ctx, const gchar *txt,
 
        if (alglen == 0 || alg == NULL) {
                alg = "rsa"; /* Implicit */
+               alglen = 3;
        }
 
        if (alglen == 8 && rspamd_lc_cmp (alg, "ecdsa256", alglen) == 0) {
@@ -1445,6 +1446,7 @@ rspamd_dkim_parse_key (rspamd_dkim_context_t *ctx, const gchar *txt,
                if (alglen != 3 || rspamd_lc_cmp (alg, "rsa", alglen) != 0) {
                        msg_info_dkim ("invalid key algorithm: %*s", (gint)alglen, alg);
                }
+
                return rspamd_dkim_make_key (ctx, c, klen,
                                RSPAMD_DKIM_KEY_RSA, err);
        }