From d1a5930ba9f385c651a30dbc19244ca39313cc0a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 15 Apr 2020 17:28:22 -0700 Subject: [PATCH] modules/client/login: Fix for fully qualified requested device_id; verify hostpart. --- modules/client/login.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/client/login.cc b/modules/client/login.cc index 7fa9c7e56..96abe54e0 100644 --- a/modules/client/login.cc +++ b/modules/client/login.cc @@ -114,11 +114,19 @@ post__login_password(client &client, const auto device_id { + valid(m::id::DEVICE, requested_device_id)? + m::id::device::buf{requested_device_id}: requested_device_id? m::id::device::buf{requested_device_id, my_host()}: m::id::device::buf{m::id::generate, my_host()} }; + if(!my(device_id)) + throw m::UNSUPPORTED + { + "Device ID's with foreign hostparts are not supported." + }; + char access_token_buf[32]; const string_view access_token {