Commit Graph

438 Commits

Author SHA1 Message Date
Olav Morken 0d52e1d960 Handle memory allocation failure when retrieving POST data. 2016-03-07 09:35:04 +01:00
Olav Morken ccb7dc35b9 Merge pull request #71 from vrasneur/am_read_post_data-segfault
Handle ap_get_client_block() error in am_read_post_data()
2016-03-02 17:27:25 +01:00
vrasneur 5f03a632c9 Handle ap_get_client_block() error in am_read_post_data() 2016-03-02 16:43:55 +01:00
Olav Morken 9d28908e28 Add MellonRedirectDomains option.
Limit the domains that we will redirect to after login / logout to a
set of trusted domains. By default we only allow redirects to the
current domain.

This change breaks backwards compatibility with any site that relies on
redirects to separate domains.

Fixes #35
2015-12-11 11:32:03 +01:00
Olav Morken 98e89b6fbe Merge pull request #55 from jdennis/paos-options
Support ECP service options in PAOS request
2015-11-10 16:49:17 +01:00
John Dennis d300d3abcf Support ECP service options in PAOS request
The OASIS specification "SAML V2.0 Enhanced Client or Proxy Profile
Version 2.0" added ECP service options into the HTTP PAOS header. We
previously were not looking for these optional flags. The function
am_validate_paos_header() was rewritten to correctly parse the service
value and the optional URN flags and return a bitmask of the ECP
service flags.

The following flags were added:

  * ECP_SERVICE_OPTION_CHANNEL_BINDING
  * ECP_SERVICE_OPTION_HOLDER_OF_KEY
  * ECP_SERVICE_OPTION_WANT_AUTHN_SIGNED
  * ECP_SERVICE_OPTION_DELEGATION

The flags are stored in the am_req_cfg_rec.ecp_service_options member.

Currently only the want_authn_signed option is acted upon, it sets the
lasso signature hint when generating a AuthnRequest.

Lasso as of 2.5.0 is missing 3 of the URN flag identifier constants, a
patch was submitted to upstream Lasso to include them and was
accepted. As a fallback they are conditionally added to lasso_compat.h
in case the version of lasso this is compiled against does not yet
have the new constants.

The function am_is_paos_request() was modified to return an error.
New error codes were added to auth_mellon.h.

New utility code to tokenize a string was added. This is used to
parse the PAOS header, primarily to handle quoted strings.

A new utility routine, *am_ecp_service_options_str() was added so log
messages could include the ECP service option flags in their output.

Signed-off-by: John Dennis <jdennis@redhat.com>
2015-11-10 09:13:18 -05:00
Olav Morken a26ea12fca Fix links to mailing list.
We have moved our mailing list to a new server. Fix the links.

Fixes issue 57.
2015-11-10 11:05:23 +01:00
Olav Morken 5ca0024473 Merge pull request #58 from UNINETT/check_build_warnings
Check build warnings
2015-11-10 11:02:57 +01:00
Olav Morken a0bdfb9129 Travis: Fail build on warnings.
This may be a bit strict, but let us try. We don't want to miss warnings
that may have security implications.
2015-11-10 10:56:35 +01:00
Olav Morken f482a9cd84 autoconf: Pass CFLAGS from configure to apxs.
To allow the user to specify CFLAGS in configure, add the CFLAGS macro
to the generated `apxs` command line. This allows us to run things like:

    ./configure CFLAGS=-Werror
2015-11-10 10:56:35 +01:00
Olav Morken 21f4acf27e Merge pull request #56 from jdennis/acs-provider
Role maybe unknown when assertion consumer url is looked up
2015-11-05 16:59:57 +01:00
Olav Morken fe81ac2792 Merge pull request #53 from thijskh/master
Some trivial typo fixes
2015-11-05 16:57:07 +01:00
John Dennis 5ba9bb7270 Role maybe unknown when assertion consumer url is looked up
Replace the call to lasso_provider_get_metadata_one() with
lasso_provider_get_metadata_one_for_role() so that we can exlicitly
pass the LASSO_PROVIDER_ROLE_SP role. The former call obtains the
role from the provider object and then calls
lasso_provider_get_metadata_one_for_role() using that role. However
the role will not have been set in the provider until the first request is
processed. This means the first time we call this routine it won't
work correctly because the role will not have been set yet, by
explicitly passing the role we avoid this problem.

