Projet

Général

Profil

Bug #86076

Exporter les fonctions sur les méthodes de signature

Ajouté par Benjamin Dauvergne il y a 3 mois. Mis à jour il y a 3 mois.

Statut:
Résolu (à déployer)
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
24 janvier 2024
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Reported by Vita Batrla on mailing list :

Hello all,

I build Apache's mellon authentication module from the source code on a
machine that is installed with latest lasso library built again from the
source code. The result is failure. The web server is unable to load
mod_auth_mellon.so binary due to missing symbol:

lasso_get_min_signature_method

The symbol is defined in lasso source code, but not exported.
It's missing in liblasso.so binary.

Looking at history, the symbol lasso_get_min_signature_method was
added by commit:

https://dev.entrouvert.org/projects/lasso/repository/33/revisions/f9a3aca0cb31a412faae25dd9fdbbf3fb61cb62f

However, the symbol was not made for export.
Then there are inline functions in the same header file:

lasso_allowed_signature_method()
lasso_ok_signature_method()

, both either directly or indirectly depend on lasso_set_min_signature_method().
The problem is that lasso_allowed_signature_method() is an inline function
and directly calls lasso_get_min_signature_method(). Any consumer calling it
will then require definition of lasso_get_min_signature_method() function,
but since the symbol is local, it won't be resolved from liblasso.so library.

See:

https://dev.entrouvert.org/projects/lasso/repository/33/revisions/main/entry/lasso/xml/xml.h

The following patch resolves the problem (workaround):

diff rup lasso-2.8.2.orig/lasso/xml/xml.h lasso-2.8.2/lasso/xml/xml.h
--
lasso-2.8.2.orig/lasso/xml/xml.h 2023-09-04 13:17:29.549728470 0200
++ lasso-2.8.2/lasso/xml/xml.h 2023-09-04 13:18:46.282409575 +0200
@ -122,7 +122,7 @ LassoSignatureMethod lasso_get_default_s

void lasso_set_default_signature_method(LassoSignatureMethod meth);

-LassoSignatureMethod lasso_get_min_signature_method();
+LASSO_EXPORT LassoSignatureMethod lasso_get_min_signature_method();

void lasso_set_min_signature_method(LassoSignatureMethod meth);

With the above patch, the mod_auth_mellon.so loads fine, no unresolved symbol
from liblasso.so. If I'm right there are three alternative approaches to
fix the problem:

  • remove the inline keyword from lasso/xml/xml.h completely,
    move all function definitions to .c file
  • define lasso_get_min_signature_method() in header file and make it inline
  • make lasso_get_min_signature_method() exported symbol

each way from above has little bit different low level performance impact (number of call instructions in assembly language), but I'm unsure if the performance is the key question here.

Thanks,

Vita

Révisions associées

Révision 253e8abe (diff)
Ajouté par Benjamin Dauvergne il y a 3 mois

xml: export lasso_get_min_signature method function (#86076)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a 3 mois

  • Assigné à mis à Benjamin Dauvergne
#2

Mis à jour par Robot Gitea il y a 3 mois

  • Statut changé de Nouveau à Solution proposée

Benjamin Dauvergne (bdauvergne) a ouvert une pull request sur Gitea concernant cette demande :

#3

Mis à jour par Robot Gitea il y a 3 mois

  • Statut changé de Solution proposée à Résolu (à déployer)

Benjamin Dauvergne (bdauvergne) a mergé une pull request sur Gitea concernant cette demande :

Formats disponibles : Atom PDF