Projet

Général

Profil

Development #71313

compatibilité xmlsec 1.2.35 (openssl 3?)

Ajouté par Frédéric Péters il y a plus d'un an. Mis à jour il y a plus d'un an.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
15 novembre 2022
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Dans debian est arrivé xmlsec 1.2.36 (c'était 1.2.34 avant);

October 31 2022
The XML Security Library 1.2.36 release includes the following changes:

  • Retired the XMLSec mailing list "" and the XMLSec Online Signature Verifier.
  • Several other small fixes (more details).

October 25 2022
The XML Security Library 1.2.35 release includes the following changes:

  • Migration to OpenSSL 3.0 API (based on PR by @snargit). Note that OpenSSL engines are disabled by default when XMLSec library is compiled against OpenSSL 3.0. To re-enable OpenSSL engines, use "--enable-openssl3-engines" configure flag (there will be a lot of deprecation warnings).
  • The OpenSSL before 1.1.0 and LibreSSL before 2.7.0 are now deprecated and will be removed in the future versions of XMLSec Library.
  • Refactored all the integer casts to ensure cast-safety. Fixed all warnings and enabled "-Werror" and "-pedantic" flags on CI builds.
  • Added configure flag to use size_t for xmlSecSize (currently disabled by default for backward compatibility).
  • Moved all CI builds to GitHub actions.
  • Several other small fixes (more details).

cette montée de version fait échouer lasso de diverses manières; sur l'initiation d'un SSO,

lasso:ERROR:tools.c:586:lasso_query_sign: assertion failed: (rsa)
Bail out! lasso:ERROR:tools.c:586:lasso_query_sign: assertion failed: (rsa)

Fichiers

0001-wip.patch (25 ko) 0001-wip.patch Benjamin Dauvergne, 15 novembre 2022 17:12
0007-Fix-use-of-wrong-enumeration-NULL-value-71313.patch (869 octets) 0007-Fix-use-of-wrong-enumeration-NULL-value-71313.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0009-Fix-warning-about-enum-conversion-71313.patch (810 octets) 0009-Fix-warning-about-enum-conversion-71313.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0001-Use-OpenSSL-EVP-API-to-work-around-deprecation-of-lo.patch (19,6 ko) 0001-Use-OpenSSL-EVP-API-to-work-around-deprecation-of-lo.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0010-Fix-all-cast-function-type-warnings-71313.patch (16,3 ko) 0010-Fix-all-cast-function-type-warnings-71313.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0006-Fix-warnings-about-type-casts-71313.patch (1,13 ko) 0006-Fix-warnings-about-type-casts-71313.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0003-Make-lasso_inflate-output-the-inflated-buffer-size-7.patch (1 ko) 0003-Make-lasso_inflate-output-the-inflated-buffer-size-7.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0008-Fix-all-warnings-in-tests-71313.patch (106 ko) 0008-Fix-all-warnings-in-tests-71313.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0002-Add-new-define-LASSO_XMLSEC_VERSION_NUMBER-allow-ver.patch (1,14 ko) 0002-Add-new-define-LASSO_XMLSEC_VERSION_NUMBER-allow-ver.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0011-Fix-unused-parameters-warnings-71313.patch (1,27 ko) 0011-Fix-unused-parameters-warnings-71313.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0005-Replace-all-use-of-xmlSecBase64Decode-by-lasso_base6.patch (17,5 ko) 0005-Replace-all-use-of-xmlSecBase64Decode-by-lasso_base6.patch Benjamin Dauvergne, 16 novembre 2022 18:56
0004-Adapt-lasso_base64_decode-to-the-deprecation-of-xmlS.patch (2,25 ko) 0004-Adapt-lasso_base64_decode-to-the-deprecation-of-xmlS.patch Benjamin Dauvergne, 16 novembre 2022 18:56

Révisions associées

Révision 66ebd111 (diff)
Ajouté par Benjamin Dauvergne il y a plus d'un an

Use OpenSSL EVP API to work around deprecation of low level APIs in OpenSSL 3 (#71313)

OpenSSL API is used to sign query-string values in the SAML 2.0 Redirect binding.
Other binding only need the libxmlsec API as signature are XML DSIG signatures.

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus d'un an

La source du problème c'est qu'OpenSSL a déprécié les fonctions bas niveaux (RSA_sign, structure RSA) et en mode OpenSSL 3 pure xmlsec ne les expose donc plus, ça casse notre support des signatures avec le binding GET (signature de texte et pas XML) :

/**
 * xmlSecOpenSSLKeyDataRsaGetRsa:
 * @data:               the pointer to RSA key data.
 *
 * DEPRECATED. Gets the OpenSSL RSA key from RSA key data.
 *
 * Returns: pointer to OpenSSL RSA key or NULL if an error occurs.
 */
RSA*
xmlSecOpenSSLKeyDataRsaGetRsa(xmlSecKeyDataPtr data) {
#ifndef XMLSEC_OPENSSL_API_300
    EVP_PKEY* pKey;

    xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecOpenSSLKeyDataRsaId), NULL);

    pKey = xmlSecOpenSSLKeyDataRsaGetEvp(data);
    xmlSecAssert2((pKey == NULL) || (EVP_PKEY_base_id(pKey) == EVP_PKEY_RSA), NULL);

    return((pKey != NULL) ? EVP_PKEY_get0_RSA(pKey) : NULL);
#else /* XMLSEC_OPENSSL_API_300 */
    UNREFERENCED_PARAMETER(data);
    xmlSecNotImplementedError("OpenSSL 3.0 does not support direct access to RSA key");
    return(NULL);
#endif /* XMLSEC_OPENSSL_API_300 */
}

