Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Beim Lesen der BLZ wurde ein ggf. an einer geraden Stelle vorhandene …
Browse files Browse the repository at this point in the history
…"20" ignoriert. Da war voellig unnoetig ein "if" drin, welches das Byte uebersprungen hat. In der alten nativen Implementierung (ddv_readbankdata.c) war das auch nicht drin. Keine Ahnung, warum es in der PCSC-Variante landete. Es ist jedenfalls Quatsch. Pecunia macht es auch nicht (siehe https://github.com/pecuniabanking/pecunia-client/blob/master/Source/HBCISmartcardDDV.swift). Siehe http://www.onlinebanking-forum.de/forum/topic.php?t=19840&page=last#last_post
  • Loading branch information
willuhn committed Mar 2, 2016
1 parent 7668877 commit aee96b8
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/org/kapott/hbci/smartcardio/DDVCardService.java
Expand Up @@ -75,20 +75,21 @@ public DDVBankData readBankData(int idx)
StringBuffer blz=new StringBuffer();
for (int i=0;i<4;i++)
{
if (rawData[20+i]!=(byte)0x20)
{
byte nibble=(byte)((rawData[20+i]>>4)&0x0F);
if (nibble>9) {
nibble^=0x0F;
}
blz.append((char)(nibble+0x30));

nibble=(byte)(rawData[20+i]&0x0F);
if (nibble>9) {
nibble^=0x0F;
}
blz.append((char)(nibble+0x30));
}
// Linker Nibble ;)
// 4 Byte nach rechts verschoben
byte ch = rawData[20+i];
byte nibble=(byte)((ch>>4) & 0x0F);
if (nibble > 0x09)
nibble ^= 0x0F;

blz.append((char)(nibble + 0x30)); // In ASCII-Bereich verschieben

// Rechter Nibble
nibble=(byte)(ch & 0x0F);
if (nibble > 0x09)
nibble ^= 0x0F;

blz.append((char)(nibble + 0x30));
}
ret.blz=blz.toString();

Expand Down

0 comments on commit aee96b8

Please sign in to comment.