Nachricht ungueltig.:Validierung fehlgeschlagen with DKB in current version
korneliuscode opened this issue · 17 comments
I get an error with DKB on the most current version. Right with synchronization:
HNHBK:1:3+000000000137+300+0+1+0:1'
HIRMG:2:2+9010::Nachricht ungueltig.:Validierung fehlgeschlagen.+9800::Dialog abgebrochen'
HNHBS:3:1+1'
This is the trace of the sent message.
HNSHA:6:2+2146045886951968++XXXXXX'
HNHBK:1:3+000000000407+300+0+1'
HNVSK:998:3+PIN:1+998+1+1::0+1:20211211:140736+2:2:13:@8@00000000:5:1+280:12030000:XXXXXXXX:V:0:0+0'
HNVSD:999:1+@246@HNSHK:2:4+PIN:1+999+2146045886951968+1+1+1::0+1+1:20211211:140736+1:999:1+6:10:16+280:12030000:XXXXXXXX:S:0:0'
HKIDN:3:2+280:12030000+XXXXXXXX+0+1'
HKVVB:4:3+0+0+0+9FA6681DEC0CF3046BFC2F8A6+1.0.0'
HKSYN:5:3+0'
HNSHA:6:2+2146045886951968++XXXXXXXXXXX''
HNHBS:7:1+1'
Does anyone have an idea what this could be?
There is an error in the message creation.
In line 705 and 726 in FinTsMessage.cs a StringBuilder is reused which results in a faulty message.
But even if I fix that I'm running into other issues later when trying the get the account balance.
I see the same issue with the latest version.
But probably there is also something else:
-
Until some days I used an much older version, I think it was from april 21, without any problems...
-
Since beginning of 2022 I think DKB changed something and I got error message (with older version) like:
Initialisation failed: 9050: Die Nachricht enthält Fehler., 3905: Es wurde keine Challenge erzeugt., 9800: Dialog abgebrochen, 3920: Zugelassene Zwei-Schritt-Verfahren für den Benutzer.:921, 9955: Auftrag nicht ausgeführt - Die Gerätebezeichnung ist unbekannt. (MBV07390100255)
@leschbenedikt Is this something you see after your fix?
Anyone else available to look into the DKB issue?
I'll try to have a more detailed look within the next days at least to reproduce the old error message, but I am not really familiar with this bank communication stuff...
Ich habe versucht die Library upzudaten. Scheinbar ist mir hier ein Fehler unterlaufen. Die Bibliothek benötigt jedoch ein komplettes Redesign/Refactoring.
@party-pansen
I just checked my local code, the only othes changes I found were in HKKAZ.cs
But the change is only related to transaction retrieval. I'm not sure what use case your are talking about.
But anyway this are the changes:
At first I added the segment Id to the call in line 147
segments = HKTAN.Init_HKTAN(client, segments, "HKKAZ");
In addition I replace every client.HICAZS
with client.HIKAZS
like in the commented rows below.
But if I remenber it correctly this resolved problems with one bank but had issues with other banks.
Maybe you try the first change at first and only try the second one if it's still not working.
Ok, I had some time to analyse:
There is a major bug in the new implementation as you already pointed out:
In line 705 and 726 in FinTsMessage.cs the following line needs to be added:
sb = new StringBuilder();
After that I get back to my original error message regarding "9955: Auftrag nicht ausgeführt - Die Gerätebezeichnung ist unbekannt."
After some research I found the following article:
https://medium.com/@subsembly/leitfaden-deutsche-kreditbank-dkb-bbd2d23fb6b9
So there was indeed an issue with my TAN devices which I could solve online @ DKB by removing a second, old pushTan device...
Back to the program, it still did not work. I needed to provide a pushtan, but the generated HKTAN message has failures:
HIRMG:3:2+9050::Die Nachricht enthält Fehler.+9800::Dialog abgebrochen+9000::Konvertierung in das/aus dem Format des Verarbeitungssystems fehlgeschlagen.'
Luckily I had an old trace which gave me a hint on the bug. It's simple:
Just uncomment line 151 from Tan.cs
That's again a bug when switching to sb.Append from old string concatenation
With that I am now able to get a correct answer from DKB.
Unfortunately my accounts are not accessible as before switching to latest version. I need to analyze this...
Currently I have not yet github correctly setup to simply push the bugfixes, but I think these are extreme simple for you to incorporate @thisistorsten
I'll probably open up a new issue for the other bugs when anlzying them in the next days...
For me DKB is working again,
besides the obvious bugfixes I already explained above, I needed to hack HKKAZ. I only did it for the relevant section for my bank and switched it back to some old HKKAZ string.
I wonder what these changes in HKKAZ were all about?`It looked very different.
Please review this in Branch bugfixes_dkb
Regards
party-pansen
Can someone please retest?
the initial error is gone, but retrieving transactions via HKKAZ is not working for DKB. You did not honor my change to HKKAZ. At least for DKB this must be changed back to the old message...
@party-pansen please recommend your changes here.
Please compare with my pushed branch bugfixing_pp. Since the segment now looks very different someone with some insight should have a look at it...
Is DKB working for you again? I also deleted my second pushTAN device, but still no luck on Master and also not on bugfixing_pp.
@korneliuscode @party-pansen please retest with this PR.
0810e8f