From a701edd86d8be8eaab8515fdf9a0fe7e1bee2c19 Mon Sep 17 00:00:00 2001 From: Mia Yang <145632982+mia1yang@users.noreply.github.com> Date: Tue, 5 Nov 2024 07:08:19 +0000 Subject: [PATCH] [border-agent] return invalid args when lifetime exceeds 10min (#2567) --- src/dbus/server/dbus_thread_object_rcp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dbus/server/dbus_thread_object_rcp.cpp b/src/dbus/server/dbus_thread_object_rcp.cpp index 19bbbe3975b..d93fec78e82 100644 --- a/src/dbus/server/dbus_thread_object_rcp.cpp +++ b/src/dbus/server/dbus_thread_object_rcp.cpp @@ -2036,6 +2036,7 @@ void DBusThreadObjectRcp::ActivateEphemeralKeyModeHandler(DBusRequest &aRequest) VerifyOrExit(mBorderAgent.GetEphemeralKeyEnabled(), error = OT_ERROR_NOT_CAPABLE); SuccessOrExit(DBusMessageToTuple(*aRequest.GetMessage(), args), error = OT_ERROR_INVALID_ARGS); + VerifyOrExit(lifetime <= OT_BORDER_AGENT_MAX_EPHEMERAL_KEY_TIMEOUT, error = OT_ERROR_INVALID_ARGS); SuccessOrExit(mBorderAgent.CreateEphemeralKey(ePskc), error = OT_ERROR_INVALID_ARGS); otbrLogInfo("Created Ephemeral Key: %s", ePskc.c_str());