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:
parent
53fedc4c4b
commit
08fd63bf35
1 changed files with 22 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue