Commit Graph

421 Commits

Author SHA1 Message Date
Benjamin Dauvergne c7cf89b387 Merge branch 'release-2.4.0' 2012-05-05 22:32:48 +02:00
Thomas NOËL d2d26b7d56 fix compilation error with xmlsec 1.2.18 / freebsd (#1365)
see http://dev.entrouvert.org/issues/1365
2012-04-26 15:26:51 +02:00
Benjamin Dauvergne f42bef0836 [key] add methods to send message using SAML 2.0 redirect and post bindings 2012-03-17 15:26:21 +01:00
Benjamin Dauvergne 727f07b1ae Simplify useless complexity in include paths 2011-12-16 14:17:31 +01:00
Benjamin Dauvergne 154812b401 [xml] rewrite schema directed serialization/deserialization methods
The new implementations of lasso_node_impl_init_from_xml now validate
namespace of all child nodes befores parsing. It stops on any error. For
node which implement their own parsing of an attribute or a node, it
must declare an XmlSnippet with an offset field set to 0. The 0 value is
invalid for public GObject structure (it's the place of the GObject
machinery like the reference count). The 0 offset can be used for
XmlSnippet in a private structure, so never set the offset to 0 with the
flag SNIPPET_PRIVATE, for a field which is parsed by you get_xmlNode
virtual method.

Other ameliorations in this commit is the possibility to set attributes
with namespace when using the flags SNIPPET_ATTRIBUTE|SNIPPET_ANY. The
syntax for an attribute is inspired by the element tree API from Python:

	{namespace}attribute_name

an example:

	{http://www.w3.org/2001/XMLSchema-instance}type

for the classic xsi:type attribute.
2011-12-16 11:39:24 +01:00
Benjamin Dauvergne f4fc26bb39 [core] move XMLDsig related nodes in their own sub-library, add X509Data node implementation
The goal is to use the KeyInfo structure as a transport format for our cryptographic keys
2011-12-16 11:39:18 +01:00
Benjamin Dauvergne 5ba292521b [core] add the HMAC-SHA1 shared secret signature method 2011-12-05 13:11:53 +01:00
Benjamin Dauvergne cd017964d0 [core] introduce the LassoSignatureContext context, to pass around signature parameters
This structure is used to pass around the signature algorithm
and the signature key.
2011-12-05 12:03:13 +01:00
Benjamin Dauvergne 490cc01bf2 [xml] use lasso_node_export_to_query_with_password to implement lasso_node_export_to_query 2011-12-05 12:03:13 +01:00
Benjamin Dauvergne 29800377a3 Merge branch 'multi-certificates' 2011-11-29 12:36:47 +01:00
Benjamin Dauvergne 92ebef91f5 Merge branch 'excl-c14n-fix' 2011-11-29 11:05:29 +01:00
Benjamin Dauvergne 26d6b35a49 [leakcheck] fix leaks seen by the unit tests
This commit also improved valgrind suppression file to hide static
allocations done by the GLib type system.
2011-11-22 17:45:52 +01:00
Benjamin Dauvergne 9d13fb1933 [core] fix wrong XML canonicalization when assertion is extracted without its namespace context 2011-11-22 00:18:33 +01:00
Benjamin Dauvergne 3ec4a2f294 [xml] allow to store XSchema data into a private stucture
- added new macros SNIPPET_STRUCT_MEMBER and SNIPPET_STRUCT_MEMBER_P
   replaces use of G_STRUCT_MEMBER/_P macros.
 - we use the GType of the class containing a given XmlSnippet to find
   the proper private structure.
 - added flag SNIPPET_PRIVATE to state XmlSnippet whose value
   should be extracted from the private structure and not the public
   one.
2011-11-18 15:36:41 +01:00
Benjamin Dauvergne f69b561c47 [xml] allow node classes to not defined their nodename, useful for simple Type 2011-10-13 01:09:29 +02:00
Benjamin Dauvergne aa7fae5fc1 [xml] if a SNIPPET_LIST_NODES as the SNIPPET_ANY flag, allows really any kind of node through LassoMiscTextNode 2011-10-10 16:31:03 +02:00
Benjamin Dauvergne 94136d639b [xml] only try to map an xmlNode to a class ame if the node has a namespace 2011-10-10 16:17:28 +02:00
Benjamin Dauvergne a7be1fa114 [xml] create a static version of lasso_node_new_from_xmlNode_with_type without error logging
When used inside lasso_node_impl_init_from_xml the error logging is
prematurely sent as there is a backup procedure for parsing unknown
nodes inside a SNIPPET_LIST_NODES by creating a LassoMiscTextNode
containing a copy of the parsed xmlNode child.
2011-10-07 13:08:49 +02:00
Benjamin Dauvergne b7cbdd0d77 [xml] use g_strndup instead of strndup, as it is more portable 2011-05-18 23:44:10 +02:00
Benjamin Dauvergne 78c9a9382a [xml] fix lasso_node_get_xmlnode_for_any_type
xmlCopyPropList does not copy the property list into the target it just
copy it with respect to the target (mainly for namespace references).

This patch adds the real copy into the target node.
2011-03-07 16:25:17 +01:00
Benjamin Dauvergne 346071a630 [wsf] fix wsf preprocessor conditionals 2011-01-04 16:43:06 +01:00
Benjamin Dauvergne d69649cc5d [xml] fix null pointer access in lasso_node_get_encryption 2010-12-22 11:03:52 +01:00
Benjamin Dauvergne 4f5e6c6000 [xml] remove duplicate EncryptedKey around EncryptedData elements
The key is already embedded in the EncryptedData, so there is no need to
also fill the EncryptedKey field of the saml:EncryptedElement object.
2010-12-14 02:01:30 +01:00
Benjamin Dauvergne b324c41237 [xml] add exportation of the encrypting public key in EncryptedData elements
This commit check if the given is a simple RSA key or a full certificate
and choose the better serialization method between RSAKeyValue and
X509Data.
2010-12-14 02:00:10 +01:00
Benjamin Dauvergne ec5ec161f7 [xml] add field to contains encryption parameters inside CustomElement structure 2010-12-14 01:55:09 +01:00
Benjamin Dauvergne 758fe88dad [xml] fix waring on use of strndup on pardus 2010-10-08 14:10:26 +02:00
Jérôme Schneider 270f1743f0 Add missing include <errno.h> 2010-10-08 14:10:02 +02:00
Benjamin Dauvergne 462c9a1cd0 [Core] replace all use of g_strcmp0 by lasso_strisequal and lasso_strisnotequal
Too much human errors with strcmp kind of functions. Also change name os
lasso_is_empty_string to lasso_strisempty.
2010-10-01 15:29:38 +02:00
Benjamin Dauvergne 4a970453de [Core] add missing annotation to lasso_*_dump functions
The string returned by these functions is newly allocated and must be
freed by the caller.
2010-09-27 16:18:57 +02:00
Benjamin Dauvergne 73949289ee [XML] fix memleak in lasso_node_export_to_soap 2010-09-17 17:02:40 +02:00
Benjamin Dauvergne a02645ba37 [XML] fix unused variable warnings 2010-09-17 17:02:40 +02:00
Benjamin Dauvergne 17cf81152a [XML] fix mem leak whene releasing CustomElement structures 2010-09-17 17:02:39 +02:00
Benjamin Dauvergne b9d5356259 [ID-WSFv1&ID-WSFv2] separate better strings for ID-WSF from other strings
Code in core source file which depend upon ID-WSF symbols have been
conditionalized, and each id-wsf source file now include directly its
need string header.
2010-09-09 01:09:28 +02:00
Benjamin Dauvergne 3f336a8e83 Merge branch 'develop' into hotfixes-2.3.1 2010-09-03 19:07:08 +02:00
Benjamin Dauvergne 90fda9d556 [Core] load signature parameters
Generic signature parameters (attached as qdata to nodes) is now
reloaded when initializing a node from XML for a node type with a
signature snippet in its metadatas.

It fixes the problematic usage of ciphered private keys with the
HTTP-Artifact binding (which needs to keep a copy of the AuthnResponse
around and to sign it later).
2010-09-03 19:02:41 +02:00
Benjamin Dauvergne 5f5942a4dd [Core] add private function to read an integer attribute
This function does integer parsing and range checks, it returns TRUE if
all goes well.
2010-09-03 19:02:41 +02:00
Benjamin Dauvergne 4b05610fa5 [XML] use strtol instead of atoi to parse XSchema integers
This commit also reject negative integers from being parsed (all integers
in SAMLv2 and ID-FFv1.2 schemas are positive integers).
2010-08-25 15:43:09 +02:00
Benjamin Dauvergne f8ce6b25e5 [Code] add a lasso_node_export_to_query_with_password method 2010-07-16 19:34:23 +00:00
Benjamin Dauvergne c939427f21 [Core] add a password parameter to lasso_query_sign
We force use of the password through a custom OpenSSL password callback.
2010-07-16 19:34:21 +00:00
Benjamin Dauvergne 2fc20aa682 [Core] dump custom signature parameters in lasso dumps
The signature parameters are serialized as global attributes from the
http://lasso.entrouvert.org/lasso/namespaces/0.0 named:
SignatureType
SignatureMethod
PrivateKey
PrivateKeyPassword
Certificate
2010-07-16 19:34:19 +00:00
Benjamin Dauvergne 8198294c55 [Core] add lasso_node_set_signature and lasso_node_get_signature
Those two methods allows to associate signature parameters to any node.
They keep it inside the CustomElement quark. Using a private structure
may be more performant.
2010-07-16 19:34:14 +00: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 ef36d5cad3 [XML] in lasso_node_export_to_paos_request check return value of lasso_node_get_xmlNode 2010-06-17 11:42:45 +00:00
Benjamin Dauvergne eac190160c [XML] in _lasso_node_export_to_base64 check return value of lasso_node_export_to_xml 2010-06-17 11:42:43 +00:00
Benjamin Dauvergne 8c46b3dd58 [XML] in _lasso_node_export_to_xml check return value of lasso_node_get_xmlNode 2010-06-17 11:42:41 +00:00
Benjamin Dauvergne 8dd38b7746 [Core] do not ignore keep_xmlnode flag inherited from parent classes
We only looked to the keep_xmlnode flag in the node data of the top
level class, but any parent class can set this flag and in this case we
must honor it too.
2010-06-15 11:33:00 +00:00
Benjamin Dauvergne a041a2ef81 Initialize all uninitialized rc variables 2010-04-30 09:23:01 +00:00
Benjamin Dauvergne 0e8441afe3 Improve safety by replacing all g_hash_table_destroy use by lasso_release_ghashtable 2010-04-22 00:45:02 +00:00
Benjamin Dauvergne 2f5ef5fef0 Improve safety by replacing all g_list_free use by lasso_release_list 2010-04-22 00:44:57 +00:00
Benjamin Dauvergne 1ef02e3fe2 Improve safety by replacing all g_string_free use by lasso_release_gstring 2010-04-22 00:44:49 +00:00