From c83f820e7f58b2a8983b6d2e7475b20b3ef81488 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 12 May 2020 00:13:24 -0700 Subject: [PATCH] ircd::m::vm: Add missing phase indication during verify. --- matrix/vm_execute.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/matrix/vm_execute.cc b/matrix/vm_execute.cc index 9f3581ae4..e0886c8bd 100644 --- a/matrix/vm_execute.cc +++ b/matrix/vm_execute.cc @@ -602,12 +602,20 @@ ircd::m::vm::execute_pdu(eval &eval, call_hook(access_hook, eval, event, eval); } - if(likely(opts.phase[phase::VERIFY]) && unlikely(!verify(event))) - throw m::BAD_SIGNATURE + if(likely(opts.phase[phase::VERIFY])) + { + const scope_restore eval_phase { - "Signature verification failed." + eval.phase, phase::VERIFY }; + if(unlikely(!verify(event))) + throw m::BAD_SIGNATURE + { + "Signature verification failed." + }; + } + if(likely(opts.phase[phase::FETCH_AUTH] && opts.fetch)) { const scope_restore eval_phase