Uploaded image for project: 'Rampart'
  1. Rampart
  2. RAMPART-198

Rampart 1.4 assumes WSS10 or WSS11 to be present in the policy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4
    • 1.5.1
    • rampart-policy
    • None

    Description

      Rampart 1.4 assumes WSS10 or WSS11 to be present in the policy. This is not a mandatory requirement and we must use defaults if those assertions are not present.

      http://wso2.org/library/3415

      Exception:java.lang.NullPointerException
      java.lang.NullPointerException
      at org.apache.rampart.util.RampartUtil.setKeyIdentifierType(RampartUtil.java:1141)
      at org.apache.rampart.builder.BindingBuilder.getSignatureBuider(BindingBuilder.java:243)
      at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:626)
      at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:413)
      at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:93)
      at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)
      at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
      at org.apache.axis2.engine.Phase.invoke(Phase.java:317)
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:429)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
      at com.my.ws.test.JmeterserviceSecStub.addition(JmeterserviceSecStub.java:240)
      at com.my.ws.test.TestClient.main(TestClient.java:57)

      The code appears to want a Wss10 or Wss11 Assertion in the list of assertions on the message context.
      But there are none so this line causes a null pointer:

      public class RampartUtil
      ...
      public static void setKeyIdentifierType(RampartPolicyData rpd, WSSecBase secBase,org.apache.ws.secpolicy.model.Token token) {
      ....
      if (wss.isMustSupportRefKeyIdentifier()) {

      Adding this to the policy fixes the error:

      <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
      <wsp:Policy>
      <sp:MustSupportRefKeyIdentifier/>
      <sp:MustSupportRefIssuerSerial/>
      </wsp:Policy>
      </sp:Wss10>

      Attachments

        Activity

          People

            shankar Selvaratnam Uthaiyashankar
            petek Pete K
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified