Commit Graph

63 Commits

Author SHA1 Message Date
Benjamin Dauvergne 8598c1327a Core: add a level argument to lasso_xmlnode_to_string and _lasso_node_export_to_xml 2010-03-02 11:57:29 +00:00
Benjamin Dauvergne 46a823ff85 Add lasso_string_to_xsd_integer, to parse xsd:integer values 2010-02-22 13:30:41 +00:00
Benjamin Dauvergne 5d9e6f550a Core: add a lasso_xmlnode_to_string function
* lasso/xml/tools.c lasso/xml/private.h:
   lots of functions duplicate this code, so we factorized it there.
   It has two parameters, the xmlnode and boolean deciding whether to
   format the resulting content (good for reading but bad for
   signatures).
2010-02-17 10:15:24 +00:00
Benjamin Dauvergne 72dc2ff63d Add a function to validate query signatures using SAML 2.0 semantic
* lasso/xml/tools.c:
   this new function is a placeholder for the new SAML 2.0 semantic
   following query signature validation function. It will start with the
   old code of lasso_query_verify_signature.
2010-02-10 00:33:45 +00:00
Benjamin Dauvergne 845eb26d6a Core: in tools.c, add function to load XML files and KeyInfo nodes
* tools.c:
   add lasso_xml_parse_file, based on g_file_get_contents and
   lasso_xml_parse_memory.
   add lasso_xml_parse_memory_with_error which instead of logging
   errors, can return the xmlError structure.
   add lasso_xmlsec_load_key_info, which allows to load keys from
   ds:KeyInfo XML nodes. It also support the "Lasso" bug of using
   ds:KeyValue directly to store base64 encoded keys and certificates.
2010-02-04 00:02:19 +00:00
Benjamin Dauvergne a237cd1057 Core: add simple function to load key from any format 2010-01-12 15:39:59 +00:00
Benjamin Dauvergne d42c16e239 Core Node: add args to lasso_node_encrypt to set recipient of an encrypted element 2010-01-12 15:39:57 +00:00
Benjamin Dauvergne ac3a687518 XML Core: in xml.c, private.h, add a lasso_node_remove_signature function 2010-01-12 15:39:42 +00:00
Benjamin Dauvergne d461fe3957 Core: in xml/private.h, add new field to LassoNodeClassData for private_key and certificate handling 2010-01-12 15:39:38 +00:00
Benjamin Dauvergne 4497b166bf XML: in private.h, remove duplicate declaration of lasso_xml_parse_memory 2010-01-04 09:14:29 +00:00
Benjamin Dauvergne 1d8bd498cd Core XML: in xml/tools.c, add conversion method from iso8601 to time_t
* lasso/xml/tools.c:
   add function lasso_iso_8601_gmt_to_time_t
 * lasso/xml/private.h:
   declare new function.
2010-01-04 09:13:55 +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 de375da682 XML: Add time formatting function for ISO 8601 format
* xml/private.h:
 * xml/tools.c:
   add util function to format time_t values in the ISO 8601 format.
2009-08-26 15:13:41 +00:00
Benjamin Dauvergne 28bdebee52 XML: add API to simplify evaluation of XPath expressions
* lasso/xml/tools.c,lasso/xml/private.h:
  - lasso_eval_xpath_expression(xmlXPathContextPtr xpathCtx,
    const char *expression, xmlXPathObjectPtr *xpathObjectPtr,
    int *xpathErrorCode) is a boolean returning function handling call
    to libxml API to evaluate en XPath expression in the xpathCtx
    context. It eventually save the returned nodeset in the variable
    pointed by xpathObjectPtr if it is not-NULL
    (and eventually deallocate previous value)
    and if an error happend it copy its code into the variable
    pointed to by xpathErrorCode if it is not NULL.
2009-08-26 15:12:46 +00:00
Benjamin Dauvergne ed5e0fce15 Add a new internal API for parameters building
* xml/tools.c:
   add lasso_url_add_parameter that concat the string &key=value to an
   existing URL where key and value are url-encoded.
 * xml/private.h:
   declare lasso_url_add_parameter.
2009-04-22 23:49:19 +00:00
Benjamin Dauvergne 71ca7129a6 XML: Add const modifiers to lasso_concat_url_query arguments
* lasso/xml/private.h, lasso/xml/tools.c: add const modifier to
   lasso_concat_url_query arguments.
