Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-8786

Making a CVC WS request can fail if there is an unitialized CVCA

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Cosmetic
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: EJBCA 7.4.0
    • Component/s: None
    • Labels:
    • Sprint:
      EJBCA Team Bob - 2019 w51

      Description

      The error appears to happen when there is a CVCA (CVC root CA) without certificate (e.g. uninitialized), and you try to make a certificate request without a supplying a certificate chain.

      This also causes a test failure in EjbcaWSCVCTest (and in "ant test:runsys") in this scenario.

      Given how simple the fix is, I have not investigated further.

      Steps to reproduce
      1. Have a CVCA in Uninitialized state, i.e. imported with Configdump or Statedump but not initialized.
      2. Run EjbcaWSCVCTest

      Result
      You get a NullPointerException:

      2019-12-20 13:46:21,725 ERROR [org.ejbca.core.protocol.ws.EjbcaWS] (default task-12) EJBCA WebService error: javax.ejb.EJBTransactionRolledbackException: java.lang.NullPointerException
              at org.jboss.as.ejb3@14.0.1.Final//org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:203)
              [...]
              at deployment.ejbca.ear.ejbca-ejb.jar//org.ejbca.core.ejb.ca.caadmin.CAAdminSessionLocal$$$view585.makeRequest(Unknown Source)
              at deployment.ejbca.ear.ejbca-ejb.jar//org.ejbca.core.ejb.ws.EjbcaWSHelperSessionBean.caRenewCertRequest(EjbcaWSHelperSessionBean.java:615)
              [...]
              at deployment.ejbca.ear.ejbca-ejb.jar//org.ejbca.core.ejb.ws.EjbcaWSHelperSessionLocal$$$view651.caRenewCertRequest(Unknown Source)
              at deployment.ejbca.ear.ejbca-ws-ejb.jar//org.ejbca.core.protocol.ws.EjbcaWS.caRenewCertRequest(EjbcaWS.java:657)
              [...]
      Caused by: javax.ejb.EJBException: java.lang.NullPointerException
              at deployment.ejbca.ear.ejbca-ejb.jar//org.ejbca.core.ejb.ca.caadmin.CAAdminSessionBean.makeRequest(CAAdminSessionBean.java:1083)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              [...]
      Caused by: java.lang.NullPointerException
              at deployment.ejbca.ear.ejbca-ejb.jar//org.ejbca.core.ejb.ca.caadmin.CAAdminSessionBean.makeRequest(CAAdminSessionBean.java:985)
              ... 258 more
      

      I cannot reproduce this in the AdminWeb, so I suppose it affects WS (or system test) only.

        Attachments

          Activity

            People

            Assignee:
            samuel Samuel Lidén Borell
            Reporter:
            samuel Samuel Lidén Borell
            Verified by:
            Mike Agrenius Kushner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 20 minutes
                20m