Help ACR39U ICC SmartCard Reader support for wine 5.17

Questions about Wine on Linux
Locked
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

I am using PARDUS 19.3 that is build from DEBIAN 10 in our workplace. We want to turn all windows systems to LINUX (PARDUS). But, we have some problems. Our document management system (Seneka EBDYS client) has only windows application i.e, that application has NOT linux version. So, we have to run this application on wine. I have run this application on wine 5.17 staging. But, this application has E-Signature module, and i have ACR39U ICC SmartCard Reader and AKiS v1.3 on infineon chip (from TUBITAK). I have researched a lot of thing for smart cards on wine, but i have not found anything. :cry:

I know wine does not reach hardwares and does not support windows drivers directly. But, I have to run this app and use e-signature module on wine.

Also, I have tried winscard patch of Mounir IDRASSI on crossover platform, but i can not be succeded :cry:

please, help.

informations of that reader:
03.PNG
03.PNG (11.02 KiB) Viewed 3997 times
02.PNG
02.PNG (9.32 KiB) Viewed 3997 times
01.PNG
01.PNG (9.06 KiB) Viewed 3997 times
[ ACR39U ICC Reader (ACR39U ICC Reader) ]

pscs_scan output:

Code: Select all

Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR39U ICC Reader 00 00
 
Tue Sep 22 15:12:49 2020
 Reader 0: ACS ACR39U ICC Reader 00 00
  Event number: 0
  Card state: Card inserted, 
  ATR: 3B 9F 96 81 31 FE 45 80 67 55 45 4B 41 45 12 93 31 80 73 B3 A1 80 6B

ATR: 3B 9F 96 81 31 FE 45 80 67 55 45 4B 41 45 12 93 31 80 73 B3 A1 80 6B
+ TS = 3B --> Direct Convention
+ T0 = 9F, Y(1): 1001, K: 15 (historical bytes)
  TA(1) = 96 --> Fi=512, Di=32, 16 cycles/ETU
    250000 bits/s at 4 MHz, fMax for Fi = 5 MHz => 312500 bits/s
  TD(1) = 81 --> Y(i+1) = 1000, Protocol T = 1 
-----
  TD(2) = 31 --> Y(i+1) = 0011, Protocol T = 1 
-----
  TA(3) = FE --> IFSC: 254
  TB(3) = 45 --> Block Waiting Integer: 4 - Character Waiting Integer: 5
+ Historical bytes: 80 67 55 45 4B 41 45 12 93 31 80 73 B3 A1 80
  Category indicator byte: 80 (compact TLV data object)
    Tag: 6, len: 7 (pre-issuing data)
      Data: 55 45 4B 41 45 12 93
    Tag: 3, len: 1 (card service data byte)
      Card service data byte: 80
        - Application selection: by full DF name
        - EF.DIR and EF.ATR access services: by GET RECORD(s) command
        - Card with MF
    Tag: 7, len: 3 (card capabilities)
      Selection methods: B3
        - DF selection by full DF name
        - DF selection by path
        - DF selection by file identifier
        - Record number supported
        - Record identifier supported
      Data coding byte: A1
        - EF of TLV structure supported
        - Behaviour of write functions: proprietary
        - Value 'FF' for the first byte of BER-TLV tag fields: invalid
        - Data unit in quartets: 2
      Command chaining, length fields and logical channels: 80
        - Command chaining
        - Logical channel number assignment: No logical channel
        - Maximum number of logical channels: 1
+ TCK = 6B (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 9F 96 81 31 FE 45 80 67 55 45 4B 41 45 12 93 31 80 73 B3 A1 80 6B
	AKiS v1.3 on infineon chip
 |   
this card reader is on /dev/bus/usb/001/003.

udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/001/003) output:

