Commit Graph

24 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
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 9d9cf60aca [Core] extract signature adding into base class method lasso_node_get_xmlNode
In order to permit subclass to modify the base xmlNode created by
lasso_node_impl_get_xmlNode we must defer the concrete to the virtual
method wrapper, lasso_node_get_xmlNode.

To do that it whas needed to make id_attribute another virtual field of
LassoNode subclasses (it can be accessed through an offset registered in
the class object).

This commit solves signature validation error since the patch for
managing more than one SessionIndex element in samlp2:LogoutRequest.

It also factorize the creation of signatures in one place.
2010-07-12 14:09:17 +00:00
Benjamin Dauvergne 0a169eda51 Improve safety by replacing all g_free use by lasso_release 2010-04-22 00:44:45 +00:00
Benjamin Dauvergne 8c26e2ba8c Use new SAML2 strings instead of hardcoding query string field names 2010-02-10 00:34:29 +00:00
Benjamin Dauvergne 2ff13e5414 SAML 2.0: overhaul for ubuquitous binding support, still need work for HTTP-Artefact 2010-01-12 15:39:48 +00:00
Benjamin Dauvergne 01dad5fd05 XML: fill node_data->{certificate,private_key}_file_offset for nodes with signatures 2010-01-12 15:39:40 +00: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 02c189c3f1 Add keep_xmlnode flag to SAML 2.0 req, resp and assertions
* lasso/xml/saml-2.0/saml2_assertion.c:
 * lasso/xml/saml-2.0/samlp2_request_abstract.c:
 * lasso/xml/saml-2.0/samlp2_response.c:
 * lasso/xml/saml-2.0/samlp2_status_response.c:
   set keep_xmlnode flag to 1 in class_init.
2009-04-27 08:19:32 +00:00
Benjamin Dauvergne 93dc7ca545 XML ID-FF 1.2 & SAML 2.0: Handle signature failure
* lasso/xml/saml_assertion.c:
 * lasso/xml/samlp_response_abstract.c:
 * lasso/xml/samlp_request_abstract.c:
 * lasso/xml/saml-2.0/samlp2_request_abstract.c:
 * lasso/xml/saml-2.0/saml2_assertion.c:
 * lasso/xml/saml-2.0/samlp2_status_response.c:
   if a failure occur in the signing process, free the xmlnode, return
   NULL and print a warning.
2009-03-27 15:06:13 +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 c3b0ca25b8 XML SAML 2.0: add a build query to request base class
* lasso/xml/saml-2.0/samlp2_request_abstract.c: add a build query
   overloaded function to LassoSamlp2RequestAbstract class, the base
   class of all saml 2.0 request nodes.
2009-03-27 15:05:45 +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
Frédéric Péters 6d2d5b5048 warns when signing saml2 elements would fail because private key is missing 2008-01-23 12:37:12 +00:00
Damien Laniel 4fc6657e0c updated Copyright dates in all files 2007-05-30 17:17:45 +00:00
Frédéric Péters 7509f30eb1 fixed signature element position 2006-12-04 10:21:09 +00:00
Frédéric Péters 73a5ea2ba1 initialize private_key_file and certificate_file properly 2006-10-28 17:00:38 +00:00
Frédéric Péters 853f46fd93 starting SAML 2 logout 2005-11-21 18:51:52 +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