Je suppose qu'il va falloir reconstruire tout ça au dessus des APIs haut-niveau EVP_* :/

#2

Mis à jour par Benjamin Dauvergne il y a plus d'un an

Avec ça les tests passent mais faut que je redécoupe, beaucoup de trucs sont devenus dépréciés un peu partou.

#3

Mis à jour par Benjamin Dauvergne il y a plus d'un an

Benjamin Dauvergne a écrit :

Avec ça les tests passent mais faut que je redécoupe, beaucoup de trucs sont devenus dépréciés un peu partout.

Bon ben va falloir gérer xmlsec pre et post 1.2.35 à cause de la dépréciation de xmlSecBase64Decode en plus de la migration vers l'API EVP d'OpenSSL.

#4

Mis à jour par Benjamin Dauvergne il y a plus d'un an

  • 0001: le patch en question
  • 0002/0003: réécriture pour prendre en compte que xmlSecBase64Decode est déprécié et que je n'ai aucune idée de quand elle sera définitivement retirée, j'ai mis un #if/#else/#endif pour que ça reste compilable avec libxmlsec<1.2.35
  • le reste, des corrections aux warnings il en reste trois sources :
    • g_type_class_add_private qui est déprécié et c'est le gros morceau en attente
    • des trucs autour de distutils dans configure.ac
    • des tas de dépréciations dans autoconf sur sid (je pense que ça peut attendre, c'est juste moche quand on fait autogen.sh)

Ce serait bien que ça passe vite que je puisse faire la release et que le paquet Debian soit correct pour le prochain freeze.

#5

Mis à jour par Frédéric Péters il y a plus d'un an

Pour info déjà,

 lasso (2.8.0-2) unstable; urgency=medium
 .
   * debian/patches/use-openssl-evp-api.diff: import upstream WIP patch for
     compatibility with latest xmlsec (closes: 1024138)

Uniquement 0001 donc, et je n'ai pas lu/testé les autres.

Note : dans la branche il y a avant ces commits des commits pas liés ("Release 2.8.1" et "Augment timeout on ECP tests").

#6

Mis à jour par Frédéric Péters il y a plus d'un an

  • Sujet changé de compatiblité xmlsec 1.2.35 (openssl 3?) à compatibilité xmlsec 1.2.35 (openssl 3?)
#7

Mis à jour par Benjamin Dauvergne il y a plus d'un an

J'ai réduit la branche au strict nécessaire et déplacer le reste dans d'autres tickets, si ça peut être validé.

#8

Mis à jour par Frédéric Péters il y a plus d'un an

  • Statut changé de Solution proposée à Solution validée

Uniquement 0001 donc, et je n'ai pas lu/testé les autres.

Donc la branche ramenée à 0001 c'est ok.

#9

Mis à jour par Benjamin Dauvergne il y a plus d'un an

  • Statut changé de Solution validée à Résolu (à déployer)
commit 66ebd11166038c23e642c4f9ed2f036815872e41
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Wed Nov 16 15:35:27 2022 +0100

    Use OpenSSL EVP API to work around deprecation of low level APIs in OpenSSL 3 (#71313)

    OpenSSL API is used to sign query-string values in the SAML 2.0 Redirect binding.
    Other binding only need the libxmlsec API as signature are XML DSIG signatures.
#10

Mis à jour par Transition automatique il y a 5 mois

Automatic expiration

Formats disponibles : Atom PDF