Code: Select all

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '//devices/pci0000:00/0000:00:14.0/usb1/1-3':
    KERNEL=="1-3"
    SUBSYSTEM=="usb"
    DRIVER=="usb"
    ATTR{maxchild}=="0"
    ATTR{version}==" 2.00"
    ATTR{manufacturer}=="ACS"
    ATTR{authorized}=="1"
    ATTR{bNumInterfaces}==" 1"
    ATTR{bNumConfigurations}=="1"
    ATTR{avoid_reset_quirk}=="0"
    ATTR{quirks}=="0x0"
    ATTR{urbnum}=="52"
    ATTR{bmAttributes}=="80"
    ATTR{bDeviceClass}=="00"
    ATTR{product}=="ACR39U ICC Reader"
    ATTR{idProduct}=="b100"
    ATTR{ltm_capable}=="no"
    ATTR{bDeviceProtocol}=="00"
    ATTR{speed}=="12"
    ATTR{idVendor}=="072f"
    ATTR{bMaxPacketSize0}=="16"
    ATTR{devpath}=="3"
    ATTR{bDeviceSubClass}=="00"
    ATTR{bMaxPower}=="120mA"
    ATTR{rx_lanes}=="1"
    ATTR{configuration}=="CCID"
    ATTR{busnum}=="1"
    ATTR{removable}=="removable"
    ATTR{devnum}=="3"
    ATTR{bConfigurationValue}=="1"
    ATTR{tx_lanes}=="1"
    ATTR{bcdDevice}=="0216"

  looking at parent device '//devices/pci0000:00/0000:00:14.0/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{devnum}=="1"
    ATTRS{bcdDevice}=="0419"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{serial}=="0000:00:14.0"
    ATTRS{idProduct}=="0002"
    ATTRS{tx_lanes}=="1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{devpath}=="0"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{rx_lanes}=="1"
    ATTRS{configuration}==""
    ATTRS{manufacturer}=="Linux 4.19.0-10-amd64 xhci-hcd"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{maxchild}=="16"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{removable}=="unknown"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{idVendor}=="1d6b"
    ATTRS{quirks}=="0x0"
    ATTRS{product}=="xHCI Host Controller"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{urbnum}=="293"
    ATTRS{version}==" 2.00"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{busnum}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{avoid_reset_quirk}=="0"

  looking at parent device '//devices/pci0000:00/0000:00:14.0':
    KERNELS=="0000:00:14.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="xhci_hcd"
    ATTRS{local_cpulist}=="0-7"
    ATTRS{revision}=="0x31"
    ATTRS{ari_enabled}=="0"
    ATTRS{subsystem_device}=="0x8058"
    ATTRS{class}=="0x0c0330"
    ATTRS{numa_node}=="-1"
    ATTRS{subsystem_vendor}=="0x103c"
    ATTRS{broken_parity_status}=="0"
    ATTRS{local_cpus}=="ff"
    ATTRS{vendor}=="0x8086"
    ATTRS{irq}=="125"
    ATTRS{device}=="0xa12f"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{driver_override}=="(null)"
    ATTRS{msi_bus}=="1"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{enable}=="1"
    ATTRS{d3cold_allowed}=="1"

  looking at parent device '//devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
I have created symbolic links to dosdevices on wineprefix, but i can not be succeded :cry:

I have edit registry of wine, but i can not be succeded again :cry:

please, help me.

this is very important for us.
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

