Commit Graph

224 Commits

Author SHA1 Message Date
Olav Morken 6390db7356 Version 0.9.0. 2014-08-27 15:37:48 +02:00
Olav Morken 0f5b4fd860 Add NEWS-file for 0.9.0. 2014-08-27 15:37:48 +02:00
Olav Morken 7a24e4be0c Fix am_cache_env_fetch_first.
This function is supposed to return the value of the entry we are
looking for, but instead it returned the name. Fix it to return the
value.

Also, fix exit condition on for-loop.

This fixes NameID-based logout.
2014-08-27 15:37:18 +02:00
Olav Morken 22990058be Fix offset calculation for session entries.
The session entry size isn't known on compile time, so we must
actually calculate the offset at runtime.

This fixes a nasty bug where we would randomly overwrite session
entries.
2014-08-27 15:15:35 +02:00
Olav Morken 4062e36456 Move session table initialization into session file.
This moves all the code working on the session table to that file.
2014-08-27 15:15:35 +02:00
Simo Sorce eda061bcc3 Add support for AssertionConsumerServiceURL
Apperently some IdPs like PicketLink insist they reaaaally want to see
AssertionConsumerServiceURL as part of the Authentication Request.

Provide it if allowed by the SP metadata.

Signed-off-by: Simo Sorce <simo@redhat.com>
2014-08-21 13:29:36 +02:00
Olav Morken d1ab7e2d4e Fix access of uninitialized data when logging out.
Since the session data for an unused session isn't initialized,
we may end up reading uninitialized data, leading to a segmentation
fault.
2014-07-03 11:40:53 +02:00
Olav Morken c0e58fc0e2 Use init_cache_size instead of cache_size when clearing session store.
Just make it clear that we should always be using init_cache_size. In
practice this commit doesn't actually affect the program, it just
clarifies the code.
2014-07-03 11:37:10 +02:00
olavmrk a887d8cb3c Update news file and version number for version 0.8.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@238 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-24 08:24:36 +00:00
olavmrk d7c779cdbf Fix memory leak of loaded IdPs.
We free the first element of a linked list, but not the data nor the
subsequent elements. Fix that by first iterating through the list
freeing the elements and then freeing the list using g_list_free().

We could have used g_list_free_full, but that requires version 2.28
of GLib, which is still slightly too recent.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@237 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-24 08:24:29 +00:00
olavmrk 519f22493e Convert session user name to dynamic size storage
Using the previously introduced storage facility convert storage of the
user name from being constrained to fixed sized strings to being
constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@236 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:28 +00:00
olavmrk 5ad49a4c84 Convert session env array to dynamic size storage
Using the previously introduced storage facility convert storage of env
key/value pairs from being constrained to fixed sized strings to being
constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@235 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:22 +00:00
olavmrk e486a708c5 Convert lasso_saml_response to dynamic size storage
Using the previously introduced storage facility converts storage
of lasso_saml_reponse from being constrained to a fixed sized string
to being constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@234 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:16 +00:00
olavmrk f60d394094 Convert lasso_session to dynamic size storage
Using the previously introduced storage facility converts storage
of lasso_session from being constrained to a fixed sized string
to being constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@233 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:02 +00:00
olavmrk f91a46b9b4 Convert lasso_identity to dynamic size storage
Using the previously introduced storage facility converts storage
of lasso_identity from being constrained to a fixed sized string
to being constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@232 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:24:56 +00:00
olavmrk 8dacb03887 Introduce dynamic memory pool for sessions
This pool has a fixed size and the aim is to avoid arbitrary limits
on entry's components, while maintaining an overall fixed entry size.

Accessors function for a storage unit are provided for future use.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@231 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:24:38 +00:00
olavmrk 66f6d2cb08 Compile in C99-mode.
Some of the following patches use features from C99, so make sure that
we are compiling using that version.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@230 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:24:33 +00:00
olavmrk 639c5be4a6 Fix potential NULL Dereference bugs
Found by Coverity

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@229 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-12 06:10:18 +00:00
olavmrk 7d4fb02b30 Add MellonNoSuccessErrorPage to the README-file.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@228 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-04-25 09:11:53 +00:00
olavmrk c7a0d4d8f5 Add a helper to redirect on unauthorized error
In case we are going to return a HTTP_UNAUTHORIZED
error we can also redirect the client to an admin chosen
page to let the application handle the error on its own.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@227 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-04-25 09:11:46 +00:00
olavmrk d1a2b63b74 Handle non successful status posted by the Idp
Idps may decide to deny authentication for a variety of reasons.
In such a case they will post to the application with an unsuccessful
status error code.

Handle the case by returning a more appropriate 401 Unauthorized
HTTP error code.

iDo this using an extensible mechanism to map arbitrary lasso errors
to HTTP errors.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@226 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-04-25 09:11:40 +00:00
olavmrk b5ea9e240e Silence warning
The -Wunused-but-set-variable option will cause a warning that
idp_public_key_file is set but never used when
HAVE_lasso_server_load_metadata is defined.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@225 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-04-25 09:11:35 +00:00
olavmrk 5866c80344 Document caching logic in the README-file.
Thanks to Arthur Müller for providing this patch.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@224 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-02-13 09:05:27 +00:00
olavmrk b88de1e317 Simplify cache disabling headers.
This patch changes the headers sent to prevent errornous caching of the
responses sent to only use a single header:

   Cache-Control: private, must-revalidate

This single header should ensure that the data isn't shared between
multiple users, and that the browser checks that the content is still
valid for each request (enabling logout to work as expected).

This drops the Exires-header, which should be unnecessary since all
modern browsers support the Cache-Control-header.

