Skip to content

Conversation

jegan-maker
Copy link

Problem

Multi-segment downloads (especially C53) were failing because segments were being decrypted individually instead of being combined first.

Solution

This PR fixes the multi-segment download process to match EBICS specification:

  1. Extract and decrypt transaction key from first segment only
  2. Collect all segments as encrypted binary data (without individual decryption)
  3. Combine all encrypted segments
  4. Decrypt the combined data using the cached transaction key
  5. Decompress the result

Changes

  • Added order_data_binary method to get raw encrypted segment data
  • Modified download method to handle multi-segment responses correctly
  • Added transaction key caching across segments
  • Improved debug logging

Testing

  • Tested with C53 multi-segment downloads
  • Verified backward compatibility with single-segment downloads
  • All existing tests pass

Transaction Key: Base64 decode → binary → decrypt with private key (only once from first segment)
Each Segment: Base64 decode → binary (NO individual decryption)
Combine: Join all binary segments into one binary array
Decrypt Combined: Use transaction key to decrypt the entire combined binary
Decompress: Finally decompress the decrypted data
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

version bumpup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants