jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel López Blasi <lopezbl...@conicet.gov.ar>
Subject Re: exportDocumentView-ImportXml corrupted encrypted file
Date Tue, 16 Jan 2018 19:15:36 GMT
I tried with unencrypted pdf files, it breaks them too.

I noticed the files are slightly bigger (10kb) when restored from xml.
All the nodes and structure is there, but all Binary are corrupted. At 
least with pdf files, maybe plain text or other kind of
files do fine. I've read somewhere it's related to base64 encoding wich 
is what the exporter seems to use for storing binary
in xml file.

Notice that this are JCR methods (javax.jcr.Session and 
javax.jcr.Workspace), not Jackrabbit related.


On 16/01/18 12:28, Julian Reschke wrote:
> On 2018-01-16 15:52, Manuel López Blasi wrote:
>> Hi everyone,
>>
>> i'm using the Export/Import feature, methods from Session. It backups 
>> nodes / subtrees to an xml file.
>> I'm also backing up Binary values, wich are encrypted pdf files.
>>
>> to backup:
>>
>> session.exportDocumentView(path, FileOutputStream, false,false);
>>
>> to restore:
>>
>> session.getWorkspace().importXML(path,FileInputStream,ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);

>>
>>
>>
>> Now, when i try to decrypt the Binary property of my nodes, i get the 
>> following exception:
>>
>>
>> Severe: javax.crypto.BadPaddingException: Given final block not 
>> properly padded
>> at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:811)
>> at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)
>> at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:313)
>> at javax.crypto.Cipher.doFinal(Cipher.java:2131)
>> at 
>> ar.gov.conicet.apps.sigerh.util.crypto.CFileEncryptor.hacerEncriptacion(CFileEncryptor.java:38)

>>
>>
>> Any ideas on how to overcome this?
>>
>>
>> Thanks in advance,
>> cheerz.
>
> That sounds like a bug. Can you submit a JIRA ticket and attach a test 
> case?
>
> Best regards, Julian
>


Mime
View raw message