diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-18 15:24:03 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-18 15:24:03 +0100 |
commit | 96acdaae8b1dc1839052df3b97526adfca8f64f5 (patch) | |
tree | 0ef04c4523a560e2813c719530bc0af350c6486b /src | |
parent | d4f85c4197a01df4a79e2952af90dec1769daff1 (diff) | |
download | rspamd-96acdaae8b1dc1839052df3b97526adfca8f64f5.tar.gz rspamd-96acdaae8b1dc1839052df3b97526adfca8f64f5.zip |
[Fix] Update ed25519 signing schema
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/dkim.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index dd4f5d183..44a0b5960 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -275,6 +275,7 @@ rspamd_dkim_parse_signalg (rspamd_dkim_context_t * ctx, gsize len, GError **err) { + /* XXX: ugly size comparison, improve this code style some day */ if (len == 8) { if (memcmp (param, "rsa-sha1", len) == 0) { ctx->sig_alg = DKIM_SIGN_RSASHA1; @@ -291,7 +292,7 @@ rspamd_dkim_parse_signalg (rspamd_dkim_context_t * ctx, return TRUE; } } - else if (len == sizeof ("ecdsa256-sha256") - 1) { + else if (len == 15) { if (memcmp (param, "ecdsa256-sha256", len) == 0) { ctx->sig_alg = DKIM_SIGN_ECDSASHA256; return TRUE; @@ -301,8 +302,8 @@ rspamd_dkim_parse_signalg (rspamd_dkim_context_t * ctx, return TRUE; } } - else if (len == sizeof ("ed25519") - 1) { - if (memcmp (param, "ed25519", len) == 0) { + else if (len == 14) { + if (memcmp (param, "ed25519-sha256", len) == 0) { ctx->sig_alg = DKIM_SIGN_EDDSASHA256; return TRUE; } |