Commit Graph

5766 Commits

Author SHA1 Message Date
Benjamin Dauvergne 6ed8e04ff1 python: return NULL if get_list_of_xml_nodes fails (#44287) 2020-10-12 15:25:01 +02:00
Benjamin Dauvergne 4cf6bd4ff7 python: return NULL if set_list_of_pygobject fails (#44287) 2020-10-12 15:25:00 +02:00
Benjamin Dauvergne c844abd8e4 python: return NULL if set_list_of_xml_nodes fails (#44287) 2020-10-12 15:24:46 +02:00
Benjamin Dauvergne c53b6b5a73 python: return NULL if set_list_of_strings fails (#44287) 2020-10-12 15:24:45 +02:00
Benjamin Dauvergne ed528ce26a python: return NULL if set_hashtable_of_strings fails (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 57ee8d2f2a python: return NULL if set_hashtable_of_pygobject fails (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 8591451270 python: free internal string buffer if needed in set_list_of_strings (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne f80b2bb50e python: check if hashtable is NULL before deallocatio (#44287)n 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 0289da907f python: add a failure label to method wrappers (#44287)
To separate wrapping code from unwinding and error handling code.
2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 35682272ec python: add macro for early return (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 05dea2eab5 python: remove newline before method call (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 9db28c0c32 python: simplify get_logger_object (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne a8f82e67ef python: fix warning about discarded const modifier (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 637514a874 python: replace exception by warning on logging path (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 8ae9d3a09b python: use simpler call format to prevent warning about PY_SSIZE_T_CLEAN (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 11bc68bbbc python: remove deprecated PyErr_Warn (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne a1dbd489fc python: remove unused PyString_Size (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 04ded420c8 python: Exception.message was removed in python3 (#45995) 2020-08-21 11:48:19 +02:00
Benjamin Dauvergne 0b742b1f6d tools: reimplement xmlURIEscapeStr to respect RFC3986 (#45581)
Bugfix by Emmanuel Dreyfus.

License: MIT
2020-08-14 10:58:06 +02:00
Benjamin Dauvergne 15b8cd7ab1 configure.ac: support php7 interpreter on CentOS 8 (#42299) 2020-08-11 15:37:54 +02:00
Benjamin Dauvergne 4bae1c8b7c Release 2.6.1 2020-04-22 15:04:46 +02:00
Benjamin Dauvergne 92d12b9954 Keep order of SessionIndexes 2020-04-22 04:45:52 +02:00
Benjamin Dauvergne 55feba5762 Clear SessionIndex when private SessionIndexes is empty (#41950) 2020-04-22 04:30:27 +02: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
Benjamin Dauvergne 6a0708ed5c tests: fix compilation with check>0.12 (#39101) 2020-03-26 22:52:27 +01:00
Bernhard M. Wiedemann 1b51873ccf Sort input file lists (#40454)
so that lasso.py, lasso/types.c and liblasso.so.3.13.0
build reproducibly
in spite of indeterministic filesystem readdir order.
For some reason, lasso/extract_sections.py lasso/extract_symbols.py
do not need such patches to get a reproducible openSUSE package.

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.

License: MIT
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2020-03-05 12:51:17 +01:00
Benjamin Dauvergne af8f88cec5 debian: disable php7 (#28608) 2019-09-09 15:10:06 +02:00
Tomohiro "Tomo-p" KATO e2ec5a7349 Modify .gitignore for PHP 7 binding (#28608)
License: MIT
2019-09-09 15:10:06 +02:00
Tomohiro "Tomo-p" KATO 9c8c4b9937 Add PHP 7 binding (#28608)
License: MIT
2019-09-09 15:10:06 +02:00
Benjamin Dauvergne 37a0fa6f8b Fix tests broken by new DEBUG logs (#12829) 2019-09-09 13:31:49 +02:00
Benjamin Dauvergne db7e25287a Improve error logging during node parsing (#12829) 2019-09-06 15:32:51 +02:00
Benjamin Dauvergne caecf46be4 Improve configure compatibility (#32425) 2019-09-06 14:43:31 +02:00
Benjamin Dauvergne 84bc5b48d3 Improve compatibility with Solaris (#32425) 2019-09-06 14:42:44 +02:00
Benjamin Dauvergne 6c852f8c0b Fix reference count in lasso_server_add_provider2 (fixes #35061)
As implemented lasso_server_add_provider2 could not be used as a publik
API as it dit not increase the reference count of the LassoProvider
object before adding it to the providers hashtable.

lasso_server_add_provider_helper had to be modified to decrement the
reference count of the new LassoProvider object after using
lasso_server_add_provider2.
2019-09-05 12:42:01 +02:00
Benjamin Dauvergne 0a5a222e17 Fix python multi-version builds on jessie and stretch
debian/rules supposed that lasso Makefile would always prefer python2 to
python3, it's not the case anymore. Also recent python3 improvements to
bindings scripts did not work with python 3.5 on jessie (on jessie/3.5
default open() encoding is still ASCII not UTF-8 as with the default
UTF-8 of later python3 versions).
2019-09-05 10:34:22 +02:00
Thomas NOËL 18cc55d773 docs/xsltproc: do not use Internet to fetch DTDs, entities or documents (#35590) 2019-08-27 11:03:58 +02:00
Benjamin Dauvergne 3b72ad847c fix missing include <strings.h> for index() (fixes #33791)
tests/basic_tests.c:2141:7: warning: implicit declaration of function 'index' [-Wimplicit-function-declaration]
  qs = index(authnRequestUrl, '?') + 1;
       ^~~~~
tests/basic_tests.c:2141:7: warning: incompatible implicit declaration of built-in function 'index'
2019-07-04 16:12:42 +02:00
Dmitrii Shcherbakov 1e85f1b2bd PAOS: Do not populate "Destination" attribute
When ECP profile (saml-ecp-v2.0-cs01) is used with PAOS binding Lasso
populates an AuthnRequest with the "Destination" attribute set to
AssertionConsumerURL of an SP - this leads to IdP-side errors because
the destination attribute in the request does not match the IdP URL.

The "Destination" attribute is mandatory only for HTTP Redirect and HTTP
Post bindings when AuthRequests are signed per saml-bindings-2.0-os
(sections 3.4.5.2 and 3.5.5.2). Specifically for PAOS it makes sense to
avoid setting that optional attribute because an ECP decides which IdP
to use, not the SP.

Fixes Bug: 34409
License: MIT
Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
2019-07-03 23:54:57 +02:00
Benjamin Dauvergne 5853fbc150 export symbol lasso_log (#33784)
The symbol lasso_log has to be exported, otherwise Solaris run-time linker
fails due to an unresolved symbol dependency.
2019-07-02 11:57:08 +02:00
Benjamin Dauvergne 7c075657a4 tests: use self-generated certificate to sign federation metadata file (#33823)
Generation procedure :

	openssl genrsa -out rootCA.key 4096
	openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 99999 -out rootCA.crt
	openssl genrsa -out lasso.key 2048
	openssl req -new -sha256 -key lasso.key -subj "/C=FR/CN=Lasso" -out lasso.csr
	openssl x509 -req -in lasso.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out lasso.crt -days 99999 -sha256
	openssl pkcs12 -export -inkey lasso.key -password pass: -in lasso.crt -name lasso -out lasso.pkcs12
	xmlsec1 --sign --output renater.xml --trusted-pem rootCA.crt --pwd "" --pkcs12 lasso.pkcs12 metadata/renater-metadata.xml
	xmlsec1 --verify --trusted-pem rootCA.crt metadata/renater-metadata.xml
2019-06-11 10:10:42 +02:00
Benjamin Dauvergne b0fb24c951 Do not ignore WantAuthnRequestSigned value with hint MAYBE (fixes #33354)
Bug introduced in commit 394680712.
2019-05-23 10:11:09 +02:00
Benjamin Dauvergne 16aa8a7413 Use io.open(encoding=utf8) in extract_symbols/sections.py (fixes #33360) 2019-05-23 10:07:31 +02:00
Benjamin Dauvergne 151ad17e04 xml: adapt schema in saml2:AuthnContext (#29340)
saml2:AuthnContext XML schema indicate that AuthenticatingAuthority is
an optional unbounded list of nodes, but the current Lasso schema only
handle an unique element. To prevent Lasso from refusing perfectly legal
messages, we add a rule to the Lasso ignoring other nodes after the
first one.
2019-01-19 12:11:33 +01:00
John Dennis 642182bdf4 Fix ECP signature not found error when only assertion is signed (#26828)
With a SAML Authn Response either the message or the assertion
contained in the response message or both can be signed. Most IdP's
sign the message. This fixes a bug when processing an ECP authn
response when only the assertion is signed.

lasso_saml20_profile_process_soap_response_with_headers() performs a
signature check on the SAML message. A signature can also appear on
the assertion which is checked by
lasso_saml20_login_process_response_status_and_assertion() The problem
occurred when the message was not signed and
lasso_saml20_profile_process_soap_response_with_headers() returned
LASSO_DS_ERROR_SIGNATURE_NOT_FOUND as an error code which is not
actually an error because we haven't checked the signature on the
assertion yet. We were returning the first
LASSO_DS_ERROR_SIGNATURE_NOT_FOUND error when in fact the subsequent
signature check in
lasso_saml20_login_process_response_status_and_assertion() succeeded.

The ECP unit tests were enhanced to cover these cases.

The enhanced unit test revealed a problem in two switch statements
operating on the return value of
lasso_profile_get_signature_verify_hint() which were missing a case
statement for LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE which caused
an abort due to an unknown enumeration value.

Fixes Bug: 26828
License: MIT
Signed-off-by: John Dennis <jdennis@redhat.com>
2019-01-11 16:11:31 +01:00
Benjamin Dauvergne 580aca65b1 extract_types.py: force io to use UTF-8 encoding (fixes #27332) 2018-10-15 11:27:09 +02:00
Benjamin Dauvergne 14febd3c5f add Jenkinsfile 2018-10-14 22:33:31 +02:00
Benjamin Dauvergne 5070a06a9a xml: fix parsing of saml:AuthnContext (fixes #25640)
Decl/DeclRef are alternatives, when matching a Decl we should jump over
the DeclRef.
2018-10-14 20:35:45 +02:00
Benjamin Dauvergne 50b5cdac87 Remove -Werror from --enable-debugging (fixes #24771)
GCC 8 has better warnings and it breaks the build on platform already
using it and wanting debugging symbols.
2018-07-24 16:29:26 +02:00
Benjamin Dauvergne 62d2f4bff7 Move AC_SUBST declaration for AM_CFLAGS with alike (#24771)
Just to reorder things properly in configure.ac.
2018-07-24 12:39:19 +02:00
Benjamin Dauvergne 150de26bff Clean python cache when building python3 binding
Python3 store .pyc cache in hidden directory __pycache__, distcheck
complained that the source directory was not completely clean after a
distclean.
2018-07-24 11:29:28 +02:00