Commit Graph

118 Commits

Author SHA1 Message Date
Benjamin Dauvergne fd256b2269 Docs: change the doc production and lot of other fixes
* lasso/Makefile.am:
   distribute extract_sections.py
 * docs/references/lasso/lasso.types.in: add missing class (mainly SAML2
   and ID-WSF 1.0/2.0) from docs/references/lasso.types.in

 * lasso/xml/strings.h:
   add lots of documentation, or at least documentation template to
   strings constants.
 * id-ff/login.h:
 * saml-2.0/assertion_query.h:
 * xml/xml.h:
   document undocumented enumerations.
 * lasso/errors.h:
   add proper documentation about error codes.
 * lasso/errors.c:
   new version of the lasso_strerror function
 * lasso/build_strerror.py:
   update the script that generater lasso_strerror from the
   documentation comments.

   Remove usage of OFTYPE

 * lasso/id-ff/session.c:
 * lasso/id-ff/session.h:
   remove usage of oftype, prefer gtk-introspection annotations instead.
 * lasso/id-wsf/data_service.h:
 * lasso/id-wsf/data_service.c:
   do the same.

   Add a script to build lasso-sections.txt

 * lasso/extract_sections.py:
   this script parses header files and generated lasso-sections.txt
   content for GObject class descriptions.

   Add a template file for the lasso-section.txt file

 * docs/references/lasso-sections.txt.in:
   this file serves as a base for the generation of lasso-sections.txt

   Update docs/references/Makefile.am for generating lasso-sections.txt

 * docs/references/Makefile.am:
   always rebuild template, using out of source build directory is too
   weird without it.
   call new script extract_sections.py to regenerate lasso-sections.txt
   if header files changed.

   Update lasso.sgml file with all missing sections

 * docs/reference/lasso.sgml:
   add all missing sections, mainly objects from XML schemas.

 * docs/reference/lasso-sections.txt: update it

 * *.c: add section documentation to some files.
 * lasso/xml/strings.h: fix bad usage or docbook markup
2009-08-26 15:15:07 +00:00
Benjamin Dauvergne 7231771856 All: Rework include files handling, separated ID-WSF code from SAML2/ID-FF code
* nearly all C files: change includes for relative paths.
 * lasso/id-wsf/id_wsf.h, lasso/id-wsf-2.0/id_wsf_2.h: add top level
   public include files for ID-WSF 1.0 and ID-WSF 2.0.
 * lasso/id-ff/server.*, lasso/id-ff/session.*, lasso/id-ff/identity.*:
   remove most of the code related to ID-WSF and push into
   lasso/id-wsf/id_ff_extensions.* and lasso/id-wsf-2.0/identity.c,
   lasso/id-wsf-2.0/server.c, lasso/id-wsf-2.0/session.c.
 * lasso/id-wsf-2.0/saml2_login.c,
   lasso/id-wsf-2.0/saml2_login_private.h: same change but for ID-WSF
   2.0 support in SAML2 SSO profile.
2009-08-26 15:14:32 +00:00
Benjamin Dauvergne fbfbe5553d ID-FF&Core: Seal public field of LassoSession
* id-ff/session.h: seal public fields.

 * id-ff/session.c, id-ff/sessionprivate.h: add accessors for reading
   the is_dirty flag and counting store assertions.

 * id-ff/logout.c, id-ff/login.c, saml-2.0/login.c, saml-2.0/logout.c,
   saml-2.0/profile.c: use the new accessors.

 * id-ff/profile.c: include the private header file, use the new
   accessors, and remove unnecessary setting of is_dirty to FALSE (it
   should be false at instanciation).

 * utils.h: add a macro to access private content, prepare for using
   G_TYPE_INSTANCE_GET_PRIVATE and the GObject infrastructure for
   private structures eventually.
2009-08-26 15:13:55 +00:00
Benjamin Dauvergne c5f5f84329 SAML 2.0: Fix many leaks
* lasso/saml-2.0/login.c:
 * lasso/saml-2.0/logout.c:
 * lasso/saml-2.0/name_id_management.c:
 * lasso/saml-2.0/profile.c:
 * lasso/saml-2.0/provider.c:
   do not mix g_malloc strings with libxml strings, use the
   string/gobject handling macros as much as possible, be a good memory
   citizen, don't put your elbows on the table.
