-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bank refuses CDB messages with ruby 3.1 #142
Comments
Unfortunately, no immediate experience. What we have is
and it is working nicely. However we are certainly not yet on the latest version to verify that everything is ok and I do not have any test accounts/accesses available right now. The assumption does sound reasonable though. Which version of the Gem are you using exactly? I assume CAMT data download is working nicely? |
Thanks for the quick response. We're using epics 2.1.1 (revision 4a261c5) pulled from github, and rubyzip 2.3.2 in both ruby versions. I'm not very familiar with EBICS; I'm just working on the source tree :) |
CAMT files contain the bank statements and for different specific purposes there are slightly different standards, e.g. C53 is for downloading the bank statements with confirmed transfers until end of day of the previous day (CAMT.053) for the accounts attached to you EBICS access. In epics it is implemented in a way that you can pass a start and end date. |
Ok, I've tried retrieving the transactions of the past week with the From that I'd deduct that we have no issues reading the banks data, it's just the bank that has issues with reading our encrypted data (authentication works though, maybe that's handled by a different system upstream). I've tried running the steps used for creating the For now I'm out of ideas as to what I can try next. As a reference as to what I did in irb:
|
The last time I had a similarly sounding issue was actually when we switched to using openssl pss sign and verify in #103 The issue back then was that the custom signature/verify method failed to work correctly with keys larger than 2048 bit. In order to debug that, we (my employer) bought a 1 year license from subsembly for their ebics test server (which costs like 1k EUR), however I do not have that available for lack of need, and because they were really fast in setting things up should the need arise again. Unfortunately I haven't found any bank or service in germany that provides a test API for free, however there is https://iso20022test.credit-suisse.com/ which should be helpful with this. Do you happen to have Dockerfiles or base images with which you can recreate the environment and steps that show the issue? As for creating example files for switzerland: https://github.com/salesking/sepa_king supports pain.001 for switzerland and https://github.com/viafintech/sps_king supports it for pain.001 and pain.008 (debits). If this is an issue about the signature, it should be recreatable there. Another question: How large are the files that you try to send via CDB? Like, how many entries do you have in there? |
[just saw that the comment hadn't been submitted yet. oops] I just checked the key sizes, and that should not be the issue. The CDBs are as small as they can be, I think. My test case has only one entry and that corresponds to what is generated in the production code. No docker images available, unfortunately. Checking for a test api isn't something I had considered, I'll give that a go. It may take a few days for me to actually get around to setting that up. |
I ran into a similar issue with CCT and the GLS Bank (DZ Bank EBICS server) returns "EBICS_INVALID_ORDER_DATA_FORMAT - The transferred order data does not correspond with the specified format" when switching to ruby 3.2 (from 2.7). C53 and C52 Order Types work. |
Could you maybe provide some additional details? Key size, ruby version, openssl version, ... |
OpenSSL 3.0.9 30 May 2023 (Library: OpenSSL 3.0.9 30 May 2023) |
In the hopes that it is still applicable, DZBank seems to provide (or did provide) a testing environment for ebics: Since I do not have a production EBICS ID with DZBank I cannot use that for testing |
I tried but the GLS seems use their stack but to not sync the customer IDs with their test system. I then tried manually to check the crypto methods from the libs (encrypt, sign, digest, ..) if ruby 2.7.4/openssl 2.1.2 are doing the same as ruby 3.2.2/ openssl 3.1.0. encryption, signing, padding, base64, hashing with SHA256, ... all the same back and forth. I cannot find a difference. Also the XML documents sent via CCT are both the same, obviously the respective signature and encryption values are different because of the salt and random session key. I cannot find a reason why it's rejected. Looks like it's caused by the encrypted_order_signature value in the SignatureData field, but don't see why. |
Were both ruby versions compiled with the same openssl version underneath? |
I manage the versions with rbenv and the ruby-build script compiles v2.7.4
against openssl1.1 and v3.2.2 against openssl 3.0.
…On Wed, 14 Jun 2023 at 19:07, Tobias Schoknecht ***@***.***> wrote:
Were both ruby versions compiled with the same openssl version underneath?
—
Reply to this email directly, view it on GitHub
<#142 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANKLRJT2NS4GQ5T4LIAQKJ3XLHVVJANCNFSM6AAAAAAX4RFDZ4>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
*Marcus Nasarek*
Managing Director
*etonec GmbH*
m: +49 152 2161 9714
e: ***@***.***
w: www.etonec.com
--
etonec GmbH | Kopernikusstrasse 35, 10243 Berlin | AG Berlin-Charlottenburg
HRB 217087 | Geschäftsführer: Marcus Nasarek | Gesellschaftssitz Berlin |
VAT DE323610849
|
I linked ruby 3.2.2 with openssl 1.1.1t and it worked for openssl gem version 3.1.0 and 2.2.3. If build ruby 3.2.2 with openssl 3.1.0 it throws the error "EBICS_INVALID_ORDER_DATA_FORMAT - The transferred order data does not correspond with the specified format" |
I wonder if it might be related to this: So it is not the first time I came across an issue with openssl 3 and some things seem to still be missing there (oddly enough). As of right now, the pragmatic solution would be to stick with openssl 1.1.1t then if this is a possibility for you. Eventually of course we will need to look into this more deeply. I didn't have the time to dig into this though without being able to easily recreate the issue |
Looking at this recent discussion #129 (comment) and how it played out, I have also seen some weird behaviour with openssl and how it is used in different versions of epics and different versions of openssl, that ruby was linked against during compile. I assume loading the keys works nicely between both version and between different openssl versions as that would have been mentioned here then. Therefore not directly related. One thing I could imagine right now in order to debug would be to try to overwrite the bit that is providing the random part via monkey patching (haven't checked if possible yet) to get the randomness out of the way and have something a bit more comparable. If it is then completely identical, then the bug would be in openssl 3 or the openssl bindings for ruby 😅 |
Released a new version (v2.1.2) with the fix provided by @sos4nt Please let me know if this solves it for everyone or if we need to dig into this further. |
Initial tests look positive. We'll probably get to do a full test sometime towards the end of the month. |
We've been running with the new version for over a week now and have not encountered an error. I think we can consider this issue fixed. :) |
We've run into an odd issue while upgrading our application to ruby 3.1: CDB messages are refused by the bank with a '090004' Return code (EBICS_INVALID_ORDER_DATA_FORMAT). A CDB message with the same gem versions and same order data is accepted when issued from ruby 3.0.
Trying to debug the issue with the IT of the bank in question did not yield very precise results, unfortunately, as the server side cause of the rejection wasn't covered by their logging. The best esitmate of the bank is, that the value of the OrderData attribute cannot be decompressed due to it being invalid.
My suspicion on the other hand is, that this may have something to do with the OpenSSL versions used by ruby 3.0 (OpenSSL 1.1) and ruby 3.1 (OpenSSL 3.0).
Before I go poking things with a stick to see what squeaks, are you aware of any issues regarding ruby 3.1 that may cause OrderData to become unreadable to upstream? Or maybe some pointers where it would be sensible to start more detailed debugging? I have logs of the ebics messages in the relevant communications, in case they would help.
The text was updated successfully, but these errors were encountered: