From: Vsevolod Stakhov Date: Mon, 24 Sep 2018 11:49:03 +0000 (+0100) Subject: [Minor] Fix rawkey loading in arc module X-Git-Tag: 1.8.0~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f85f97bfddc543cf211b94ec5784fd2c61832ac9;p=thirdparty%2Frspamd.git [Minor] Fix rawkey loading in arc module --- diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index ebc3ac280e..bf6010c3fd 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -394,13 +394,19 @@ local function arc_sign_seal(task, params, header) local privkey if params.rawkey then - privkey = rspamd_rsa_privkey.load_pem(params.rawkey) + -- Distinguish between pem and base64 + if string.match(params.rawkey, '^-----BEGIN') then + privkey = rspamd_rsa_privkey.load_pem(params.rawkey) + else + privkey = rspamd_rsa_privkey.load_base64(params.rawkey) + end elseif params.key then privkey = rspamd_rsa_privkey.load_file(params.key) end if not privkey then rspamd_logger.errx(task, 'cannot load private key for signing') + return end if settings.reuse_auth_results then