[cpp-sp] branch main updated: Guard unwrapping of responses in case of incompleteness.
Codeberg
noreply at shibboleth.net
Tue May 26 15:21:49 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository cpp-sp.
View the commit online:
https://codeberg.org/Shibboleth/cpp-sp/commit/a88d3605a3f0073f3f7e66f9ae635598ba683fcd
The following commit(s) were added to refs/heads/main by this push:
new a88d3605 Guard unwrapping of responses in case of incompleteness.
a88d3605 is described below
commit a88d3605a3f0073f3f7e66f9ae635598ba683fcd
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue May 26 11:20:03 2026 -0400
Guard unwrapping of responses in case of incompleteness.
---
shibsp/handler/impl/LogoutConsumer.cpp | 5 ++++-
shibsp/handler/impl/LogoutInitiator.cpp | 6 +++++-
shibsp/handler/impl/Passthrough.cpp | 6 +++++-
shibsp/handler/impl/SessionInitiator.cpp | 6 +++++-
shibsp/handler/impl/TokenConsumer.cpp | 6 +++++-
5 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/shibsp/handler/impl/LogoutConsumer.cpp b/shibsp/handler/impl/LogoutConsumer.cpp
index f09dcf5f..5eeaddb2 100644
--- a/shibsp/handler/impl/LogoutConsumer.cpp
+++ b/shibsp/handler/impl/LogoutConsumer.cpp
@@ -221,7 +221,10 @@ pair <bool,long> LogoutConsumer::completeLogout(SPRequest& request, bool removeS
DDF wrapped = output.getmember("http");
if (wrapped.isstruct()) {
- return unwrapResponse(request, wrapped, true);
+ pair<bool,long> ret = unwrapResponse(request, wrapped, true);
+ if (ret.first) {
+ return ret;
+ }
}
const char* dest = output.getmember("target").string();
diff --git a/shibsp/handler/impl/LogoutInitiator.cpp b/shibsp/handler/impl/LogoutInitiator.cpp
index bc485df0..9d75dea7 100644
--- a/shibsp/handler/impl/LogoutInitiator.cpp
+++ b/shibsp/handler/impl/LogoutInitiator.cpp
@@ -102,7 +102,11 @@ pair<bool,long> LogoutInitiator::run(SPRequest& request, bool isHandler) const
try {
DDF output = request.getAgent().getRemotingService()->send(input);
DDFJanitor outputJanitor(output);
- return unwrapResponse(request, output);
+ pair<bool,long> ret = unwrapResponse(request, output);
+ if (ret.first) {
+ return ret;
+ }
+ throw AgentException("Wrapped response from Hub did not complete successfully.");
}
catch (exception& ex) {
AgentException* agent_ex = dynamic_cast<AgentException*>(&ex);
diff --git a/shibsp/handler/impl/Passthrough.cpp b/shibsp/handler/impl/Passthrough.cpp
index 6526f968..14008f03 100644
--- a/shibsp/handler/impl/Passthrough.cpp
+++ b/shibsp/handler/impl/Passthrough.cpp
@@ -96,7 +96,11 @@ pair<bool,long> Passthrough::run(SPRequest& request, bool isHandler) const
DDF output = request.getAgent().getRemotingService()->send(input);
DDFJanitor outputJanitor(output);
- return unwrapResponse(request, output, m_limitRedirects);
+ pair<bool,long> ret = unwrapResponse(request, output, m_limitRedirects);
+ if (ret.first) {
+ return ret;
+ }
+ throw AgentException("Wrapped response from Hub did not complete successfully.");
}
catch (exception& ex) {
AgentException* agent_ex = dynamic_cast<AgentException*>(&ex);
diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp
index 0481e50c..a6efb4c0 100644
--- a/shibsp/handler/impl/SessionInitiator.cpp
+++ b/shibsp/handler/impl/SessionInitiator.cpp
@@ -204,7 +204,11 @@ pair<bool,long> SessionInitiator::run(SPRequest& request, bool isHandler) const
DDF output = request.getAgent().getRemotingService()->send(input);
DDFJanitor outputJanitor(output);
- return unwrapResponse(request, output);
+ pair<bool,long> ret = unwrapResponse(request, output);
+ if (ret.first) {
+ return ret;
+ }
+ throw AgentException("Wrapped response from Hub did not complete successfully.");
}
catch (exception& ex) {
AgentException* agent_ex = dynamic_cast<AgentException*>(&ex);
diff --git a/shibsp/handler/impl/TokenConsumer.cpp b/shibsp/handler/impl/TokenConsumer.cpp
index f4d78331..809c63cb 100644
--- a/shibsp/handler/impl/TokenConsumer.cpp
+++ b/shibsp/handler/impl/TokenConsumer.cpp
@@ -206,7 +206,11 @@ pair<bool,long> TokenConsumer::run(SPRequest& request, bool isHandler) const
}
// Handles all normal cases, including POST recovery.
- return unwrapResponse(request, output, true);
+ pair<bool,long> ret = unwrapResponse(request, output, true);
+ if (ret.first) {
+ return ret;
+ }
+ throw AgentException("Wrapped response from Hub did not complete successfully.");
}
catch (exception& ex) {
AgentException* agent_ex = dynamic_cast<AgentException*>(&ex);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list