IBM Support

Sharing documents with Content Navigator will fail with javax.crypto.BadPaddingException: Given final block not properly padded

Troubleshooting


Problem

This is a Box integration with IBM Case Manager (ICM) and Content Navigator (ICN). When a user tries to share a document, it failed with javax.crypto.BadPaddingException: Given final block not properly padded

Symptom

The WAS SystemErr.log indicates that it could not decrypt the password configured for the ICN Task Manager.

Here is the excerpt :

[8/10/17 16:29:22:047 PDT] 000000ee SystemErr R Aug 10, 2017 4:29:22 PM Parameters Parameters
SEVERE: could not decrypt password
com.ibm.ecm.util.security.CryptionException: javax.crypto.BadPaddingException: Given final block not properly padded
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:325)
at com.ibm.ecm.util.security.Cryption.decryptFromBytes(Cryption.java:263)
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:233)
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:213)
at com.ibm.ecm.icntasks.util.TaskUtils.getDecryptedPassword(TaskUtils.java:124)
at com.ibm.ecm.icntasks.copy.CopyToFolderParameters.initRepositoryInfo(CopyToFolderParameters.java:263)
at com.ibm.ecm.icntasks.copy.CopyToFolderParameters.<init>(CopyToFolderParameters.java:231)
at com.ibm.ecm.icntasks.copy.CopyToFolderTask.performTask(CopyToFolderTask.java:73)
at com.ibm.ecm.task.commonj.work.BaseTask.run(BaseTask.java:64)
at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:267)
at java.security.AccessController.doPrivileged(AccessController.java:422)
at javax.security.auth.Subject.doAs(Subject.java:494)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:133)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:91)
at com.ibm.ws.asynchbeans.J2EEContext$DoAsProxy.run(J2EEContext.java:338)
at java.security.AccessController.doPrivileged(AccessController.java:452)
at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1174)
at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:199)
at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkItemImpl.java:236)
at java.lang.Thread.run(Thread.java:809)
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
at com.ibm.crypto.fips.provider.at.a(Unknown Source)
at com.ibm.crypto.fips.provider.at.b(Unknown Source)
at com.ibm.crypto.fips.provider.at.engineDoFinal(Unknown Source)
at javax.crypto.Cipher.doFinal(Unknown Source)
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:308)
... 19 more


And here is the similar error reported in ICN Task Manager log :

Aug 10, 2017 4:26:16 PM Parameters Parameters
SEVERE: could not decrypt password
com.ibm.ecm.util.security.CryptionException: javax.crypto.BadPaddingException: Given final block not properly padded
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:325)
at com.ibm.ecm.util.security.Cryption.decryptFromBytes(Cryption.java:263)
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:233)
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:213)
at com.ibm.ecm.icntasks.util.TaskUtils.getDecryptedPassword(TaskUtils.java:124)
at com.ibm.ecm.icntasks.copy.CopyToFolderParameters.initRepositoryInfo(CopyToFolderParameters.java:263)
at com.ibm.ecm.icntasks.copy.CopyToFolderParameters.<init>(CopyToFolderParameters.java:231)
at com.ibm.ecm.icntasks.copy.CopyToFolderTask.performTask(CopyToFolderTask.java:73)
at com.ibm.ecm.task.commonj.work.BaseTask.run(BaseTask.java:64)
at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:267)
at java.security.AccessController.doPrivileged(AccessController.java:422)
at javax.security.auth.Subject.doAs(Subject.java:494)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:133)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:91)
at com.ibm.ws.asynchbeans.J2EEContext$DoAsProxy.run(J2EEContext.java:338)
at java.security.AccessController.doPrivileged(AccessController.java:452)
at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1174)
at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:199)
at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkItemImpl.java:236)
at java.lang.Thread.run(Thread.java:809)
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
at com.ibm.crypto.fips.provider.at.a(Unknown Source)
at com.ibm.crypto.fips.provider.at.b(Unknown Source)
at com.ibm.crypto.fips.provider.at.engineDoFinal(Unknown Source)
at javax.crypto.Cipher.doFinal(Unknown Source)With this fix, sharing documents succeeds without the error.
at com.ibm.ecm.util.security.Cryption.decrypt(Cryption.java:308)
... 19 more

Cause

There is a known defect reported in APAR IO25247 - (IBM Content Manager Users) In some cases, sharing documents will fail with the following error: javax.crypto.BadPaddingException: Given final block not properly padded.

Resolving The Problem

This issue has been fixed in the already released ICN 3.0.1 fix pack. Refer to the following related links :
https://www.ibm.com/support/knowledgecenter/en/SSEUEX_3.0.1/KC_ditamaps/contentnavigator_3.0.1.htm
http://www-01.ibm.com/support/docview.wss?uid=swg27050008

If you have not applied ICN 3.0.1 fix pack yet, please apply the ICN 3.0.1 fix pack, and retest the issue. If the issue still persists after you have applied ICN 3.0.1 fix pack, carry out the steps below.

  1. In the ICN admin., open the configuration for the P8 repository from which you are trying to share documents in ICN, click the Connect button and authenticate.
  2. On the Configuration Parameters tab, click the Clear button next to the Task manager connection ID field.
  3. Click the Save and Close button at the top of the page.
  4. Open the configuration again, authenticate again, and set the Task manager connection ID to a valid user name and password -- this can be the same user that was used previously.
  5. Save and Close the configuration.
  6. Try sharing a document in ICN again.

If the problem still persists after you have carried out the instructions above, collect the following data
  • WAS ICN Systemout.log and SystemErr.log
  • ICN Task Manager log files
, and open a Problem Management Record (PMR) with Enterprise Content Management Business Process Manager support for further assistance.

[{"Product":{"code":"SSCTJ4","label":"IBM Case Manager"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Case Manager Client","Platform":[{"code":"PF033","label":"Windows"}],"Version":"5.3.0","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 June 2018

UID

swg22007798