2009-03-27 15:05:42 +00:00
Benjamin Dauvergne f604d63268 XML: Remove static modifier on lasso_node_build_query
* lasso/xml/private.h, lasso/xml/xml.c: remove static modifier to
   lasso_node_build_query and export it for use in id-ff profiles.
2009-03-27 15:05:41 +00:00
Benjamin Dauvergne 96594a8ede XML: Tool function to extract relaystate from query
* lasso/xml/tools.c, lasso/xml/private.h: new function
   lasso_get_relaystate_from_query to help in relaystate handling.
2009-03-27 15:05:39 +00:00
Benjamin Dauvergne 580239d233 Core: move parse xml wrapper from xml.c to tools.c
* lasso/xml/xml.c:
   remove lasso_xml_parse_memory.
 * lasso/xml/tools.c:
   add lasso_xml_parse_memory to wrap xmlParseDocument.
 * lasso/saml-2.0/name_id_management.c:
   use lasso_xml_parse_memory
2009-03-27 15:05:19 +00:00
Benjamin Dauvergne d81f986451 SAML 2.0: replace lasso_node_decrypt by lasso_node_decrypt_xmlnode
* lasso/xml/private.h:
 * lasso/xml/tools.c:
   replace implementation of lasso_node_decrypt by a new one called
   lasso_node_decrypt_xmlnode, and use it where old one was used.
2009-03-27 15:05:10 +00:00
Benjamin Dauvergne a475d9eb00 Core: add new internal API lasso_provider_verify_query_signature
* lasso/id-ff/provider.c:
   try to keep some homgeneity between lasso_verify_signature and
   lasso_verify_query_signature functions, by having mirror methods
   inside the LassoProvider class. this new methods comes with complete
   documentation.
 * lasso/xml/tools.c:
   add a xmlDoc argument to lasso_verify_signature, in order to
   reuse an already built message context, and possible problems with
   interned string in parsed xml documents.
2009-03-27 15:05:00 +00:00
Benjamin Dauvergne 9bd1c6a446 Core: new init method with format limit and xmlDoc output argument
* lasso/xml/private.h:
 * lasso/xml/xml.c:
   lasso_node_init_from_message_with_format permit to initialize a node
   and to keep the corresponding xml document, in order for example to
   validate a signature.
 * lasso/xml/tools.c:
   lasso_xml_parse_message is able to parse a message of any type, or of
   a given type. If a message of another than the one specified is
   found, the call fails, and a LASSO_MESSAGE_FORMAT_ERROR is returned.
2009-03-27 15:04:53 +00:00
Benjamin Dauvergne 6109e1b71b Core: add function to extract SOAP message content
* lasso/xml/tools.c:
   add lasso_xml_is_soap, to verify that a message is SOAP.
   add lasso_xml_get_soap_content, to retrieve the first child of the
   SOAP body, whatever the SOAP content version.
2009-03-27 15:04:51 +00:00
Benjamin Dauvergne 12744e44fe SAML 2.0: API for Saml2EncryptedElement decrypt
* lasso/xml/xml_enc.h:
   remove old functions
 * lasso/xml/private.h:
   remove lasso_node_(de/en)crypt from public headers API, they were not
   exported anyway. move them to internal header.
 * lasso/xml/saml-2.0/saml2_encrypted_element.{c,h}:
   add a new decrypt function to convert a EncryptedElement to the
   contained encrypted node objects.
 * bindings/overrrides.xml:
   do not export the new method, wait for implementation of output
   arguments.
 * lasso/id-ff/server.c:
   remove lasso_decrypt_nameid from lasso/id-ff/server.c
2009-03-27 15:04:49 +00:00
Benjamin Dauvergne 7f09fe60de Fix bug #94: permit any content for AttributeValue
* lasso/xml/private.h:
 * lasso/xml/xml.h
 * lassoi/xml/xml.c:
   add an implementation helper for the AttributeValue objects
   implementation of get_xmlNode.
   make lasso_node_set_original_xmlnode public API.
 * lasso/xml/saml-2.0/samlp2_extensions.c:
 * lasso/xml/saml-2.0/saml2_attribute_value.c:
 * lasso/xml/saml_attribute_value.c:
   implement get_xmlNode for the AttributeValue and Extensions objects.
   If the any field is empty, use the original_xmlnode value.  In order
   to support free-style content, you must use the method
   lasso_node_set_original_xmlnode, properties and children are
   extracted from the given node and added to the node created by the
   generic get_xmlNode virtual method.
