Commit Graph

5704 Commits

Author SHA1 Message Date
Frédéric Péters d4259f0517 debian: sync bullseye packaging with upstream debian.org (#58788) 2021-11-20 10:20:20 +01:00
Frédéric Péters 71d4bf9c08 debian: init debian-bullseye as a copy of debian buster (#58788) 2021-11-20 10:20:20 +01:00
Benjamin Dauvergne a28fb8c8e1 Does not decref boolean constants (#57268)
TRUE/FALSE are special references in CPython bindings whose reference
count must never be updated.
2021-09-28 10:23:10 +02:00
Benjamin Dauvergne d80357e226 Keep ABI stability (#56883)
The following functions where part of the experimental ID-WSF support
recently removed but where incorrectly included in the official ABI, so we
restore dummy versions of them (they do nothing or return NULL):
- lasso_get_prefix_for_dst_service_href
- lasso_get_prefix_for_idwsf2_dst_service_href
- lasso_register_dst_service
- lasso_register_idwsf2_dst_service
2021-09-13 12:13:11 +02:00
Benjamin Dauvergne aab962cb69 debian: update liblasso3.symbols 2021-09-11 22:19:15 +02:00
Benjamin Dauvergne 23035115a3 Clear Python error indicator after logging (#56572)
Lasso log using the GLib logging API and the Python binding install a
hook to delegate logging to a Python logger named "lasso".

During the logging call the error indicator can be set to signal an
exception. The indicator will still be set when we return from the Lasso
API call, and is not handled by the Python wrapping of the C functions.
If our function returns a non-NULL value, the Python interpreter will
raise because this situation is forbidden.

To prevent it, if we detect that an exception occurred during logging
calls, we print it to stderr, clear the error indicator and return
immediately.
2021-09-11 19:20:25 +02:00
Benjamin Dauvergne 53b0bd3569 Change default key encryption padding algorithm to RSA-OAEP (#56023)
The key encryption padding algorithm is now configurable, the default
being changed to OAEP. It's possible to set the default through
./configure with:

    --with-default-key-encryption-method=[rsa-pkcs1|rsa-oaep]

at initialization time with an environment variable:

    LASSO_DEFAULT_KEY_ENCRYPTION_METHOD=[rsa-pkcs1|rsa-oaep]

or at runtime for a service provider:

    lasso_provider_set_key_encryption_method(LassoProvider *provider,
        LassoKeyEncryptionMethod key_encryption_method)

The setting is global for all encrypted nodes (Assertion or NameID).
2021-09-11 19:20:04 +02:00
Benjamin Dauvergne 1e718bd3aa Python: fix formatting (#56023) 2021-09-11 19:19:59 +02:00
Benjamin Dauvergne 906edf5599 Remove win32 directory (#56645)
It's obsolete.
2021-09-11 19:07:50 +02:00
Benjamin Dauvergne 4a880977d1 Remove ID-WSF 1.0, 2.0 and WS-* support (#56644)
It has been deprecated for a long time.
2021-09-11 18:54:41 +02:00
Benjamin Dauvergne d4ccf15902 Fix warning about int conversion
saml2_authn_context.c:77:3: warning: initialization of ‘unsigned int’ from ‘void *’
    makes integer from pointer without a cast [-Wint-conversion]
2021-09-03 10:14:24 +02:00
Benjamin Dauvergne 663c094ec7 Prevent multiple OneTimeUse elements (#52961)
"A SAML authority MUST NOT include more than one <OneTimeUse> element within a
<Conditions>element of an assertion"
2021-07-16 14:36:32 +02:00
Benjamin Dauvergne 149de8cd0b python: clear warnings about PY_SSIZE_T_CLEAN (#55561)
Using the python3 bindings on recent python3 >=3.8 versions shows:

   DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats

https://docs.python.org/3.9/whatsnew/changelog.html?highlight=py_ssize_t_clean#id193
2021-07-13 13:21:13 +02:00
Benjamin Dauvergne b6321b4db2 python: clear warnings about assertX methods (#55561) 2021-07-13 13:20:47 +02:00
Jakub Hrozek 1b0000e016 test13_test_lasso_server_load_metadata: Don't verify signature if lasso is not configured with sha-1 (#54037) 2021-06-24 02:15:27 +02:00
Jakub Hrozek f70eee9ef7 python: Skip the DSA key test unless SHA-1 is configured (#54037)
lasso supports DSA-XXX only with SHA-1. The alternative is to use
DSA-SHA256.
2021-06-24 02:15:23 +02:00
Jakub Hrozek f9a3aca0cb Check if the signature method is allowed in addition to being valid (#54037)
Adds a new utility function lasso_allowed_signature_method() that checks
if the signature method is allowed. Previously, the code would only
check if the method was valid.

This new function is used whenever lasso_validate_signature_method was
previously used through lasso_ok_signature_method() which wraps both
validate and allowed.

lasso_allowed_signature_method() is also used on a couple of places,
notably lasso_query_verify_helper().

Related:
https://dev.entrouvert.org/issues/54037
2021-06-24 02:15:17 +02:00
Jakub Hrozek 0d34c97be1 Mass-replace LASSO_SIGNATURE_METHOD_RSA_SHA1 with lasso_get_default_signature_method() (#54037)
This should be backwards-compatible but at the same time use the
selected default instead of RSA-SHA1.

Related:
https://dev.entrouvert.org/issues/54037
2021-06-23 23:32:33 +02:00
Jakub Hrozek f095ac8f57 Make the default signature method and the minimal hash strength configurable (#54037)
Adds two new configure options:
    --with-default-sign-algo
    --min-hash-algo

--with-default-sign-algo sets the default signing algorithm and defaults
to rsa-sha1. At the moment, two algorithms are supported: rsa-sha1 and
rsa-sha256.

--min-hash-algo sets the minimum hash algorithm to be accepted. The
default is sha1 for backwards compatibility as well.

Related:
https://dev.entrouvert.org/issues/54037
2021-06-23 23:32:29 +02:00
Jakub Hrozek f625eaa007 tests: Move test08_lasso_key and test07_saml2_query_verify_signature to SHA256 (#54037)
These tests use a hardcoded query and private key which makes it
unsuitable to make the tests use the configured default digest. Let's
just convert them to SHA256 unconditionally.
2021-06-23 23:32:26 +02:00
Jakub Hrozek 8b8fd22a16 Fix lasso_query_sign HMAC other than SHA1 (#54037)
The switch clause was using SHA1 digests for all digest types when
signing. This obviously breaks verifying the signatures if HMAC-SHAXXX
is used and XXX is something else than 1.
2021-06-23 23:32:12 +02:00
Benjamin Dauvergne 076a37d7f0 Release 2.7.0 2021-06-01 11:56:05 +02:00
Benjamin Dauvergne ea7e5efe97 Fix signature checking on unsigned response with multiple assertions
CVE-2021-28091 : when AuthnResponse messages are not signed (which is
permitted by the specifiation), all assertion's signatures should be
checked, but currently after the first signed assertion is checked all
following assertions are accepted without checking their signature, and
the last one is considered the main assertion.

This patch :
* check signatures from all assertions if the message is not signed,
* refuse messages with assertion from different issuers than the one on
  the message, to prevent assertion bundling event if they are signed.
2021-06-01 11:50:53 +02:00
Benjamin Dauvergne d9db91ec9f Jenkinsfile: update name of main branch 2021-04-07 18:06:11 +02:00
Benjamin Dauvergne bd7acfd2f3 Python: improve display of warnings in the binding generator 2021-03-09 10:36:40 +01:00
Benjamin Dauvergne f912e8d1ef replace deprecated index() by strchr() (#51385) 2021-02-26 16:31:53 +01:00
Benjamin Dauvergne cbbea83e3f Fix: new provider reference count is incremented one time too many (#51420) 2021-02-25 10:10:03 +01:00
Benjamin Dauvergne 3d6bc26021 docs: update gtk-doc-tools integration (#50441)
Using reference documentation on https://developer.gnome.org/gtk-doc-manual/stable/index.html.en
2021-02-24 23:13:49 +01:00
Benjamin Dauvergne 9b1e68f683 bindings: disable java tests when java is disabled 2021-02-24 23:01:08 +01:00
Benjamin Dauvergne 2dbca5edf3 Fix: python3 bindings (#51249)
The __str__ method called itself, resulting in an RecursionError.

======================================================================
ERROR: test14 (__main__.BindingTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./binding_tests.py", line 336, in test14
    assert isinstance(str(cm.exception), str)
  File "../lasso.py", line 69, in __str__
    return '<lasso.%s: %s>' % (self.__class__.__name__, self)
  File "../lasso.py", line 69, in __str__
    return '<lasso.%s: %s>' % (self.__class__.__name__, self)
  File "../lasso.py", line 69, in __str__
    return '<lasso.%s: %s>' % (self.__class__.__name__, self)
  [Previous line repeated 489 more times]
  File "../lasso.py", line 68, in __str__
    if sys.version_info >= (3,):
RecursionError: maximum recursion depth exceeded in comparison

----------------------------------------------------------------------
2021-02-24 22:59:30 +01:00
Benjamin Dauvergne 86aa6a602f configure.ac: disable java bindings 2021-02-23 21:10:11 +01:00
Frédéric Péters 34ad2ce2dc build: update to use origin/main 2020-12-26 15:22:15 +01:00
Benjamin Dauvergne f465304319 debian: add packaging for debian-buster 2020-10-12 15:26:14 +02:00
Benjamin Dauvergne 0d0e5286a7 jenkins.sh: build against all available python versions (#44287) 2020-10-12 15:25:01 +02:00
Benjamin Dauvergne 6c166563b2 python: do not leak out_pyvalue if method call protocol is not respected (#44287) 2020-10-12 15:25:01 +02:00
Benjamin Dauvergne 4696e2709b python: do not raise in valid_seq() (#44287) 2020-10-12 15:25:01 +02:00
Benjamin Dauvergne 77bed35c42 python: return NULL if get_list_of_strings() fails (#44287) 2020-10-12 15:25:01 +02:00
Benjamin Dauvergne 5f5bc888b1 python: return NULL if get_list_of_pygobject fails (#44287) 2020-10-12 15:25:01 +02:00
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