Does Anyone exist for help us :(
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

output for WINARCH=win32 WINEPREFIX=$HOME/.PlayOnLinux/wineprefix/ebys32 wine javaw -jar 'C:\Program Files\AKIS\AKiA\akia.jar' command in terminal:

002c:fixme:winediag:LdrInitializeThunk wine-staging 5.17 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
003c:err:service:process_send_command service protocol error - failed to write pipe!
003c:fixme:service:scmdatabase_autostart_services Auto-start service L"AdobeARMservice" failed to start: 1053
002c:fixme:ntdll:EtwRegisterTraceGuidsA (3D9A3737, 3D9E2CF0, {0cfe0455-93ba-440d-a3fe-553973d0b723}, 1, 0066E994, (null), (null), 3D9E2CF8): stub
002c:fixme:ntdll:EtwRegisterTraceGuidsA (3D9A3737, 3D9E2D10, {797fabac-7b58-4796-b924-d51178a59ce4}, 1, 0066E994, (null), (null), 3D9E2D18): stub
002c:fixme:ntdll:EtwEventRegister ({43d1a55c-76d6-4f7e-995c-64c711e5cafe}, 3D9CDFA8, 00000000, 3D9E2500) stub.
002c:fixme:ntdll:EtwEventRegister ({9e3b3947-ca5d-4614-91a2-7b624e0e7244}, 3D9A3BD9, 3D9E4348, 3D9E4278) stub.
002c:fixme:ntdll:EtwEventEnabled (deadbeef, 3D945920): stub
002c:fixme:ntdll:EtwEventEnabled (deadbeef, 3D951D88): stub
002c:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
0024:fixme:heap:RtlSetHeapInformation 00000000 1 00000000 0 stub
00f0:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
00f0:fixme:font:freetype_SelectFont Untranslated charset 255
00f0:fixme:dwmapi:DwmIsCompositionEnabled 00CBED20
initPkcs11
00f0:fixme:winscard:SCardEstablishContext (0,00000000,00000000,00CBF708) stub
00f0:fixme:winscard:SCardReleaseContext (0) stub
Module name: C:\windows\system32\akisp11.dll
refresh *************
011c:fixme:imm:ImmGetOpenStatus (0099C968): semi-stub
0128:fixme:winscard:SCardEstablishContext (0,00000000,00000000,1576EED4) stub
0128:fixme:winscard:SCardEstablishContext (0,00000000,00000000,1576EEE4) stub
refresh *************
refresh *************
011c:fixme:imm:ImmReleaseContext (0002006A, 0099C968): stub
refresh *************
refresh *************
refresh *************
refresh *************
refresh *************
refresh *************
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

there is anyone for help?
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

We do not want to use windows. Please, help us
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

Does anybody have any solution?
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

:( Did Anyone not solve this problem? :(
savelov
Level 2
Level 2
Posts: 46
Joined: Sun Jan 10, 2010 5:46 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by savelov »

There is a linux driver for your reader, https://github.com/acshk/acsccid
Hoiwever as I assume you have java application that uses that reader, need to esnure it is compatible with that API
And this stack does not include wine, so you need to run native linux java.
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

savelov wrote: Tue Jan 05, 2021 3:20 am There is a linux driver for your reader, https://github.com/acshk/acsccid
Hoiwever as I assume you have java application that uses that reader, need to esnure it is compatible with that API
And this stack does not include wine, so you need to run native linux java.
I know that linux drivers and java, But our company's document managing system that is "Sağlık Bakanlığı Elektronik Belge Yönetim Sistemi/Seneka EBYS" has only windows version. :(
I have to use wine to run this app. So, wine should support smard cards for similar reasons
savelov
Level 2
Level 2
Posts: 46
Joined: Sun Jan 10, 2010 5:46 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by savelov »

in that case you can try to launch linux java app from windows application running in wine - at least I was able to run native viewers by registering shell extensions like .docx, .pdf etc.
assuming this can be extended to launching linux java inside your windows app - see below discussion in stackoverflow
https://stackoverflow.com/questions/600 ... 64#8205364
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

savelov wrote: Tue Jan 05, 2021 4:50 am in that case you can try to launch linux java app from windows application running in wine - at least I was able to run native viewers by registering shell extensions like .docx, .pdf etc.
assuming this can be extended to launching linux java inside your windows app - see below discussion in stackoverflow
https://stackoverflow.com/questions/600 ... 64#8205364
I have tried it. :( Our document managing system does not use java. The app is in c# and exe format. The app is click one application. So, it uses appref-ms files.
The app talks to smart cards directly without java after installing smart card driver on windows. the problem is that any driver can not be installed on wine and the wine can not talks drivers directly. if wine talks to smart card, our app will see smart card.
savelov
Level 2
Level 2
Posts: 46
Joined: Sun Jan 10, 2010 5:46 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by savelov »

muhammedemintombak wrote: Tue Jan 05, 2021 5:01 am I have tried it. :( Our document managing system does not use java. The app is in c# and exe format. The app is click one application. So, it uses appref-ms files.
The app talks to smart cards directly without java after installing smart card driver on windows. the problem is that any driver can not be installed on wine and the wine can not talks drivers directly. if wine talks to smart card, our app will see smart card.
you previously mentioned that you run it using java - so I am assuming that the smart card driver is using java. So the solution to your problem is just to replace running windows java with running linux java executable - try creating javaw batch/cmd file that can be launched instead of javaw.exe - and then you can run linux java inside of it. You will need to convert filepaths accordingly is they are passed in command line
(this is your quote below)
output for WINARCH=win32 WINEPREFIX=$HOME/.PlayOnLinux/wineprefix/ebys32 wine javaw -jar 'C:\Program Files\AKIS\AKiA\akia.jar' command in terminal:
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

akia.jar is not our document managing system. AKIA is the test applcation of AKIS and smart card readers. AKIS is e-signature module and needs smart card readers.
Our document managing system is Seneka EBYS.
All informations about this app:
https://translate.google.com/translate? ... php/ebdys/

They are saying that e-signature WITHOUT java. :(

The app does not require java. The app developed in c# and .net framework. :(
savelov
Level 2
Level 2
Posts: 46
Joined: Sun Jan 10, 2010 5:46 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by savelov »

assuming this is identical to bug https://bugs.winehq.org/show_bug.cgi?id=37495
assuming the code exists here - https://github.com/idrassi/SCard4Wine
and binaries https://sourceforge.net/projects/scard4wine/
so need to compile wine locally with the patches applied
muhammedemintombak
Level 2
Level 2
Posts: 42
Joined: Tue Sep 22, 2020 6:52 am

Re: Help ACR39U ICC SmartCard Reader support for wine 5.17

Post by muhammedemintombak »

I have written to Mr. Mounir IDRASSI. He has answered me. I thank him very much. He told me that:

Code: Select all

The solution is simple:

*    delete winscard.dll file from "wine" folder under "lib" (for example: rm /opt/wine-devel/lib/wine/winscard.dll)
*    copy winscard.dll.so to "wine" folder under "lib" (for example: cp $HOME/Downloads/SCard4Wine/32-bit/winscard.dll.so /opt/wine-devel/lib/wine/winscard.dll.so)
*    copy winscard.dll.fake to "wine/fakedlls" with the name winscard.dll (for example: cp $HOME/Downloads/SCard4Wine/32-bit/winscard.dll.fake /opt/wine-devel/lib/wine/fakedlls/winscard.dll)
*    copy libwinscard.def to "wine" folder (for example: $HOME/Downloads/SCard4Wine/32-bit/libwinscard.def /opt/wine-devel/lib/wine/libwinscard.def) 

Once you do this, winscard will work properly.
I have tested this solution with official WineHQ package for Debian 10 (development version 5.19) and it works.
Concerning building manually SCard4Wine from source, it is actually complicated under new Wine version because I use Linux code in my winscard.dll (in order to use pcsclite) and so it can't be built as native dll. So instead of modifying Wine configuration ( which is complex to do), it is better to use SCard4Wine files built on older version of Wine and then copy them since the Wine interface didn't change and so old .so files are still compatible.

If you are on 64-bit machine, be sure to installed the 32-bit version of pcsclite library otherwise SCard4Wine 32-bit can't work.
To do that, type the following:

    sudo dpkg --add-architecture i386
    sudo apt install libpcsclite1:i386

Can you please share how did you install Wine 5.17? Are you using package from WineHQ repository?
Can you please share the output of the following commands on the lib/wine folder:

    ls -l *winscard*
    ls -l fakedlls/*winscard* 

I think it is just an issue of either missing 32-bit pcsclite or problem with copying files because I'm 100% sure that Wine 5.17 32-bit works with SCard4Wine 32-bit.
He has helped me. My problem is solved.
I thank Mr. Mounir IDRASSI very much
Locked