0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-24 12:58:21 +02:00

ircd:Ⓜ️ Throw better errcode for unverifiable sig; use 403 for failed verify.

This commit is contained in:
Jason Volk 2020-06-07 02:24:49 -07:00
parent 839998e474
commit 7af4e85631
2 changed files with 3 additions and 2 deletions

View file

@ -105,7 +105,7 @@ namespace ircd::m
IRCD_M_EXCEPTION(error, BAD_REQUEST, http::BAD_REQUEST);
IRCD_M_EXCEPTION(error, BAD_JSON, http::BAD_REQUEST);
IRCD_M_EXCEPTION(error, NOT_JSON, http::BAD_REQUEST);
IRCD_M_EXCEPTION(error, BAD_SIGNATURE, http::UNAUTHORIZED);
IRCD_M_EXCEPTION(error, BAD_SIGNATURE, http::FORBIDDEN);
IRCD_M_EXCEPTION(error, ACCESS_DENIED, http::FORBIDDEN);
IRCD_M_EXCEPTION(error, FORBIDDEN, http::FORBIDDEN);
IRCD_M_EXCEPTION(error, NOT_FOUND, http::NOT_FOUND);

View file

@ -476,8 +476,9 @@ catch(const ctx::interrupted &e)
}
catch(const std::exception &e)
{
throw m::BAD_SIGNATURE
throw m::error
{
http::UNAUTHORIZED, "M_UNVERIFIABLE_SIGNATURE",
"%s key %s for %s :%s",
string_view{event.event_id},
keyid,