aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/rspamadm
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-04 10:52:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-04 10:52:49 +0000
commit1473bfa1efef8b4117bc48e4b0b24c10b8846619 (patch)
treea55af1a9803b1523ba8871265601f545328ff983 /lualib/rspamadm
parent13e8a07177e7fbf6e02b447176fa9ec20f505490 (diff)
downloadrspamd-1473bfa1efef8b4117bc48e4b0b24c10b8846619.tar.gz
rspamd-1473bfa1efef8b4117bc48e4b0b24c10b8846619.zip
[Minor] Allow to print timestamp
Diffstat (limited to 'lualib/rspamadm')
-rw-r--r--lualib/rspamadm/cookie.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/lualib/rspamadm/cookie.lua b/lualib/rspamadm/cookie.lua
index d6db58a63..b9995cdf9 100644
--- a/lualib/rspamadm/cookie.lua
+++ b/lualib/rspamadm/cookie.lua
@@ -36,6 +36,8 @@ parser:option "-d --domain"
:argname "<domain>"
parser:flag "-D --decrypt"
:description('Decrypt cookie instead of encrypting one')
+parser:flag "-t --timestamp"
+ :description('Show cookie timestamp (valid for decrypting only)')
parser:argument "cookie":args "?"
:description('Use specified cookie')
@@ -65,10 +67,14 @@ local function gen_cookie(args, key)
extracted_cookie = args.cookie
end
- local dec_cookie = cr.decrypt_cookie(key, extracted_cookie)
+ local dec_cookie,ts = cr.decrypt_cookie(key, extracted_cookie)
if dec_cookie then
- print(dec_cookie)
+ if args.timestamp then
+ print(string.format('%s %s', dec_cookie, ts))
+ else
+ print(dec_cookie)
+ end
else
print('cannot decrypt cookie')
os.exit(1)