tsgrp / HPI

OpenContent Management Suite (OCMS)
http://www.tsgrp.com/products
17 stars 5 forks source link

Alfresco - Some features fail with a secured PDF #1279

Open gsteimer opened 7 years ago

gsteimer commented 7 years ago

Certain features will not work with OpenContent / Alfresco when dealing with secured PDFs. This is due to the fact that we use PDF manipulation code that requires Bouncy Castle 1.52, but Alfresco only has Bouncy Castle 1.45.

The above dependency causes the following features to fail on PDFs that contain password encryption:

You can tell whether or not your PDF has security by going to the file properties in Acrobat and switching to the Security tab:

image

Workaround The only known workaround to this problem is to do the following:

The danger with this workaround is that the above actions may break other features of alfresco. Since Bouncy Castle is used for encryption, any portions of Alfresco that rely on the old Bouncy Castle version could potentially be affected. At this time, we are unsure where these classes are used in Alfresco. Some potential culprits - Encrypted Content Stores, Records Manager, and Amazon S3 Connector. If a client goes with this workaround, extensive regression testing is recommended.

Fix Options Here are some potential options to fix the issue:

  1. Have Alfresco upgrade their version of Bouncy Castle to 1.52.
  2. Split out PDF manipulation features to a separate webapp. Something like this:
    • Create a new oc-pdf-manipulation webapp or command line java tool
    • If an OC flag is set, rather than doing the manipulation internally, call out to the other tool to do the manipulation and stream back the PDF contents
dgrumieaux commented 6 years ago

Keywords for search -

bouncycastle HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1Primitive

benallenallen commented 5 years ago

As of Alfresco 6.1, this is fixed because they include the following: bcmail-jdk15on-1.60.jar bcpkix-jdk15on-1.60.jar bcprov-jdk15on-1.60.jar