Signed-off-by: John Dennis <jdennis@redhat.com>
2015-10-30 15:46:33 -04:00
Thijs Kinkhorst c2612d5113 Some trivial typo fixes 2015-09-18 14:40:34 +00:00
Olav Morken cee415cfe1 Version 0.11.0. 2015-09-16 16:29:32 +02:00
Olav Morken 141bc62c42 Update NEWS. 2015-09-16 16:01:42 +02:00
Olav Morken 54439c21d7 Merge pull request #52 from jokajak/patch-1
Fix minor typo in README
2015-09-16 16:00:20 +02:00
Olav Morken c6123bf9f1 Merge pull request #50 from jdennis/ecp
Add support for SAML ECP.
2015-09-16 15:59:03 +02:00
Josh e987302761 Fix minor typo in README 2015-09-12 08:21:35 -04:00
John Dennis 6c1012e202 Add support for SAML ECP.
The modifications in this commit address the changes necessary to
support the SP component of SAML ECP. The Lasso library needs
additional modifications before SAML ECP will be fully functional,
those fixes have been submitted to upstream Lasso, mod_auth_mellon
will continue to operate correctly without the Lasso upgrade, it just
won't properly support ECP without the Lasso fixes.

Below are the major logical changes in the commit and the rationale
behind them.

* Allow compilation against older versions of Lasso by conditionally
  compiling.

  Add the following CPP symbols set by configure:

  * HAVE_ECP
  * HAVE_LASSO_UTILS_H

* Add lasso_compat.h

  If we can't include lasso utils.h than pull in our own
  local definitions so we can use some of the valuable
  utilities.

* Add ECP specific documentation file

  Documentation specific to ECP is now contained in ECP.rst
  (using reStructuredText formatting). Information on general ECP
  concepts, mod_auth_mellon user information, and internal
  mod_auth_mellon coding issues are covered.

* Add am_get_boolean_query_parameter() utility

* Add am_validate_paos_header() utility

  This utility routine validates the PAOS HTTP header. It is used
  in conjunction with am_header_has_media_type() to determine if a
  client is ECP capable.

* Add am_is_paos_request() utility

  This utility checks to see if the request is PAOS based on the
  required HTTP header content.

* Add utility function am_header_has_media_type() to check if an HTTP
  Accept header includes a specific media type. This is necessary
  because the SP detects an ECP client by the presence of a
  application/vnd.paos+xml media type in the Accept
  header. Unfortunately neither Apache nor mod_auth_mellon already had
  a function to check Accept media types so this was custom written
  and added to mod_auth_mellon.

* Add utility function am_get_assertion_consumer_service_by_binding()
  because Lasso does not expose that in it's public API. It's
  necessary to get the URL of the PAOS AssertionConsumerService.

* Add MellonECPSendIDPList config option

  This option controls whether to include a list of IDP's when
  sending an ECP PAOS <AuthnRequest> message to an ECP client.

* We need to do some bookkeeping during the processing of a
  request. Some Apache modules call this "adding a
  note". mod_auth_mellon was already doing this but because it only
  needed to track one value (the cookie value) took a shortcut and
  stuffed the cookie value into the per module request slot rather
  than defining a struct that could hold a variety of per-request
  values. To accommodate multiple per request bookkeeping values we
  define a new struct, am_req_cfg_rec, that holds the previously used
  cookie value and adds a new ECP specific value. This struct is now
  the bookkeeping data item attached to each request. To support the
  new am_req_cfg_rec struct the am_get_req_cfg macro was added (mirrors
  the existing am_get_srv_cfg, am_get_mod_cfg and am_get_dir_cfg
  macros). The am_create_request() Apache hook was added to
  initialize the am_req_cfg_rec at the beginning of the request
  pipeline.

* A new endpoint was added to handle PAOS responses from the ECP
  client. The endpoint is called "paosResponse" and lives along side
  of the existing endpoints (e.g. postResponse, artifactResponse,
  metadata, auth, logout, etc.). The new endpoint is handled by
  am_handle_paos_reply(). The metadata generation implemented in
  am_generate_metadata() was augmented to add the paosResponse
  endpoint and bind it to the SAML2 PAOS binding.

* am_handle_reply_common() was being called by am_handle_post_reply()
  and am_handle_artifact_reply() because replies share a fair amount
  of common logic. The new am_handle_paos_reply() also needs to
  utilize the same common logic in am_handle_reply_common() but ECP
  has slightly different behavior that has to be accounted for. With
  ECP there is no SP generated cookie because the SP did not initiate
  the process and has no state to track. Also the RelayState is
  optional with ECP and is carried in the PAOS header as opposed to an
  HTTP query/post parameter. The boolean flag is_paos was added as a
  parameter to am_handle_reply_common() so as to be able to
  distinguish between the PAOS and non-PAOS logic.

* Add PAOS AssertionConsumerService to automatically generated metadata.
  Note, am_get_assertion_consumer_service_by_binding() should be able
  to locate this endpoint.

* Refactor code to send <AuthnRequest>, now also supports PAOS

  The creation and initialization of a LassoLogin object is different
  for the ECP case. We want to share as much common code as possible,
  the following refactoring was done to achieve that goal.

  The function am_send_authn_request() was removed and it's logic
  moved to am_init_authn_request_common(),
  am_send_login_authn_request() and
  am_set_authn_request_content(). This allows the logic used to create
  and initialize a LassoLogin object to be shared between the PAOS and
  non-PAOS cases. am_send_paos_authn_request() also calls
  am_init_authn_request_common() and
  am_set_authn_request_content(). The function
  am_set_authn_request_content() replaces the logic at the end of
  am_send_authn_request(), it is responsible for setting the HTTP
  headers and body content based on the LassoLogin.

