http://bugs.winehq.org/show_bug.cgi?id=58608
Bug ID: 58608 Summary: SCardTransmit should work with pioSendPci=NULL Product: Wine Version: 10.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winscard Assignee: wine-bugs@winehq.org Reporter: pq2sx44teeigl7za@chyen.cc Distribution: ---
Although undocumented, winscard.dll on Windows appears to accept pioSendPci=NULL for SCardTransmit. Such usage is observed in Taipei Fubon Bank's agent program. Steps to reproduce are:
1. Download and install https://ebank.taipeifubon.com.tw/EXT/inc/plugins/TfbWebATMServiceInstall.exe 2. Run C:\Program Files (x86)\TFB\WebATM\TFBWebATMAgent.exe 3. Go to https://ebank.taipeifubon.com.tw/EXT/common/CWA/Index.faces and try to login ("登入" button)
http://bugs.winehq.org/show_bug.cgi?id=58608
--- Comment #1 from yan12125 pq2sx44teeigl7za@chyen.cc --- Created attachment 79148 --> http://bugs.winehq.org/attachment.cgi?id=79148 Crash report
http://bugs.winehq.org/show_bug.cgi?id=58608
--- Comment #2 from yan12125 pq2sx44teeigl7za@chyen.cc --- Created attachment 79149 --> http://bugs.winehq.org/attachment.cgi?id=79149 Proof-of-concept patch
One idea is querying the protocol to use if pioSendPci=NULL. Note that this patch was tested with older wine. I'll rebase and retest when I have time.
http://bugs.winehq.org/show_bug.cgi?id=58608
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- Created attachment 79152 --> http://bugs.winehq.org/attachment.cgi?id=79152 patch
Thanks for the bug report. Here's an alternative patch that caches the protocol and avoids the SCardStatusW() call. Does it also fix your application?
http://bugs.winehq.org/show_bug.cgi?id=58608
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, patch
http://bugs.winehq.org/show_bug.cgi?id=58608
--- Comment #4 from yan12125 pq2sx44teeigl7za@chyen.cc --- Thank you! The idea looks cool. I'll test and feedback when I find time.
By the way, I noticed a potential issue after reading my patch again. Per [1], cbPciLength is "Length, in bytes, of the SCARD_IO_REQUEST structure plus any following PCI-specific information." Assume no PCI-specific information, sizeof(SCARD_IO_REQUEST) seems more correct. I don't remember why I used 0 - will test both variants based on your patch.
http://bugs.winehq.org/show_bug.cgi?id=58608
--- Comment #5 from Hans Leidekker hans@meelstraat.net --- (In reply to yan12125 from comment #4)
Thank you! The idea looks cool. I'll test and feedback when I find time.
By the way, I noticed a potential issue after reading my patch again. Per [1], cbPciLength is "Length, in bytes, of the SCARD_IO_REQUEST structure plus any following PCI-specific information." Assume no PCI-specific information, sizeof(SCARD_IO_REQUEST) seems more correct. I don't remember why I used 0 - will test both variants based on your patch.
Right, I have already fixed that here.
http://bugs.winehq.org/show_bug.cgi?id=58608
--- Comment #6 from yan12125 pq2sx44teeigl7za@chyen.cc ---
Right, I have already fixed that here.
Maybe not everything is fixed? This line
send64.pci_len = 0;
should probably be:
send64.pci_len = sizeof(SCARD_IO_REQUEST);
Based on my testing, either variant of your patch fixes the first issue encountered with TFBWebATMAgent.exe. It can get basic data from the card, while I'm still unable to login due to other errors ("ox1001").
http://bugs.winehq.org/show_bug.cgi?id=58608
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |57bcd21d93ac9a80c83d77f6572 | |2d32c5f594796 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #7 from Hans Leidekker hans@meelstraat.net --- Thanks for testing. This should be fixed with 57bcd21d93ac9a80c83d77f65722d32c5f594796.
http://bugs.winehq.org/show_bug.cgi?id=58608
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 10.14.