From 08fd63bf3505be146e1347e3ed091b67128580ea Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 11 May 2018 02:09:09 -0700 Subject: [PATCH] modules/console: Show conformity and hash and sig reports for event cmd. --- modules/console.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index 50c152358..b1ca95288 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -2072,6 +2072,28 @@ console_cmd__event(opt &out, const string_view &line) } out << pretty(event) << std::endl; + + const m::event::conforms conforms + { + event + }; + + if(!conforms.clean()) + out << "- " << conforms << std::endl; + + try + { + if(!verify(event)) + out << "- SIGNATURE FAILED" << std::endl; + } + catch(const std::exception &e) + { + out << "- SIGNATURE FAILED: " << e.what() << std::endl; + } + + if(!verify_hash(event)) + out << "- HASH MISMATCH: " << b64encode_unpadded(hash(event)) << std::endl; + return true; }