Commit Graph

135 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 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 713ae637a8 XML: add documentation for lasso_eval_xpath_expression
* lasso/xml/tools.c: add documentation for xpath helper evaluation
  function lasso_eval_xpath_expression.
2009-08-26 15:13:36 +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 70b466c6c2 Fix leak in lasso_url_add_parameters
* lasso/xml/tools.c:
   in lasso_url_add_parameters free intermediate strings.
2009-04-30 14:58:03 +00:00
Benjamin Dauvergne ecb84ebd1d fix: in lasso_verify_signature() only look for the first direct child Signature element
* lasso/xml/tools.c:
   in SAML message signatures are usually envelopped signatures, so just
   lookup for the first direct child which is a Signature node.
2009-04-27 08:19:28 +00:00
Benjamin Dauvergne 52e60ecb09 Rework cleanup handling
* lasso/utils.h:
   change 'goto exit' for 'goto cleanup'. rename all goto_exit macros to
   goto_cleanup_.  rename goto_cleanup_if_fail to
   goto_cleanup_if_fail_with_rc and add a
   goto_cleanup_if_fail for function which do not return an integer
   value. add documentation for goto_cleanup macro family.
 * lasso/id-ff/login.c:
 * lasso/id-ff/provider.c:
 * lasso/id-ff/server.c:
 * lasso/id-ff/session.c:
 * lasso/id-wsf/discovery.c:
 * lasso/id-wsf/wsf_profile.c:
 * lasso/saml-2.0/profile.c:
 * lasso/utils.h:
 * lasso/xml/lib_logout_request.c:
 * lasso/xml/tools.c:
 * lasso/xml/xml.c:
   update name of goto_exit_if_fail macros. rename 'exit' labels to
   'cleanup'.
2009-04-22 23:49:29 +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 dac53715ea Core: Add cast to first argument of isalnum
* lasso/xml/xml.c:
 * lasso/xml/tools.c:
   isalnum takes a int as first arg.
2009-04-14 07:51:25 +00:00
Benjamin Dauvergne 60018bbb4d XML: fix memory leaks
* lasso/xml/tools.c:
 * lasso/xml/xml.c:
   release xmlDoc, properly steal nodes by using xmlSetTreeDoc(xmlnode, NULL);
2009-03-27 15:06:30 +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 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 642dcfdfbb Core: use lasso_xml_parse_memory instead of xmlParseDoc
* lasso/id-ff/provider.c:
   use internal wrapper instead of direct call to libxml for parsing.
2009-03-27 15:05:21 +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 d4e218dfeb Core: handle g_io_channel creation failure
* lasso/xml/tools.c:
   in lasso_load_certs_from_pem_certs_chain_file if
   g_io_channel_new_file fails return NULL and print a warning.
   If path is NULL or 0-length also returns NULL.
2009-03-27 15:04:33 +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 68eaafa6e7 Core: synchronize lasso_verify_signature with new macros 2009-01-24 09:34:16 +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
Frédéric Péters 1c3761b2c1 correctly check for successful return of DSA_verify 2008-12-18 16:05:44 +00:00
Benjamin Dauvergne adf6e9cb01 Add support to in memory private key to lasso_query_sign
- lasso/xml/tools.c: use BIO_new_mem_buf instead of BIO_new_file
   if private_key is not an existing file.
2008-11-10 16:57:36 +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 e6dfd11cd4 First try accessing the file before calling key loading functions
* lasso/xml/tools.c: (lasso_sign_node) instead of waiting
  for the xmlsec key loading function to fail before trying to load
  the key directly from the private_key buffer, test it using
  POSIX function.
2008-11-02 11:49:51 +00:00
Benjamin Dauvergne 1032903f49 Add possibility to sign using preloaded keys
* lasso/xml/tools.c:
 - (lasso_sign_node) if loading of the private_key or the certificate
   file we try to use the filename directly as a key in the PEM format.
2008-11-02 11:49:49 +00:00
Benjamin Dauvergne ef42f2cbc8 add functionality to enable debugging flags at runtime
This code permit to set flags, separated by commas, space,
tabulations, or colons. This flags activates debug functions like,
suppressing validations of signatures or print debugging message about
deallocations.

The new flags are defined in /lasso/debug.h they can be set using an
environment variable named LASSO_FLAG or a function named
lasso_set_flag.

There are two flags currently:
- verify-signature:
  To deactivate it, pass 'no-verify-signature' inside LASSO_DEBUG.
  It desactivate signature verification, inside two functions:
  lasso_query_verify_signature and lasso_provider_verify_signature.
- memory-debug:
  It enabled reporting of memory deallocation inside generic memory
  dellaocator for LassoNode objects and also in bindings.

- lasso/xml/xml.c: do not free a null hash table pointer.
2008-10-01 10:31:58 +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
Benjamin Dauvergne 8ecaefc7fa * lasso/xml/tools.c: In lasso_sign_node suppress useless code to lookup the Signature node. 2008-08-01 14:10:36 +00:00
Benjamin Dauvergne 76d9fce5d5 forked lasso branch for adeline 2008-08-01 14:08:54 +00:00
Benjamin Dauvergne 31dd618a82 fix typo on name of an xmlsec function 2008-08-01 14:08:37 +00:00
Benjamin Dauvergne 23fc1c54f1 add function to load a public key from anything 2008-08-01 14:07:15 +00:00
Damien Laniel 4fc6657e0c updated Copyright dates in all files 2007-05-30 17:17:45 +00:00
Frédéric Péters b189415e39 mitigate memory leak (?) 2007-01-07 12:17:30 +00:00
Frédéric Péters 8d4ac988a5 unfixed memory leak, because strange manipulations to xmlnode structures
could cause memory corruption
2007-01-07 10:53:06 +00:00
Frédéric Péters 4075a1f529 even more memory leak tracking 2007-01-05 13:59:08 +00:00
Frédéric Péters 38e9d70391 directly include headers from xmlsec/openssl/; at least required to compile on
Fedora Cora 6.
2007-01-04 15:13:59 +00:00
Frédéric Péters d5c4e974eb coding style improvements 2006-12-28 10:56:13 +00:00
Frédéric Péters 1b0f96f6c7 fixed a few (harmless) warnings detected when compiling with -Wall
-Wmissing-declarations -Wdeclaration-after-statement
2006-12-21 00:03:08 +00:00
Damien Laniel 13f707bf30 Allow the choice of the encryption algorithm to use 2006-12-20 09:03:41 +00:00
Damien Laniel 85ce95f4e5 Fixed a few warnings with -Wall 2006-12-02 11:53:32 +00:00
Frédéric Péters 2b4627a885 fixing memory leaks, side effects and more in EncryptedAssertion 2006-11-30 11:04:57 +00:00
Damien Laniel 13162187b9 Moved assertion encryption code out of saml2_response.c to tools.c 2006-11-29 15:52:02 +00:00
Frédéric Péters df367439b7 removed unused variable 2006-11-27 20:11:09 +00:00
Frédéric Péters be247a65fa fixed pkey memory leak 2006-11-21 17:52:31 +00:00