From f2553220b6e2f53dd127374631edfa7f549c5845 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 11 Mar 2021 11:45:39 -0500 Subject: [PATCH] Implement xop::Authenticator::GetFailedResponse to return a 401 --- dep/RtspServer | 2 +- src/zm_rtsp_server_authenticator.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dep/RtspServer b/dep/RtspServer index 75c20b450..20846b25f 160000 --- a/dep/RtspServer +++ b/dep/RtspServer @@ -1 +1 @@ -Subproject commit 75c20b450fdf00c120b9a917f48abd96095b665b +Subproject commit 20846b25ffc0c9a1de1b6701ca99425ef39e9f3f diff --git a/src/zm_rtsp_server_authenticator.h b/src/zm_rtsp_server_authenticator.h index a1b2a5c45..55a7784e7 100644 --- a/src/zm_rtsp_server_authenticator.h +++ b/src/zm_rtsp_server_authenticator.h @@ -17,7 +17,7 @@ class ZM_RtspServer_Authenticator : public xop::Authenticator { ZM_RtspServer_Authenticator() {}; ~ZM_RtspServer_Authenticator() {}; - virtual bool Authenticate(std::shared_ptr request, std::string &nonce) { + bool Authenticate(std::shared_ptr request, std::string &nonce) { if (!config.opt_use_auth) { Debug(1, "Not doing auth"); @@ -77,6 +77,14 @@ class ZM_RtspServer_Authenticator : public xop::Authenticator { } return false; } + + size_t GetFailedResponse( + std::shared_ptr request, + std::shared_ptr buf, + size_t size) { + return request->BuildUnauthorizedRes(buf.get(), size); + } + }; // end class ZM_RtspServer_Authenticator #endif // HAVE_RTSP_SERVER