2009-04-30 14:58:11 +00:00
Benjamin Dauvergne 2a75e87543 More work on signature validation for SAML 2.0
* lasso/saml-2.0/profile.c:
   in lasso_saml20_profile_process_any_request and
   lasso_saml20_profile_process_any_response do not make signature
   validation failure as call failure, just store the result in
   profile->signature_status and let the upper level functions handle
   what to do with it. also add documentation about those two functions.

 * lasso/saml-2.0/logout.c:
 * lasso/saml-2.0/name_id_management.c:
   handle new signature_status semantic.

 * lasso/saml-2.0/login.c:
   add internal documentation for
   lasso_saml20_login_process_authn_response_msg.
2009-04-27 15:48:53 +00:00
Benjamin Dauvergne cbd9ade936 Update signature_status when checking signature on assertions
* lasso/saml-2.0/login.c:
   if signature_status is SIGNATURE_NOT_FOUND, check one on the
   assertion and keep the result in signature_status.
2009-04-27 14:31:51 +00:00
Benjamin Dauvergne b2c9e44a05 FIX: verify assertion signature for SAML 2.0 when response is not signed
* lasso/saml-2.0/login.c:
   if response was not signed, check the signature on the assertion.
2009-04-27 08:19:37 +00:00
Benjamin Dauvergne bb7af761c5 new function lasso_saml20_login_check_assertion_signature()
* lasso/saml-2.0/login.c:
   lasso_saml20_login_check_assertion_signature() find the issuer of an
   assertion, look it up in the server object and try to validate its
   signature. It returns an error code if any of this step fails.
2009-04-27 08:19:35 +00:00
Benjamin Dauvergne 8fe7780441 SAML 2.0: Use new API lasso_url_add_parameter
* lasso/saml-2.0/profile.c:
   use new API lasso_url_add_parameter to handle RelayState parameter
   creation.
2009-04-22 23:49:24 +00:00
Benjamin Dauvergne b538c31bd3 SAML 2.0: Check http_method in build_artifact_msg
* lasso/saml-2.0/login.c:
   if http_method is not among ARTIFACT_GET and ARTIFACT_POST, return an
   INVALID_HTTP_METHOD error.
2009-04-22 23:49:22 +00:00
Benjamin Dauvergne 88eaabc94d SAML 2.0: add direct treatment of relaystate for HTTP-Redirect binding
* lasso/saml-2.0/login.c: In
  lasso_saml20_login_process_authn_request_msg change handling of
  relayState do not rely upon parsing by the node object, but extract
  directly from the query string. Use new function
  lasso_get_relaystate_from_query.
* lasso/saml-2.0/logout.c: In lasso_saml20_logout_process_request_msg
  change handling of relayState do not rely upon parsing by the node
  object, but extract directly from the query string.
* lasso/saml-2.0/profile.c: In
  lasso_saml20_profile_init_artifact_resolve, add handling of the
  relayState transmitted to the assertion consumer URL.
* lasso/saml-2.0/name_id_management.c: In
  lasso_name_id_management_process_request_msg change handling of
  relayState do not rely upon parsing by the node
  object, but extract directly from the query string.
2009-03-27 15:05:52 +00:00
Benjamin Dauvergne aad866ab67 SAML 2.0: simplify redirect binding code path
* lasso/saml-2.0/login.c, lasso/saml-2.0/logout.c,
   lasso/saml-2.0/name_id_management.c: simplify code path associated
   with generation of the url for the HTTP-Redirect binding using the
   rencently introduced function
   lasso_saml20_profile_build_http_redirect.
2009-03-27 15:05:50 +00:00
Benjamin Dauvergne 682bc4f6a8 SAML 2.0 Login: use generic methods
* lasso/saml-2.0/login.c:
   use new generic profile methods for saml 2.0 in
   lasso_saml20_login_process_paos_response_msg,
   lasso_saml20_login_process_authn_response_msg,
   lasso_saml20_login_process_response_status_and_assertion.
2009-03-27 15:05:14 +00:00
Benjamin Dauvergne 6ca45dacb1 SAML 2.0: add name id include to login.c
* lasso/saml-2.0/login.c:
   add include saml2_name_id.h
