Commit Graph

19 Commits

Author SHA1 Message Date
Benjamin Dauvergne 72b778e47e Fix all cast-function-type warnings (#71400) 2022-11-21 13:28:08 +01:00
Benjamin Dauvergne e5ad4b1702 misc: clear warnings about class_init signature using coccinelle
$ spatch --in-place --sp-file add-second-arg-to-class-init.cocci `git grep -l -C1 ^class_init \*.c`
	$ sed -i 's/\*unused\>/*unused G_GNUC_UNUSED/' `git grep -l 'void \*unused'`
2020-03-26 22:52:49 +01:00
John Dennis 1c31736ded Implement ECP client functionality
Implement everything needed to support a SAMLv2 ECP client.

Re-implement lasso_ecp_process_authn_request_msg() and
lasso_ecp_process_response_msg() to use the Lasso XML serialization
subsystem with the ECP and PASO LassoNode's introduced earlier. This
replaces one-off explicit direct use of the libxml API with Lasso
common code. In the process provide support for 100% of the ECP and
PAOS SAMLv2 parameters, not just a subset. Include support for
receiving an IDPList from the SP in conjuction with selecting an IdP
known to the ECP client. Add extensive documentation.

Modify LassoSamlp2AuthnRequest to preserve it's original XML (enable
keep_xmlnode flag) so that when serializing the SOAP request the
LassoSamlp2AuthnRequest received from the SP is exactly duplicated.

Add the following internal static utility functions:

is_provider_in_sp_idplist()
is_idp_entry_in_entity_id_list()
intersect_sp_idplist_with_entity_id_list()

Add the following exported utility functions:

lasso_ecp_is_provider_in_sp_idplist()
lasso_ecp_is_idp_entry_known_idp_supporting_ecp()
lasso_ecp_set_known_sp_provided_idp_entries_supporting_ecp()
lasso_ecp_has_sp_idplist()
lasso_ecp_get_endpoint_url_by_entity_id()
lasso_ecp_process_sp_idp_list()

Add the following members to the ECP class:

message_id
response_consumer_url
relaystate
issuer
provider_name
is_passive
sp_idp_list
known_sp_provided_idp_entries_supporting_ecp
known_idp_entity_ids_supporting_ecp

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
Simo Sorce 3a6b2fdee7 Fix license boilerplates
Instad of referring to an old FSF address, point the reader to the FSF
website where the latest licenses and addresses are published.