Signed-off-by: John Dennis <jdennis@redhat.com>
2015-09-03 13:32:45 -04:00
Olav Morken d9074c999e Preliminary changelog for 0.11.0. 2015-09-03 14:47:16 +02:00
Olav Morken f49a30ed6d Fix access to username in subrequests.
This patch makes the username of the main request available in the
subrequests, such as those used by DirectoryIndex to find the
actual page to display when you access a folder.

The error messages would look like this:

> No authentication done but request not allowed without authentication
> for /index.html. Authentication not configured?

This patch fixes issue 38.
2015-09-03 14:17:21 +02:00
Olav Morken bd80b26c7f Merge pull request #49 from thijskh/remove-mellondecode
Remove mellondecode
2015-09-03 14:16:11 +02:00
Olav Morken 2d9ad56323 Merge pull request #45 from thijskh/master
Updates to README.
2015-09-03 14:15:08 +02:00
Olav Morken 09a1f8d604 Merge pull request #44 from traylenator/numbers
Fixes #43 accept numbers in host names.
2015-09-03 11:04:25 +02:00
Thijs Kinkhorst 885b991af9 Obsolete the MellonDecoder configuration directive.
The only supported options were 'none' and 'feide', where there is
no usecase anymore for 'feide', leaving only 'none'. This changes
the function into a no-op, it will still accept the MellonDecoder
directive for backwards compatibility.
2015-08-31 10:03:38 +00:00
Thijs Kinkhorst 5757caf8c1 Make mention of the mailing list for support issues. 2015-08-19 11:52:09 +00:00
Thijs Kinkhorst 409a042b8a Describe needed dependencies on Apache modules. 2015-08-19 11:51:43 +00:00
Steve Traylen 693b675d7d Fixes #43 accept numbers in host names. 2015-08-18 17:09:20 +02:00
Olav Morken b49dbf41bc Merge pull request #40 from bdauvergne/master
Add max-age=0 to the Cache-Control header to prevent stale content read from logged out users
2015-08-05 11:57:13 +02:00
Benjamin Dauvergne fd1f136a3f Add a max-age=0 to Cache-Control header
must-revalidate without max-age or Expire allows browser to
heuristically choose an arbitrary expiration time (especially if
the Last-Modified header is returned in the response). But after a
logout all cached content should be invalidated whatever its expiration
time; to prevent returning stale data to logged-out user we set
max-age=0.
2015-08-04 11:19:14 +02:00
Olav Morken e704e2da4c Add simple build script for Travis-CI.
This script should ensure that we get feedback about pull requests
building.
2015-05-07 07:43:27 +02:00
Olav Morken fc0aaef5bb Fix syntax error introduced in earlier commit. 2015-05-07 07:24:15 +02:00
Olav Morken 2c8ca4ee7a Merge pull request #29 from adelton/MellonMergeEnvVars-separator
MellonMergeEnvVars can now take second optional parameter to specify the separator.
2015-04-20 09:34:15 +02:00
Jan Pazdziora 9c6b27c54e MellonMergeEnvVars can now take second optional parameter to specify the separator. 2015-04-17 16:59:10 +02:00
Olav Morken b014240c8c Merge pull request #28 from adelton/MellonEnvVarsSetCount
Adding MellonEnvVarsSetCount functionality.
2015-04-17 15:54:11 +02:00
Jan Pazdziora 24b9a2e8c6 Adding MellonEnvVarsSetCount functionality. 2015-04-16 11:02:21 +02:00
Olav Morken f7ae2c45df Merge pull request #25 from adelton/MellonEnvVarsIndexStart
Adding MellonEnvVarsIndexStart functionality.
2015-04-16 09:30:40 +02:00
Jan Pazdziora 3e2f2af6c7 Adding MellonEnvVarsIndexStart functionality. 2015-04-15 10:59:21 +02:00
Olav Morken e33b2473c1 Merge pull request #22 from bdauvergne/wip/concatenante-misctextnode
Use lasso_node_dump() on all MiscTextNode value to build attribut values
2015-04-08 14:50:54 +02:00
Olav Morken b58aa909e5 Merge pull request #23 from thijskh/master
Documentation fix: 1073741824 bytes = 1 GB
2015-04-08 14:30:58 +02:00
Thijs Kinkhorst fefcfa5944 Documentation fix: 1073741824 bytes = 1 GB 2015-04-08 09:06:53 +00:00
Benjamin Dauvergne 6512c4cbfb Use lasso_node_dump() on all MiscTextNode value to build attribut values
AttributeValue nodes can contain an unlimited list of node or
LassoMiscTextNode objects.
2015-04-08 10:51:36 +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