Merge ~dmitriis/ubuntu/+source/lasso:1833299-devel-paos-ecp-destination into ubuntu/+source/lasso:ubuntu/devel

Proposed by Dmitrii Shcherbakov
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 09eb392c8ce954aaed01a022e4a9ee28ab236443
Merge reported by: Christian Ehrhardt 
Merged at revision: 09eb392c8ce954aaed01a022e4a9ee28ab236443
Proposed branch: ~dmitriis/ubuntu/+source/lasso:1833299-devel-paos-ecp-destination
Merge into: ubuntu/+source/lasso:ubuntu/devel
Diff against target: 120 lines (+101/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/PAOS-Do-not-populate-Destination-attribute.patch (+93/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+369735@code.launchpad.net
To post a comment you must log in.
09eb392... by Dmitrii Shcherbakov

PAOS: Do not populate "Destination" attribute

When ECP profile (saml-ecp-v2.0-cs01) is used with PAOS binding Lasso
populates an AuthnRequest with the "Destination" attribute set to
AssertionConsumerURL of an SP - this leads to IdP-side errors because
the destination attribute in the request does not match the IdP URL.

The "Destination" attribute is mandatory only for HTTP Redirect and HTTP
Post bindings when AuthRequests are signed per saml-bindings-2.0-os
(sections 3.4.5.2 and 3.5.5.2). Specifically for PAOS it makes sense to
avoid setting that optional attribute because an ECP decides which IdP
to use, not the SP.

This patch was merged upstream: https://dev.entrouvert.org/issues/34409

New changelog entries:

* d/p/PAOS-Do-not-populate-Destination-attribute.patch: Do not populate
  "Destination" attribute (LP: #1833299)

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for adding the requested details, e.g. SRU template.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Note a few things for further improvements of such MPs in the future:
- The target release should obviously not be "UNRELEASED"
- One (of many) reasons for "git ubuntu" is to ease rebases for new merges.
  To do that changelog and other commits should be separate.

I fixed those up for you on sponsoring for now ...
Tagged and sponsored into Eoan

Test built all (fixed up) builds in PPA https://launchpad.net/~paelzer/+archive/ubuntu/bug-1833299-testbuilds-before-sponsor-lasso

tag: upload/2.6.0-2ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 7770a57..9067135 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+lasso (2.6.0-2ubuntu1) UNRELEASED; urgency=high
7+
8+ * d/p/PAOS-Do-not-populate-Destination-attribute.patch: Do not populate
9+ "Destination" attribute (LP: #1833299)
10+
11+ -- Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com> Thu, 04 Jul 2019 18:42:56 -0500
12+
13 lasso (2.6.0-2build1) disco; urgency=medium
14
15 * No-change rebuild to build without python3.6 support.
16diff --git a/debian/patches/PAOS-Do-not-populate-Destination-attribute.patch b/debian/patches/PAOS-Do-not-populate-Destination-attribute.patch
17new file mode 100644
18index 0000000..3594f81
19--- /dev/null
20+++ b/debian/patches/PAOS-Do-not-populate-Destination-attribute.patch
21@@ -0,0 +1,93 @@
22+Description: PAOS: Do not populate "Destination" attribute
23+ When ECP profile (saml-ecp-v2.0-cs01) is used with PAOS binding Lasso
24+ populates an AuthnRequest with the "Destination" attribute set to
25+ AssertionConsumerURL of an SP - this leads to IdP-side errors because
26+ the destination attribute in the request does not match the IdP URL.
27+
28+ The "Destination" attribute is mandatory only for HTTP Redirect and HTTP
29+ Post bindings when AuthRequests are signed per saml-bindings-2.0-os
30+ (sections 3.4.5.2 and 3.5.5.2). Specifically for PAOS it makes sense to
31+ avoid setting that optional attribute because an ECP decides which IdP
32+ to use, not the SP.
33+Author: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
34+Origin: upstream, https://repos.entrouvert.org/lasso.git/commit/?id=1e85f1b2bd30c0d93b4a2ef37b35abeae3d15b56
35+Bug: https://dev.entrouvert.org/issues/34409
36+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lasso/+bug/1833299
37+Applied-Upstream: https://repos.entrouvert.org/lasso.git/commit/?id=1e85f1b2bd30c0d93b4a2ef37b35abeae3d15b56
38+Reviewed-by: Benjamin Dauvergne <bdauvergne@entrouvert.com>
39+Reviewed-by: John Dennis <jdennis@redhat.com>
40+Last-Update: 2019-07-06
41+---
42+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
43+Index: lasso/lasso/saml-2.0/login.c
44+===================================================================
45+--- lasso.orig/lasso/saml-2.0/login.c
46++++ lasso/lasso/saml-2.0/login.c
47+@@ -222,7 +222,7 @@ _lasso_login_must_verify_signature(Lasso
48+ gint
49+ lasso_saml20_login_build_authn_request_msg(LassoLogin *login)
50+ {
51+- char *url = NULL;
52++ char *assertionConsumerServiceURL = NULL;
53+ gboolean must_sign = TRUE;
54+ LassoProfile *profile;
55+ LassoSamlp2AuthnRequest *authn_request;
56+@@ -247,29 +247,29 @@ lasso_saml20_login_build_authn_request_m
57+ }
58+
59+ if (login->http_method == LASSO_HTTP_METHOD_PAOS) {
60+-
61+ /*
62+ * PAOS is special, the url passed to build_request is the
63+ * AssertionConsumerServiceURL of this SP, not the
64+- * destination.
65++ * destination IdP URL. This is done to fill paos:responseConsumerURL
66++ * appropriately down the line in build_request_msg.
67++ * See https://dev.entrouvert.org/issues/34409 for more information.
68+ */
69+ if (authn_request->AssertionConsumerServiceURL) {
70+- url = authn_request->AssertionConsumerServiceURL;
71++ assertionConsumerServiceURL = authn_request->AssertionConsumerServiceURL;
72+ if (!lasso_saml20_provider_check_assertion_consumer_service_url(
73+- LASSO_PROVIDER(profile->server), url, LASSO_SAML2_METADATA_BINDING_PAOS)) {
74++ LASSO_PROVIDER(profile->server), assertionConsumerServiceURL, LASSO_SAML2_METADATA_BINDING_PAOS)) {
75+ rc = LASSO_PROFILE_ERROR_INVALID_REQUEST;
76+ goto cleanup;
77+ }
78+ } else {
79+- url = lasso_saml20_provider_get_assertion_consumer_service_url_by_binding(
80++ assertionConsumerServiceURL = lasso_saml20_provider_get_assertion_consumer_service_url_by_binding(
81+ LASSO_PROVIDER(profile->server), LASSO_SAML2_METADATA_BINDING_PAOS);
82+- lasso_assign_new_string(authn_request->AssertionConsumerServiceURL, url);
83++ lasso_assign_new_string(authn_request->AssertionConsumerServiceURL, assertionConsumerServiceURL);
84+ }
85+ }
86+
87+-
88+ lasso_check_good_rc(lasso_saml20_profile_build_request_msg(profile, "SingleSignOnService",
89+- login->http_method, url));
90++ login->http_method, assertionConsumerServiceURL));
91+
92+ cleanup:
93+ return rc;
94+Index: lasso/lasso/saml-2.0/profile.c
95+===================================================================
96+--- lasso.orig/lasso/saml-2.0/profile.c
97++++ lasso/lasso/saml-2.0/profile.c
98+@@ -967,7 +967,15 @@ lasso_saml20_profile_build_request_msg(L
99+ made_url = url = get_url(provider, service, http_method_to_binding(method));
100+ }
101+
102+- if (url) {
103++
104++ // Usage of the Destination attribute on a request is mandated only
105++ // in "3.4.5.2" and "3.5.5.2" in saml-bindings-2.0-os for signed requests
106++ // and is marked as optional in the XSD schema otherwise.
107++ // PAOS is a special case because an SP does not select an IdP - ECP does
108++ // it instead. Therefore, this attribute needs to be left unpopulated.
109++ if (method == LASSO_HTTP_METHOD_PAOS) {
110++ lasso_release_string(((LassoSamlp2RequestAbstract*)profile->request)->Destination);
111++ } else if (url) {
112+ lasso_assign_string(((LassoSamlp2RequestAbstract*)profile->request)->Destination,
113+ url);
114+ } else {
115diff --git a/debian/patches/series b/debian/patches/series
116index e69de29..fface8c 100644
117--- a/debian/patches/series
118+++ b/debian/patches/series
119@@ -0,0 +1 @@
120+PAOS-Do-not-populate-Destination-attribute.patch

Subscribers

People subscribed via source and target branches