2009-03-27 15:04:41 +00:00
Benjamin Dauvergne a017ddc81e XML Core: add new snippet type SNIPPET_KEEP_XMLNODE
* private.h:
   add the new constant to the enum type
 * xml.c:
   fix lasso_node_traversal, add support for the new contanst in
   lasso_node_imp_init_from_xmlNode.
2009-03-27 15:04:40 +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 7da0401919 Core: enforce flag verify-signature in function lasso_verify_signature
* lasso/xml/tools.c: in lasso_verify_signature always return success if
   lasso_flag_verify_signature is FALSE.
 * lasso/xml/private.h: change return type to int.
2009-03-03 20:52:37 +00:00
Benjamin Dauvergne a3daa0d665 XML: Add internal API to validate XMLDsig signatures
* lasso/xml/tools.c:
  - lasso_saml_constrain_dsigctxt() add constraints following SAML
    specifications on XMLDsig signatures to an libxmlsec DSig context.
  - lasso_verify_signature() this function given an xmlNode and a key or
    a keys manager (for a set of AC or AC chains) validate the
    envelopped signature set upon this node. It can be instructed to
    follow constraints of the SAML 1.0 specification.
2009-01-24 09:33:50 +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 b332d295da Add keep_xmlnode field to LassoNodeClassData
* lasso/xml/private.h: add a boolean flag named keep_xmlnode to
   base class structure LassoNodeClassData.
2008-11-03 14:15:40 +00:00
Benjamin Dauvergne 9ed0670e48 * Remove ending blanks 2008-09-12 15:06:58 +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
Benjamin Dauvergne 540f540e8c fix typo 2008-08-01 14:07:22 +00:00
Benjamin Dauvergne 23fc1c54f1 add function to load a public key from anything 2008-08-01 14:07:15 +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
Damien Laniel 3d44594077 fixed gcc warnings 2007-06-07 09:17:22 +00:00
Frédéric Péters 4b5d132972 extended xml_insure_namespace so it creates the namespace itself, after having
looked for a preexisting namespace; the function was previously called with ns
== NULL, which caused namespace to be *removed* from elements (ns was NULL
because xmlNewNs will return NULL when the namespace is already defined).
2007-06-07 00:20:07 +00:00
Damien Laniel 04940cd362 added service.data and lasso_idwsf2_data_service_build_query_response_msg 2007-06-05 17:36:09 +00:00
Damien Laniel 4fc6657e0c updated Copyright dates in all files 2007-05-30 17:17:45 +00:00
Frédéric Péters 271ee2f988 don't put text nodes in list nodes unless SNIPPET_ALLOW_TEXT is set 2007-05-02 13:09:51 +00:00
Frédéric Péters e87094e76a Added (and documented) new members to snippet, necessary to fix namespace for
saml:AuthnContextClassRef used in samlp:RequestedAuthnContext
2006-12-16 09:47:16 +00:00
Damien Laniel 3bf1a98f26 Added EncryptedID as SNIPPET_XMLNODE in Subject in Assertion 2006-11-13 12:06:30 +00:00
Frédéric Péters aec4544976 fixed url/query construction for endpoints with query part (zxid) 2006-11-07 12:44:32 +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 cb113f451b starting to commit SAML 2 changes; minor changes (and bugfix) to
lasso_node_new_from_xmlNode as well as code to recreate SAML2 object from SAML2
query string.
2005-11-13 22:46:36 +00:00
Frédéric Péters 113a4456c8 signedness change to lasso_query_sign (does not break API/ABI) 2005-07-08 10:19:49 +00:00
Frédéric Péters 397e980c6c loads public key into xmlSecKey on LassoProvider instanciation; this merges
signature verification in XML messages and in query strings.
2005-04-25 10:43:48 +00:00
Romain Chantereay 532be692e0 g_vsnprintf taked the place of vsnprintf. 2005-02-11 12:05:30 +00:00
Frédéric Péters 522c53f21c removed unecessary vsnprintf declaration 2005-02-10 15:03:43 +00:00