Commit Graph

246 Commits

Author SHA1 Message Date
Benjamin Dauvergne d8f39d6867 Fix handling of attribute values
AttributeValue->any can contain any number of MiscTextNode nodes and
MiscTextNode can contain more than text (any XML content). It contains
just text if its property textChild holds TRUE.

The following patch check there is only one MiscTextNode node and that
it is really a text node. In all other cases it reports the fulle value
of the AttributeValue node in the log.
2015-04-07 15:03:49 +02:00
Olav Morken 4b4c63e97e Merge pull request #19 from alexmv/master
Replace newly-added apr_uintptr_t with apr_size_t, for apr < 1.3.0
2015-03-26 10:58:03 +01:00
Alex Vandiver e31dfc79ed Replace newly-added apr_uintptr_t with apr_size_t, for apr < 1.3.0
As per e6f60211; apr_uintptr_t was added in apr 1.3.0.  Switching to
apt_size_t restores compatibility with earlier versions of apr.

Signed-off-by: Alex Vandiver <alex@chmrr.net>
2015-03-26 02:39:14 -04:00
Olav Morken 0c86f8a79a Bump version to 0.10.0. 2014-12-18 11:00:32 +01:00
Olav Morken c320bf5156 Update NEWS-file for version 0.10.0 2014-12-18 10:59:58 +01:00
Olav Morken 03db9ccf91 Include version 0.8.1 in the NEWS-file.
This release was branched from the 0.8.0-release, and was therefore
not included in the NEWS-file for the master-branch.
2014-12-18 10:59:16 +01:00
Olav Morken 3dd7c01926 Use proper cookie parameters when deleting the cookie.
To make sure that the cookie is deleted, we need to use the
same parameters (domain and path) as when we set the cookie.
Update the code to use the new am_cookie_params()-function to
set the parameters when deleting the cookie.
2014-12-18 10:57:16 +01:00
Olav Morken 61b8ca93d4 Extract cookie parameter construction from am_cookie_set().
We need to make sure that we use the same parameters when deleting
the cookie, so create a new function am_cookie_params() that
calculates the parameters.
2014-12-18 10:48:23 +01:00
Olav Morken df751da794 Merge pull request #15 from zandbelt/master
fix spelling error and use a SAML 2.0 compliant entityID
2014-12-17 11:06:01 +01:00
Hans Zandbelt ce46c246a7 fix spelling error and use a SAML 2.0 compliant entityID 2014-12-17 08:49:00 +01:00
Olav Morken 6e8958f831 Merge pull request #13 from jaroslawp/checkpermfix
am_check_permissions() env. variable mapping fix.
2014-11-25 12:58:23 +01:00
Olav Morken f02f4c7c7c Merge pull request #9 from jaroslawp/master
Adding mulitple-valued ENV variables option to mod_auth_mellon
2014-11-25 12:52:52 +01:00
Olav Morken 75f6df7d49 Merge pull request #11 from jaroslawp/bigenvsize
Define environment size spacious enough to hold large number of attributes
2014-11-25 12:42:29 +01:00
Jarek Polok 718fd6a042 am_check_permissions() env. variable mapping fix. 2014-11-16 11:08:19 +01:00
Jarek Polok 1d61071f18 Adding MellonMergeEnvVars (optional) functionality
Allows to concatenate env. variables values
in single variable name, ie:

VAR=val1;val2;val3;...

instead of standard mod_auth_mellom behaviour:

VAR=val1
VAR_0=val1
VAR_1=val2
VAR_2=val3
...
2014-11-13 19:39:59 +01:00
Jarek Polok d133a1c50d Define envirnment size spacious enough to hold large number of attributes. 2014-11-13 13:11:57 +01:00
Olav Morken 84f42435bd Remove redundant semicolon. 2014-10-29 07:40:24 +01:00
Olav Morken 47a767d5f3 Ensure that all generated session IDs are cryptographically strong.
We used to call RAND_pseudo_bytes, which will generate cryptographically
strong random bytes in most cases. Under memory pressure or other error
conditions, it can return weak random bytes.

It is unlikely that there is a way for an attacker to set up a condition
where the user is sucessfully logged in but receives a weak session
identifier, but to be safe, we switch to RAND_bytes.
2014-09-11 15:51:32 +02:00
Olav Morken d8649e8afc Version 0.9.1. 2014-09-01 10:12:09 +02:00
Olav Morken bd3e53e55d NEWS-file for 0.9.1. 2014-09-01 10:11:54 +02:00
Olav Morken 4d619e3b7c Fix session offset bug with creating new session.
When fixing the session offset calculation in 22990058be, I forgot
to update the logic for creating the new session. The result is that
the code for creating new sessions use a different logic for
calculating the session offset than the code for looking up sessions.

This in turn means that we can only have a single session.
2014-09-01 10:07:21 +02:00
Olav Morken d97f451eb2 Make Apache run our handler hook earlier.
The mod_auth_mellon hook is designed to handle requests to
MellonEndpointPath rather than looking at r->handler.

If we are unlucky, a different handler hook may look at r->handler,
and decide that the request is meant for it instead of mod_auth_mellon.

This patch makes the mod_auth_mellon hook run before most other hooks.

A workaround is to add something like this to the Apache configuration:

<Location /mellon>
  SetHandler mod_auth_mellon
</Location
2014-08-29 09:33:50 +02:00
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