<div dir="ltr">Hi!<div><br></div><div>I'm trying to use xmlsec to implement encrypt/decrypt functionality, with help from <a href="https://users.dcc.uchile.cl/~pcamacho/tutorial/web/xmlsec/xmlsec.html">https://users.dcc.uchile.cl/~pcamacho/tutorial/web/xmlsec/xmlsec.html</a> for providing basic examples.</div><div><br></div><div>I have a problem where a test case works in one environment, but not in another and I'm not sure how to proceed.</div><div><br></div><div>I'm attaching 4 files</div><div><br></div><div>* certificate.p12 - private key given in PKCS #12 for decrypting (password: hello)</div><div>* public.pem - public file for encrypting</div><div>* doc.xml - document to encrypt</div><div>* template.xml - template used for encrypting</div><div><br></div><div>Encrypt:</div><div>xmlsec1 encrypt --pubkey-pem public.pem --session-key des-192 --xml-data doc.xml --output encrypted.xml template.xml<br></div><div><br></div><div>Decrypt</div><div>xmlsec1 decrypt --output result.xml --pkcs12 certificate.p12 --pwd hello encrypted.xml<br></div><div><br></div><div>When run with latest version available via cygwin (xmlsec1 1.2.24 (openssl)) on Windows, this produces the desired result that result.xml is equivalent to doc.xml. However, when run on CentOS 7 with the latest available version (xmlsec1 1.2.20 (openssl)) decryption fails with:</div><div><br></div><div>Entity: line 2: parser error : internal error: detected an error in element content<br><br><PayInfo><br>         ^<br>func=xmlSecReplaceNodeBufferAndReturn:file=xmltree.c:line=573:obj=unknown:subj=xmlParseInNodeContext:error=5:libxml2 library function failed:Failed to parse content<br>func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=648:obj=unknown:subj=xmlSecReplaceNodeBuffer:error=1:xmlsec library function failed:node=EncryptedData<br>Error: failed to decrypt file<br>Error: failed to decrypt file "encrypted.xml"<br></div><div><br></div><div>Obviously, I see that I'm running different versions, but does anyone know what might be wrong regardless? Is the test case flawed but 1.2.24 accepts it anyway, or did I run into a bug? </div><div><br></div><div>Regards,</div><div>Matthias Hjalmarsson</div><div><br></div><div><br></div></div>