Signed-off-by: Simo Sorce <simo@redhat.com>
2013-12-03 21:55:06 +01:00
Benjamin Dauvergne ed9c981989 [xml] complete missing namespace declarations for child nodes
To allow lasso_node_impl_init_from_xmlnode to do proper namespace
checking, child node which are not of the same namespace as their parent
in their XSD schema must have an explicit namespace declared in the
XmlSnippet.
2011-12-16 11:39:19 +01:00
Benjamin Dauvergne b63bc73b93 XML: remove all useless instance_init functions
* Use Coccinelle semantic patch tool (http://coccinelle.lip6.fr/) to
   remove useless instance_init functions, the first patch applied was:
@@
type T,V;
identifier I, J;
parameter list P;
expression E1;
@@

V instance_init(T node)
{
<...
(
-  E1 = 0;
|
-  E1 = NULL;
|
-  E1 = FALSE;
)
...>
}
   It removes useless initialization to 0 (GObject already zeroes
   allocated objects).
   The second one is:
@ rule1 @
type T;
identifier node,fn;
@@

- static void fn(T *node) { }

@ rule2 extends rule1 @
typedef GType, GInstanceInitFunc;
identifier type_constructor;
@@
GType type_constructor()
{
<...
- (GInstanceInitFunc)fn
+ NULL
...>
}
   It removes empty instance_init functions.
2009-08-26 15:14:48 +00:00
Benjamin Dauvergne 91d9d67812 XML SAML 2.0: Mark RelayState field from SAML 2.0 deprecated
* lasso/xml/saml-2.0/samlp2_authn_request.c,
   lasso/xml/saml-2.0/samlp2_logout_request.c,
   - (instance_init) remove initialization of relayState field

 * lasso/xml/saml-2.0/samlp2_logout_response.c:
   - (instance_init) remove empty function, since it
     only initialized relayState.
   - (lasso_samlp2_logout_reponse_get_type) remove instance_init
     from the type initialization structure.

 * lasso/xml/saml-2.0/samlp2_authn_request.h,
   lasso/xml/saml-2.0/samlp2_logout_request.h,
   lasso/xml/saml-2.0/samlp2_logout_response.h:
   - (struct _LassoSamlp2*) mark relaystate field as deprecated.
2009-03-27 15:06:10 +00:00
Benjamin Dauvergne 1b550a8606 XML SAML 2.0: Clean query string parsing/building
* lasso/xml/saml-2.0/samlp2_status_response.c:
   - (init_from_query) remove useless stub code for parsing RelayState

 * lasso/xml/saml-2.0/samlp2_response.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c,
   lasso/xml/saml-2.0/samlp2_logout_response.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_response.c, :
   - (class_init) remove overloading of init_from_query, use version
     from samlp2_status_response instead.
   - (init_from_query) Useless so deleted.

 * lasso/xml/saml-2.0/samlp2_request_abstract.c:
   - (class_init) add overloaded method for init_from_query virtual
     method.
   - (init_from_query) generic implementation for SAML 2.0 requests

 * lasso/xml/saml-2.0/samlp2_subject_query_abstract.c,
   lasso/xml/saml-2.0/samlp2_authn_request.c,
   lasso/xml/saml-2.0/samlp2_logout_request.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_request.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c,
   lasso/xml/saml-2.0/samlp2_assertion_id_request.c:
   - (class_init) remove overloading of init_from_query, use version
     from samlp2_request_abstract instead.
   - (init_from_query) Useless so deleted.
2009-03-27 15:06:08 +00:00
Benjamin Dauvergne e43ce11311 XML SAML2: Remove unnecessary overloading of build_query in request/respons objects
* lasso/xml/saml-2.0/samlp2_assertion_id_request.c,
   lasso/xml/saml-2.0/samlp2_authn_request.c,
   lasso/xml/saml-2.0/samlp2_logout_request.c,
   lasso/xml/saml-2.0/samlp2_logout_response.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_request.c,
   lasso/xml/saml-2.0/samlp2_manage_name_id_response.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c,
   lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c,
   lasso/xml/saml-2.0/samlp2_response.c,
   lasso/xml/saml-2.0/samlp2_subject_query_abstract.c: remove useless
   overloading of build_query virtual method, revert to implementations
   in LassoSamlp2RequestAbstract and LassoSamlp2StatusResponse.
2009-03-27 15:05:47 +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 33bbf7a7de All: Fix missing field initializer problems
* lots of files: Explicitely set all field of initialized structures,
  in order to remove -Wno-missing-field-initilizers from needed
  compiler options when using -Wall -Wextra.
2009-01-24 09:33:40 +00:00
Benjamin Dauvergne 9ed0670e48 * Remove ending blanks 2008-09-12 15:06:58 +00:00
Frédéric Péters e5ba6151ba moved gtk-doc inline as is better on so many points; also added schema
fragments to published doc
2008-05-15 21:17:44 +00:00
Damien Laniel 4fc6657e0c updated Copyright dates in all files 2007-05-30 17:17:45 +00:00
Frédéric Péters 342649509e notice when building deflated query fails, and don't include (null) as query
component in this case.
2006-12-28 14:44:56 +00:00
Frédéric Péters c888519f1e relaystate handling 2006-12-06 09:26:45 +00:00
Frédéric Péters 4c681bec80 default value set to -1 and marked as optionals 2006-10-29 18:04:53 +00:00
Frédéric Péters 42f573a9fc started support for AssertionConsumerServiceIndex (as alternative to
ProtocolBinding) (used by zxid)
2006-10-29 12:27:36 +00:00
Frédéric Péters ebb9f7dffc SAML 2.0 support (only web-sso for the moment) 2005-11-20 15:38:19 +00:00