Thanks to Arthur Müller for providing this patch.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@223 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-02-13 09:05:21 +00:00
olavmrk fae884ae43 Document MellonUser with multi-valued attributes.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@222 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-10-28 07:16:48 +00:00
olavmrk c8c689a9a0 Properly release sessions during logout.
In the case where the error "LASSO_PROFILE_ERROR_SESSION_NOT_FOUND"
occurs during lasso_logout_validate_request(), we weren't releasing
the session mutex, which will lead to a deadlock in the next request
that needs to access a session. This patch makes sure we properly
release session in that case.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@221 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-10-28 06:42:48 +00:00
olavmrk 5b3fbe8147 Fix MellonDoNotVerifyLogoutSignature.
The configuration directive declaration was missing the parameter
describing where the data from the option was stored. The result is
that we access invalid memory during configuration parsing, leading to
a segmentation fault.

As far as I can tell, this error has always been present, so this
option hasn't worked before.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@220 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-10-28 06:42:44 +00:00
olavmrk 6608bb2e1e Add support for reciving HTTP-Artifact responses over POST.
The HTTP-Artifact response is also allowed to be sent as a POST request.
This patch adds support for loading those responses.

Thanks to Nikola Ivačič for implementing this!

git-svn-id: https://modmellon.googlecode.com/svn/trunk@217 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-06-11 05:38:19 +00:00
olavmrk 764a70d1c8 Use default values for SSL peer and host validation.
Recent versions of libcurl do not allow CUROPT_SSL_VERIFYHOST to be
set to 1.

The default in cURL has been to validate both the certificate and the
host since 2002. Setting these options is therefore unnecessary.

Thanks to Nikola Ivačič for notifying us about this problem!

git-svn-id: https://modmellon.googlecode.com/svn/trunk@216 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-06-07 11:47:02 +00:00
olavmrk edd4e78db4 Version 0.7.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@214 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-30 07:45:21 +00:00
olavmrk b3bafde048 NEWS-file for version 0.7.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@213 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-30 07:45:15 +00:00
olavmrk 1f763b6a92 Add auth_mellon_compat.h to .tar.gz.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@212 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-30 07:45:10 +00:00
olavmrk 8f403cc3d5 Add MellonSetEvnNoPrefix option.
This option allows you to set environment variables without the
"MELLON_" prefix.

Thanks to Laas Toom for implementing this!

git-svn-id: https://modmellon.googlecode.com/svn/trunk@211 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-30 07:35:54 +00:00
olavmrk ab738b5a33 Fix typos.
Thanks to Thijs Kinkhorst for providing this patch.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@210 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-21 10:53:30 +00:00
olavmrk f0b539815b Handle empty RelayState the same as missing RelayState.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@209 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-08 12:24:32 +00:00
olavmrk 569ebfaea4 Compatibility helpers for Apache 2.4.
Thansk to Thijs Kinkhorst for identifying the changes that were
necessary!

git-svn-id: https://modmellon.googlecode.com/svn/trunk@208 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-08 12:24:26 +00:00
olavmrk 68d3b04aaa Move GLib compatibility helpers to a separate file.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@207 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-08 12:24:19 +00:00
olavmrk 58c0029c34 Fix am_urldecode handling of encoded slashes.
Apache has fixed a bug/misfeature where
ap_unescape_url_keep2f() decoded %2f-escapes. This leaves us with no
functions that can be used to urldecode strings, so we have to roll
our own.

If we drop support for Apache 2.2, we can use
ap_unescape_urlencoded().

See: http://svn.apache.org/viewvc?view=revision&revision=578332

git-svn-id: https://modmellon.googlecode.com/svn/trunk@206 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-08 12:24:14 +00:00
manu@netbsd.org 1d2c882ba1 Add MellonSPentityId to control entityId in autogenerated metadata
git-svn-id: https://modmellon.googlecode.com/svn/trunk@205 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-04-15 14:54:38 +00:00
olavmrk 0b11c9f3ee Version 0.6.1.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@204 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-22 11:55:05 +00:00
olavmrk 6eca192f66 NEWS file for version 0.6.1
git-svn-id: https://modmellon.googlecode.com/svn/trunk@203 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-22 11:44:07 +00:00
olavmrk daaa6fae37 Redirect the user when missing repost data.
In the case where we are missing the repost data, we currently
display a 400 Bad Request error. This patch changes the code to
redirect to the end URL instead, which at least has a chance to
work.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@202 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-22 11:44:02 +00:00
olavmrk 3f8920c4b5 Fix repost data expiration.
We were mixing microseconds and seconds, causing us to always delete
all the repost data. This patch fixes the comparison, and also
optimizes it a bit.

Thanks to Matthew Slowe for diagnosing this bug!

git-svn-id: https://modmellon.googlecode.com/svn/trunk@201 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-22 11:43:56 +00:00
olavmrk 1e6f81f03a Version 0.6.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@199 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 09:20:37 +00:00
olavmrk b7f159fb01 Update NEWS file.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@198 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 09:08:47 +00:00
olavmrk f1455f5b8a Revert "Revert "Directly link to GLib.""
I accidentally committed a revert that I had done for debugging.

This commit reverts the revert :)

git-svn-id: https://modmellon.googlecode.com/svn/trunk@197 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:50:23 +00:00
olavmrk 67cfd80a61 README: Clarify MellonSPMetadataFile option.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@196 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:20:27 +00:00
olavmrk 66487eb08d Revert "Directly link to GLib."
This reverts commit ee8e7f205d6c7cecdc56491877de88a361e027e3.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@195 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:20:23 +00:00
olavmrk ba7530132d Directly link to GLib.
Instead of relying on the Lasso library including GLib for us,
we should link directly with it.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@194 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:20:19 +00:00
olavmrk ef8bfd5896 Add emacs directory settings.
This sets the default indentation to 4 spaces, and disables tabs.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@193 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:20:13 +00:00