2009-03-27 15:05:13 +00:00
Benjamin Dauvergne b09ef2e015 Core: do not mix public and private headers
* lots of files:
   explicitely load the internal header xml/private.h where needed.
2009-03-27 15:04:26 +00:00
Benjamin Dauvergne f64f9973a5 SAML 2.0: remove NotBefore attribute when not answering an AuthnRequest
* lasso/saml-2.0/login.c:
   In specification saml-profile-2.0-os.pdf, in paragraph 4.1.4.3, it is
   said that the SubjectConfirmationData node MUST NOT contain a
   NotBefore attribute if it contains an InReponseTo attribute,
   understanding that the response cannot (it the ID of the request is
   sufficiently random) arrive before the request and be valid with
   respect to the InResponseTo attribute.
2009-03-03 20:52:49 +00:00
Benjamin Dauvergne 94398d7edf ID-FF 1.2 & SAML 2.0: fix "fix bug 173" match assertion and not the response with authn request id
* lasso/id-ff/login.c:
 * lasso/saml-2.0/login.c:
   Serialize/Unserialize request_id private field in LassoLogin dumps.
   Match InResponseTo assertion attribute (ID-FF 1.2) or
   SubjectConfirmationData attribute (SAML 2.0) to original request id
   if it is present.
2009-03-03 20:52:45 +00:00
Benjamin Dauvergne 1cc04298df ID-FF 1.2 & SAML 2.0: Fix #173, check InReponseTo in authn responses
* id-ff/login.h:
   add a string field named request_id in the private part of LassoLogin
   to store request id from the original AuthnRequest.
 * id-ff/login.c:
   if request_id field is not null check the InResponseTo attribute of
   the samlp:Response.
 * saml-2.0/login.c:
   if request_id field is not null check the InResponseTo attribute of
   the samlp:Response.
2009-02-17 17:02:01 +00:00
Benjamin Dauvergne 0d66367f28 Remove use of xmlFreeDoc for lasso_release_doc
- bindings/java/wrapper_top.c, bindings/php4/lasso_php4_helper.c,
    bindings/php5/wrapper_source_top.c, bindings/python/wrapper_top.c,
    lasso/id-ff/identity.c, lasso/id-ff/lecp.c, lasso/id-ff/login.c,
    lasso/id-ff/logout.c, lasso/id-ff/name_registration.c,
    lasso/id-ff/profile.c, lasso/id-ff/provider.c, lasso/id-ff/server.c,
    lasso/id-ff/session.c, lasso/id-wsf-2.0/data_service.c,
    lasso/id-wsf/data_service.c, lasso/id-wsf/discovery.c,
    lasso/id-wsf/wsf_profile.c, lasso/saml-2.0/ecp.c,
    lasso/saml-2.0/login.c, lasso/saml-2.0/name_id_management.c,
    lasso/utils.h, lasso/xml/tools.c, lasso/xml/xml.c, swig/Lasso.i:
    Remove use of xmlFreeDoc. Use lasso_release_doc instead.
2008-11-04 01:58:49 +00:00
Benjamin Dauvergne 9ed0670e48 * Remove ending blanks 2008-09-12 15:06:58 +00:00
Benjamin Dauvergne ae1f6a297c * Remove warnings:
- remove unused parameter from private function signatures
 - remove unused variable
 - initialize variable potentially accessed uninitialized
 - add G_GNUC_UNUSED if function is public or adhering to an interface, and a
   parameter is unused.
 - if ID-WSF is not compiled in, define stubs with G_GNUC_UNUSED on parameters.
 The goal is to compile with -Werror.
