tiamo / phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard.
42 stars 41 forks source link

Transport of UNA & UNB not working #22

Closed homer8173 closed 3 years ago

homer8173 commented 3 years ago

Those lines affect the transport by those various errors : Partner failed to process file. processed/error: Failed to decrypt S/Mime message. Error: "error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error". Partner failed to process file. processed/error: Failed to decrypt S/Mime message. Error: "error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag". Partner failed to process file. processed/error: Failed to decrypt S/Mime message. Error: "error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error".

The end of the message is working fine only if i remove those lines : UNA:+.? ' UNB+UNOC:3+SENDERID:14+RECEIVERID:14+200915:1019+37856120'

I'm having a configuration with : 'content_type' => 'text/plain', 'compression' => false, 'signature_algorithm' => false, 'encryption_algorithm' => '3des', 'content_transfer_encoding' => 'base64', 'mdn_mode' => PartnerInterface::MDN_MODE_SYNC, 'mdn_options' => 'signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, sha256',

homer8173 commented 3 years ago

I realised that i have this issue on random messages any clue ?

k0mar12 commented 3 years ago

@homer8173 I dont have any issue with parsing message. Can u share pls ur code where u parsing?

homer8173 commented 3 years ago

I have the last version of code, with the setup i provided here i can tell my bug appear depending of the length of the message

Thanks for help

k0mar12 commented 3 years ago

@homer8173 How did you parse message? Coz i dont really understand in which step you got error

robsonala commented 3 years ago

@homer8173 Not sure you have fixed the issue, but I had exactly the same problem and I noticed it was due a problem on base64 decode. You can see the changes on https://github.com/tiamo/phpas2/pull/23

tiamo commented 3 years ago

fixed #23