From 6818f98ae6135e370a57066587ddbe5b3428fc43 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 27 Apr 2020 19:54:54 -0700 Subject: [PATCH] ircd::m::vm: Add missing fault::AUTH exception. --- matrix/vm_execute.cc | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/matrix/vm_execute.cc b/matrix/vm_execute.cc index a0b5512bc..6ec1ea811 100644 --- a/matrix/vm_execute.cc +++ b/matrix/vm_execute.cc @@ -534,7 +534,19 @@ ircd::m::vm::execute_pdu(eval &eval, // Evaluation by auth system; throws if(likely(authenticate)) - room::auth::check_static(event); + { + const auto &[pass, fail] + { + room::auth::check_static(event) + }; + + if(!pass) + throw error + { + fault::AUTH, "Fails against provided auth_events :%s", + what(fail) + }; + } // Obtain sequence number here. const auto *const &top(eval::seqmax()); @@ -559,7 +571,19 @@ ircd::m::vm::execute_pdu(eval &eval, }); if(likely(authenticate)) - room::auth::check_relative(event); + { + const auto &[pass, fail] + { + room::auth::check_relative(event) + }; + + if(!pass) + throw error + { + fault::AUTH, "Fails relative to the state at the event :%s", + what(fail) + }; + } log::debug {