2008-09-12 13:57:22 +00:00
Benjamin Dauvergne 207891ff29 * Fix blanks mismatch (space in *.c and *h files or tabs in *.py files) and formatting 2008-08-05 14:53:29 +00:00
Frédéric Péters 29e87584e9 fixed ..._must_authenticate to look for any assertion, not just one from the
requester provider.
2008-07-22 12:07:18 +00:00
Frédéric Péters f728465716 forbit query strings to be xml signed 2008-05-29 14:14:48 +00:00
Damien Laniel 5316df50a7 fixed memory management during node decryption 2008-05-21 14:20:33 +00:00
Damien Laniel 7e9dec9400 some comments 2008-05-21 10:10:46 +00:00
Damien Laniel 94bc9a0840 free list elements 2008-05-21 10:00:38 +00:00
Damien Laniel eb2fbc8fc0 fixed some reference counting and memory management 2008-05-20 18:34:09 +00:00
Benjamin Dauvergne 02e13d5e89 fix indentation III the come back 2008-04-30 12:57:17 +00:00
Benjamin Dauvergne 5ea856493b fix indentation bis 2008-04-30 12:52:40 +00:00
Benjamin Dauvergne 35fbe98ed1 fix indentation 2008-04-30 12:36:27 +00:00
Benjamin Dauvergne a7992df66a * lasso*login_must_authenticate: (id-ff/login.c,saml-2.0/login.c): do
not   consider   profile->session   !=   NULL   as   a   proof   of   a
 previous  authentication  and  search   an  assertion  associated  with
 profile->remote_providerID.  That was  causing  a bug  when a  previous
 unsuccesfull request  was making  profile->session !=  NULL even  if no
 authentication has been made.
2008-04-30 12:24:09 +00:00
Benjamin Dauvergne 6394f9ef6e * fix ticket #1 and #3. 2008-03-11 14:06:56 +00:00
Benjamin Dauvergne 553f6111a0 * login.c: (lasso_login_saml20_validate_request) fix typo. 2008-03-05 17:08:18 +00:00
Benjamin Dauvergne 30abbad184 * lasso/saml-2.0/login.c: (lasso_login_validate_request) If consent is
not obtained set status code at AUTHN_FAILED (no other status code seems ok).
2008-03-04 13:10:04 +00:00
Benjamin Dauvergne 000f21295a * lasso/saml-2.0/login.c: lasso_login_saml20_validate_request
should define response->status_code no matter what happens, especially when
   consent is not obtained (lasso_login_saml20_process_federation return an
   error code in this case but it's a normal event in the SSO workflow so
   status code is 'Success'). If not buildArtifactMsg fails when looking for
   the response status code.
2008-03-04 11:41:19 +00:00
Frédéric Péters 24c7d38abc keep NameIdPolicy/Format in login->nameIDPolicy, as in ID-FF 1.2; use it not to
look for federations when transient is requested.
2008-02-25 13:01:34 +00:00
Frédéric Péters 4800b27dc8 proper casting 2008-02-18 13:11:33 +00:00
Frédéric Péters 587c5e8390 fixed assertion refcounting in lasso_login_build_assertion, changed
lasso_session_add_assertion to refcount the assertion it gets
2008-02-18 13:03:05 +00:00
Frédéric Péters 6b259af1aa rewording (hopefully without adding bug) 2008-01-23 12:20:08 +00:00
Frédéric Péters 80199a1720 removed unnecessary double call to export_to_soap 2008-01-23 12:19:28 +00:00
Damien Laniel cc926805f5 loop on attributeStatement and childs lists 2008-01-14 18:04:03 +00:00
Damien Laniel 1d31240992 fixed mixing epr assertion attribute with other custom attributes 2008-01-14 17:13:07 +00:00
Damien Laniel d3eaf8c72a handle name identifier formats : email and unspecified 2007-12-06 11:25:41 +00:00
Frédéric Péters 816e432be5 support for HTTP-Redirect binding being explicitely specified 2007-12-03 15:27:31 +00:00
Frédéric Péters 0a91e76505 added support for sending SAMLv2 AuthnResponse over HTTP-Redirect (which
shouldn't be used because the assertion within makes for a very big message)
2007-11-27 23:17:21 +00:00
Frédéric Péters 3fc428016f added a wrapper around xmlParseMemory to avoid network and DTD 2007-08-12 22:19:32 +00:00
Frédéric Péters 6204c8be9c adds all classes from ID-WSF 2 required schemas; with appropriate changes to
other files.
2007-07-10 08:50:56 +00:00
Damien Laniel 61bc3ec141 added comments 2007-06-12 14:15:37 +00:00
Damien Laniel 800f145069 fixed warnings 2007-06-11 15:27:50 +00:00