0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd::resource: Improve X-Matrix destination host check.

This commit is contained in:
Jason Volk 2019-02-04 23:16:27 -08:00
parent 03cb4a613b
commit 5f759a617c

View file

@ -609,6 +609,13 @@ const try
"Required X-Matrix Authorization was not supplied"
};
if(!m::my_host(request.head.host))
throw m::error
{
http::UNAUTHORIZED, "M_NOT_MY_HOST",
"The X-Matrix Authorization destination host is not recognized here."
};
const m::request::x_matrix x_matrix
{
request.head.authorization
@ -616,7 +623,7 @@ const try
const m::request object
{
x_matrix.origin, my_host(), name, request.head.uri, request.content
x_matrix.origin, request.head.host, name, request.head.uri, request.content
};
if(!object.verify(x_matrix.key, x_matrix.sig))