0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

modules/console: Show conformity and hash and sig reports for event cmd.

This commit is contained in:
Jason Volk 2018-05-11 02:09:09 -07:00
parent 53fedc4c4b
commit 08fd63bf35

View file

@ -2072,6 +2072,28 @@ console_cmd__event(opt &out, const string_view &line)
} }
out << pretty(event) << std::endl; 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; return true;
} }