Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4052

Crypto cache issues and the PolicyBasedWSS4JInInterceptor used as a singleton

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.5, 2.5.2
    • 2.4.7, 2.5.3, 2.6
    • WS-* Components
    • None
    • JBossWS-CXF integration, using Apache CXF 2.4.x

    • Unknown

    Description

      When using WS-Policy to setup WS-Security interceptors, the WSSecurityInterceptorProvider runs:

      ...
      this.getInInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
      this.getInFaultInterceptors().add(PolicyBasedWSS4JInInterceptor.INSTANCE);
      ...
      

      which causes the same instance of PolicyBasedWSS4JInInterceptor to be added to any bus.
      Unfortunately, the PolicyBasedWSS4JInInterceptor ends up extending org.apache.ws.security.handler.WSHandler which has a Map<String, Crypto> attribute. That is used whenever loading a Crypto instance and caches instances with keys basically given by the Merlin prop file name the user specified for the endpoint.
      So, when having multiple deployments referencing properties files with the same name, the first crypto instance is always used.

      If we want to keep the singleton approach on using the PolicyBasedWSS4JInInterceptor, we should probably at least use a different mechanism for creating keys so that prop files from different deployments are kept separate.

      Attachments

        1. cxf-4052.patch
          6 kB
          Colm O hEigeartaigh
        2. cxf-4052-2.patch
          9 kB
          Colm O hEigeartaigh

        Issue Links

          Activity

            People

              coheigea Colm O hEigeartaigh
              asoldano Alessio Soldano
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: