Compare commits
317 Commits
fd719fbb94
...
96ffc87e05
Author | SHA1 | Date |
---|---|---|
Oliver Smith | 96ffc87e05 | |
Oliver Smith | 1d3da3323f | |
Oliver Smith | 99aadc04dd | |
Ludovic Rousseau | 9da5749aac | |
Ludovic Rousseau | e56510fdf2 | |
Ludovic Rousseau | 4ac4074c40 | |
Ludovic Rousseau | 72e0f1510d | |
Ludovic Rousseau | e7a3ae593c | |
Ludovic Rousseau | 5e0975b4be | |
Ludovic Rousseau | 2cb5c621b8 | |
Ludovic Rousseau | 9759a1c84b | |
Ludovic Rousseau | df179a2256 | |
Ludovic Rousseau | 33dc6413bd | |
Ludovic Rousseau | f41b145a7e | |
Ludovic Rousseau | fde6515dfc | |
Ludovic Rousseau | 3b7224cf1f | |
Ludovic Rousseau | 458d74b50f | |
Ludovic Rousseau | 7f320cb9c4 | |
Ludovic Rousseau | a7d99120c9 | |
Ludovic Rousseau | 7e1327ba30 | |
Ludovic Rousseau | 5953a46e21 | |
Ludovic Rousseau | 0d15ff9ca7 | |
Ludovic Rousseau | 0fac498fbd | |
Ludovic Rousseau | f63bd4adaf | |
Ludovic Rousseau | 5b66e31dbe | |
Ludovic Rousseau | 7a3188e4ec | |
Ludovic Rousseau | 9394944eaf | |
Ludovic Rousseau | 985660d0ec | |
Ludovic Rousseau | 19295a0cf7 | |
Ludovic Rousseau | 5861f868b5 | |
Debian Janitor | 194f165c94 | |
Ludovic Rousseau | 935e0eaeaa | |
Ludovic Rousseau | 7376c48fb2 | |
Ludovic Rousseau | 968e38a8c9 | |
Ludovic Rousseau | fc7bb3049f | |
Ludovic Rousseau | f184f1d88e | |
Ludovic Rousseau | 9bf51b9f1b | |
Ludovic Rousseau | 9445b600c3 | |
Ludovic Rousseau | 555c719c18 | |
Ludovic Rousseau | 364e5b68b4 | |
Ludovic Rousseau | c4860da1a8 | |
Ludovic Rousseau | 55800ed7a4 | |
Ludovic Rousseau | 78c7de96f2 | |
Ludovic Rousseau | 13b6691f17 | |
Ludovic Rousseau | bb3b9268e4 | |
Ludovic Rousseau | 12e1042421 | |
Ludovic Rousseau | 5aea439b3e | |
Ludovic Rousseau | 8fca77700d | |
Ludovic Rousseau | a1d1afc3ff | |
Ludovic Rousseau | 7ad8002ecc | |
Ludovic Rousseau | ed93e44fb9 | |
Ludovic Rousseau | bad4096612 | |
Ludovic Rousseau | 360ae96e8f | |
Ludovic Rousseau | f50b06ddd6 | |
Ludovic Rousseau | a64fb82810 | |
Ludovic Rousseau | bbcaf6d27b | |
Ludovic Rousseau | 793940aac2 | |
Ludovic Rousseau | c6ab85d366 | |
Ludovic Rousseau | e9c0844f04 | |
Debian Janitor | bc2c6c66d7 | |
Ludovic Rousseau | b315e336cc | |
Ludovic Rousseau | 6ce747a6b1 | |
Ludovic Rousseau | 2f2f353f0c | |
Ludovic Rousseau | 088e5a557a | |
Ludovic Rousseau | bb21c8fb45 | |
Ludovic Rousseau | 584b4079d6 | |
Ludovic Rousseau | 18cc05ef13 | |
Ludovic Rousseau | 1359bce505 | |
Ludovic Rousseau | 12690654bb | |
Ludovic Rousseau | 7a5ed371f7 | |
Ludovic Rousseau | 8752a3d068 | |
Ludovic Rousseau | e3add22f92 | |
Ludovic Rousseau | 1531d6cbd1 | |
Ludovic Rousseau | c4891c3fab | |
Ludovic Rousseau | 9a16b7274c | |
Ludovic Rousseau | ba5db3f939 | |
Ludovic Rousseau | e44d5f1920 | |
Ludovic Rousseau | 62226f3819 | |
Ludovic Rousseau | 507f9d93fa | |
Ludovic Rousseau | 6b8deef173 | |
Ludovic Rousseau | 31f4d81e75 | |
Ludovic Rousseau | 4dac2c40d4 | |
Ludovic Rousseau | 57c0ebbfbd | |
Ludovic Rousseau | f95c63cd8c | |
Topi Miettinen | 786c9499a8 | |
Ludovic Rousseau | 1a753d48a4 | |
Ludovic Rousseau | 159995f8ac | |
Ludovic Rousseau | 7472a26aec | |
Ludovic Rousseau | a97e1656df | |
Ludovic Rousseau | 36b140b9c8 | |
Ludovic Rousseau | 6b5f6917dd | |
Ludovic Rousseau | cffacd0e09 | |
Ludovic Rousseau | f7e451f3bc | |
Ludovic Rousseau | 0d2ce26b86 | |
Ludovic Rousseau | 46e3766b95 | |
Ludovic Rousseau | 8994e4874d | |
Ludovic Rousseau | d7414ecf68 | |
Ludovic Rousseau | 5ff8c0fdde | |
Ludovic Rousseau | f8fb33eb20 | |
Ludovic Rousseau | cac9192842 | |
Ondřej Nový | dd8acc8dfc | |
Ludovic Rousseau | ead3321018 | |
Ludovic Rousseau | 698d722bae | |
Ludovic Rousseau | d0e1c80ccb | |
Ludovic Rousseau | 9a22435a99 | |
Ludovic Rousseau | 10617332d1 | |
Ludovic Rousseau | 306afd4aa7 | |
Ludovic Rousseau | 44e666f944 | |
Ludovic Rousseau | 5f699fb6d1 | |
Ludovic Rousseau | 6367118917 | |
Ludovic Rousseau | 9b925142e4 | |
Ludovic Rousseau | 370f791afa | |
Ludovic Rousseau | 2aac340984 | |
Ludovic Rousseau | 63b8078f99 | |
Ludovic Rousseau | 34c245671a | |
Ludovic Rousseau | 6470027887 | |
Ludovic Rousseau | 6aff7ab1ea | |
Ludovic Rousseau | 69d4743285 | |
Ludovic Rousseau | 310a42b331 | |
Ludovic Rousseau | 6b8387fd91 | |
Ludovic Rousseau | dd6cf4449e | |
Ludovic Rousseau | 948b78e9c9 | |
Ludovic Rousseau | 845b4a00b4 | |
Ludovic Rousseau | c3f371e0cb | |
Ludovic Rousseau | 0fddd0c081 | |
Ludovic Rousseau | bc02259eb0 | |
Ludovic Rousseau | 4f33a1321d | |
Ludovic Rousseau | 5f973ad6ca | |
Ludovic Rousseau | 62620eb76d | |
Ludovic Rousseau | 4744a13eea | |
Ludovic Rousseau | fcda77a1e0 | |
Ludovic Rousseau | 4466e1f040 | |
Ludovic Rousseau | 510f087456 | |
Ludovic Rousseau | 480067f3c8 | |
Ludovic Rousseau | 99f73bda0b | |
Ludovic Rousseau | c51b836d64 | |
Ludovic Rousseau | 2d3f29ed9d | |
Ludovic Rousseau | 8bcee421f7 | |
Ludovic Rousseau | 260fcd5a98 | |
Ludovic Rousseau | 02b31de9cb | |
Ludovic Rousseau | ca27b2cb03 | |
Ludovic Rousseau | 51a54079f9 | |
Ludovic Rousseau | 2bbf65b095 | |
Ludovic Rousseau | ba190eaf3a | |
Ludovic Rousseau | 934df20203 | |
Ludovic Rousseau | 0c7334c911 | |
Ludovic Rousseau | 4e9287ac74 | |
Ludovic Rousseau | e4d3cb12e8 | |
Ludovic Rousseau | ec703b5280 | |
Ludovic Rousseau | 867b203939 | |
Ludovic Rousseau | 68d433d5b1 | |
Ludovic Rousseau | 94e0e119a2 | |
Ludovic Rousseau | f7eed34e55 | |
Ludovic Rousseau | 651a5d3f70 | |
Ludovic Rousseau | e71f4f297c | |
Ludovic Rousseau | fc2e6978a9 | |
Ludovic Rousseau | 7428c567e5 | |
Martin Pitt | dfbea62b71 | |
Ludovic Rousseau | 15a858a507 | |
Ludovic Rousseau | af1e9a8ac2 | |
Ludovic Rousseau | e84b74d010 | |
Ludovic Rousseau | a6c11dc1e7 | |
Ludovic Rousseau | 35aad9032f | |
Ludovic Rousseau | ed5bbc2b03 | |
Ludovic Rousseau | b5ec47ccfe | |
Ludovic Rousseau | de6dffbd37 | |
Ludovic Rousseau | 8a13568ed4 | |
Ludovic Rousseau | 3e055f5cda | |
Ludovic Rousseau | 17f6d08440 | |
Ludovic Rousseau | f761ebc1bd | |
Ludovic Rousseau | 08735303e7 | |
Ludovic Rousseau | babbf2f74a | |
Ludovic Rousseau | 5032f25722 | |
Ludovic Rousseau | 5cf19e73cd | |
Ludovic Rousseau | 6fff3df342 | |
Ludovic Rousseau | 0b9f3b07f7 | |
Ludovic Rousseau | d1aa1cdbd6 | |
Ludovic Rousseau | 4d1e774de8 | |
Ludovic Rousseau | 6a97240dfc | |
Ludovic Rousseau | c6d649988d | |
Ludovic Rousseau | afb9bd0b2c | |
Ludovic Rousseau | d92f936a1f | |
Ludovic Rousseau | e0af461603 | |
Ludovic Rousseau | cd45894a2f | |
Ludovic Rousseau | b2aa432275 | |
Ludovic Rousseau | 35c53b8885 | |
Ludovic Rousseau | 0e2eb0be56 | |
Ludovic Rousseau | 04f1ad402b | |
Ludovic Rousseau | 90d6998914 | |
Ludovic Rousseau | 0b5d1d4b77 | |
Ludovic Rousseau | cfb71e1a9f | |
Ludovic Rousseau | 2443e18a8c | |
Ludovic Rousseau | 9d4a3e029a | |
Ludovic Rousseau | 81e74cd5ea | |
Ludovic Rousseau | f465a10c4a | |
Ludovic Rousseau | 3f9118b5df | |
Ludovic Rousseau | 798d03caf5 | |
Ludovic Rousseau | c390675a6e | |
Ludovic Rousseau | 891451029b | |
Ludovic Rousseau | ec027643cb | |
Ludovic Rousseau | 9dc2311aa0 | |
Ludovic Rousseau | cfe927b44c | |
Ludovic Rousseau | a3e241709f | |
Ludovic Rousseau | fa5147e8c1 | |
Ludovic Rousseau | 277fd49853 | |
Ludovic Rousseau | cfc113a72a | |
Ludovic Rousseau | b91fbe2320 | |
Ludovic Rousseau | 769605bc43 | |
Ludovic Rousseau | 9e51edd202 | |
Ludovic Rousseau | 5408ee6de3 | |
Ludovic Rousseau | 88189a737f | |
Ludovic Rousseau | 1e388e1536 | |
Ludovic Rousseau | 62b30341c5 | |
Ludovic Rousseau | 46cc8797b2 | |
Ludovic Rousseau | a829cb1245 | |
Ludovic Rousseau | 1b864af648 | |
Ludovic Rousseau | 1a95ad832f | |
Ludovic Rousseau | a3b8d5d9e3 | |
Ludovic Rousseau | 757f717533 | |
Ludovic Rousseau | 79d5b212a1 | |
Ludovic Rousseau | 60410409c4 | |
Ludovic Rousseau | 9d7b5b4aa2 | |
Ludovic Rousseau | baa6e684f4 | |
Ludovic Rousseau | c0a2c72c71 | |
Ludovic Rousseau | 982a1abdb3 | |
Ludovic Rousseau | 15bb1a7cb4 | |
Ludovic Rousseau | 90858ecffb | |
Ludovic Rousseau | a2aea9a72e | |
Ludovic Rousseau | b1bea06ee4 | |
Ludovic Rousseau | ba0704993b | |
Ludovic Rousseau | e0be67fbd3 | |
Ludovic Rousseau | ae246d720e | |
Ludovic Rousseau | 53cb88e861 | |
Ludovic Rousseau | bd5ec797fe | |
Ludovic Rousseau | 344481ac77 | |
Ludovic Rousseau | fb06a3c4bc | |
Ludovic Rousseau | 8b23f92016 | |
Ludovic Rousseau | 7e67aa4c19 | |
Ludovic Rousseau | 84bfb8611f | |
Ludovic Rousseau | 476a777f21 | |
Ludovic Rousseau | c29340f729 | |
Ludovic Rousseau | 2ecbe5d793 | |
Ludovic Rousseau | beb596a702 | |
Ludovic Rousseau | dffd11faef | |
Ludovic Rousseau | 1613be3717 | |
Ludovic Rousseau | 19fc8785a3 | |
Ludovic Rousseau | 8dab20a383 | |
Ludovic Rousseau | 35a70990ea | |
Ludovic Rousseau | 1808e4a514 | |
Ludovic Rousseau | 4c69c3a259 | |
Ludovic Rousseau | 3068de54b8 | |
Ludovic Rousseau | 870f7186f5 | |
Ludovic Rousseau | bcec4251a7 | |
Ludovic Rousseau | 2121bb084f | |
Ludovic Rousseau | fa6777369d | |
Ludovic Rousseau | 5f6a072149 | |
Ludovic Rousseau | a5274e6123 | |
Ludovic Rousseau | 18ac091ea6 | |
Ludovic Rousseau | b5f60c69ee | |
Ludovic Rousseau | f94a0c5e88 | |
Ludovic Rousseau | a95804942e | |
Ludovic Rousseau | d712e7dac4 | |
Ludovic Rousseau | 8386c43596 | |
Ludovic Rousseau | d4cd71d4e9 | |
Ludovic Rousseau | ecf4f2a720 | |
Ludovic Rousseau | 8d902800e7 | |
Ludovic Rousseau | 1c6eee8928 | |
Ludovic Rousseau | ef372fcc00 | |
Ludovic Rousseau | d6d377cae9 | |
Ludovic Rousseau | ea9c4199fb | |
Ludovic Rousseau | b89a8d56b1 | |
Ludovic Rousseau | 31c8d92b66 | |
Ludovic Rousseau | b837eb0ed7 | |
Ludovic Rousseau | dae272b653 | |
Ludovic Rousseau | 9fd415e112 | |
Ludovic Rousseau | 550262f9f8 | |
Ludovic Rousseau | 1c5ab1fdc8 | |
Ludovic Rousseau | 749e83a19c | |
Ludovic Rousseau | 17fc504767 | |
Ludovic Rousseau | 5907d3dd42 | |
Ludovic Rousseau | 4bcc78c6bf | |
Ludovic Rousseau | b2fbc8e7e0 | |
Ludovic Rousseau | e7639692c6 | |
Ludovic Rousseau | 55023437c1 | |
Ludovic Rousseau | 46641422d6 | |
Ludovic Rousseau | e9f0418938 | |
Ludovic Rousseau | 76516bf2e0 | |
Ludovic Rousseau | 8c0000d229 | |
Ludovic Rousseau | 3600020d5b | |
Ludovic Rousseau | e871ccb8be | |
Ludovic Rousseau | 475cb36289 | |
Ludovic Rousseau | 35d9187da4 | |
Ludovic Rousseau | 1e473a529f | |
Ludovic Rousseau | 73b0dd50e2 | |
Ludovic Rousseau | 09f6ef1504 | |
Ludovic Rousseau | 5110fd0fc0 | |
Ludovic Rousseau | 6753aaf469 | |
Ludovic Rousseau | 96c2c0fb4f | |
Ludovic Rousseau | 03b4c3a0e4 | |
Ludovic Rousseau | 6d955d7b2e | |
Ludovic Rousseau | f2293e8322 | |
Ludovic Rousseau | 5daceb0a9a | |
Ludovic Rousseau | 835d20850c | |
Ludovic Rousseau | 57e064c7d6 | |
Ludovic Rousseau | 6a30dec16c | |
Ludovic Rousseau | 8cae3e0671 | |
Ludovic Rousseau | 827bde37eb | |
Ludovic Rousseau | fd41eea166 | |
Ludovic Rousseau | 4d8f58d3e4 | |
Ludovic Rousseau | fd6b3f805a | |
Ludovic Rousseau | 54b7fb01d1 | |
Ludovic Rousseau | ea9831bf55 | |
Ludovic Rousseau | 406822a1e5 | |
Ludovic Rousseau | f9ab20157b | |
Ludovic Rousseau | ad873461d4 | |
Ludovic Rousseau | d059ca7732 | |
Ludovic Rousseau | b0ef25bd6e |
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
1.9.9: Ludovic Rousseau
|
||||||
|
11 September 2022
|
||||||
|
- SCardEstablishContext() may return SCARD_W_SECURITY_VIOLATION if refused by Polkit
|
||||||
|
- Fix SCardReleaseContext() failure on orphan handles
|
||||||
|
- Fix SCardDisconnect() on orphan handle
|
||||||
|
- pcsc-spy: log the pioSendPci & pioRecvPci SCardTransmit() parameters
|
||||||
|
- Improve the log from pcscd: log the return code in text instead of hex
|
||||||
|
- Some other minor improvements
|
||||||
|
|
||||||
|
|
||||||
1.9.8: Ludovic Rousseau
|
1.9.8: Ludovic Rousseau
|
||||||
11 June 2022
|
11 June 2022
|
||||||
- Install install_spy.sh & uninstall_spy.sh scripts in docdir
|
- Install install_spy.sh & uninstall_spy.sh scripts in docdir
|
||||||
|
|
290
ChangeLog.git
290
ChangeLog.git
|
@ -1,4 +1,290 @@
|
||||||
commit 41dc5a51321bc3198af36574f73dc007cab72a7d (HEAD -> master, tag: 1.9.8)
|
commit 15c16c7796607b1c8a2ce253d3f536918ab26b4a (HEAD -> master, origin/master, origin/HEAD)
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Sep 11 16:12:03 2022 +0200
|
||||||
|
|
||||||
|
Release 1.9.9
|
||||||
|
|
||||||
|
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
|
||||||
|
ChangeLog | 10 ++++++++++
|
||||||
|
configure.ac | 2 +-
|
||||||
|
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit d069c580b74273bfcf12523b73f71bb6be9378dd (zotac/master, github/master)
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Sep 11 13:59:34 2022 +0200
|
||||||
|
|
||||||
|
c.sh: reformat
|
||||||
|
|
||||||
|
c.sh | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit 241a993f954b00cbb5904ac5fc6e4425977fc319
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Thu Sep 8 19:43:39 2022 +0200
|
||||||
|
|
||||||
|
UT control_get_firmware: support multi-readers
|
||||||
|
|
||||||
|
Do not exit if the command fails with a reader but continue with the other
|
||||||
|
readers.
|
||||||
|
|
||||||
|
UnitaryTests/control_get_firmware.py | 7 ++++++-
|
||||||
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit 1935b6997b281f0d836b829b4cfeeab6c81c3ded
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Aug 20 15:29:28 2022 +0200
|
||||||
|
|
||||||
|
SCardEstablishContext() may return SCARD_W_SECURITY_VIOLATION
|
||||||
|
|
||||||
|
See the previous patch for details.
|
||||||
|
|
||||||
|
src/winscard_clnt.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit 68f629ffecaec3886c717021e70ac62c22b38bd8
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Aug 20 15:13:00 2022 +0200
|
||||||
|
|
||||||
|
MessageReceive() may return SCARD_W_SECURITY_VIOLATION
|
||||||
|
|
||||||
|
If the daemon kills/resets the connection because the user is not
|
||||||
|
authorized by Polkit then the client side now returns
|
||||||
|
SCARD_W_SECURITY_VIOLATION instead of the too generic
|
||||||
|
SCARD_F_COMM_ERROR.
|
||||||
|
Polkit is used in RedHat/Fedora. Users connected by ssh do not have
|
||||||
|
access to PC/SC by default.
|
||||||
|
|
||||||
|
On the daemon side we have in the logs:
|
||||||
|
00000003 [139737213696960] pcscdaemon.c:133:SVCServiceRunLoop() A new
|
||||||
|
context thread creation is requested: 10
|
||||||
|
00019807 [139737012623104] auth.c:139:IsClientAuthorized() Process
|
||||||
|
41685 (user: 1000) is NOT authorized for action: access_pcsc
|
||||||
|
00000107 [139737012623104] winscard_svc.c:335:ContextThread() Rejected
|
||||||
|
unauthorized PC/SC client
|
||||||
|
But this information was not available in the client side.
|
||||||
|
|
||||||
|
pcsc_scan will now report:
|
||||||
|
$ pcsc_scan
|
||||||
|
SCardEstablishContext: Access denied.
|
||||||
|
|
||||||
|
This has been discussed on the pcsclite-muscle mailing list at:
|
||||||
|
"[Pcsclite-muscle] Change the error code when PC/SC access is refused by
|
||||||
|
polkit?"
|
||||||
|
http://lists.infradead.org/pipermail/pcsclite-muscle/2022-July/001279.html
|
||||||
|
|
||||||
|
src/winscard_msg.c | 6 +++++-
|
||||||
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit 34f27e766f413d8f37a95ad605dbe6f664c077bc
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Aug 20 15:03:53 2022 +0200
|
||||||
|
|
||||||
|
pcsc_stringify_error(): add SCARD_W_SECURITY_VIOLATION
|
||||||
|
|
||||||
|
src/error.c | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit 8eca1a54b252a84f5498ac5e5b84e81a47c9d231
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Aug 20 14:45:14 2022 +0200
|
||||||
|
|
||||||
|
Remove unsed #define
|
||||||
|
|
||||||
|
SCARD_PROTOCOL_ANY_OLD is no more used on the client side.
|
||||||
|
|
||||||
|
src/winscard_clnt.c | 3 ---
|
||||||
|
1 file changed, 3 deletions(-)
|
||||||
|
|
||||||
|
commit 6a6291eb8e7906d4f63c962360e5fdc5d6d745db
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Aug 13 14:44:28 2022 +0200
|
||||||
|
|
||||||
|
Log the error in text and not just the hex code
|
||||||
|
|
||||||
|
We now have:
|
||||||
|
00000008 [139893430789696] winscard.c:1621:SCardTransmit() Card not transacted: rv=SCARD_E_NO_SMARTCARD
|
||||||
|
instead of:
|
||||||
|
00000008 [139893430789696] winscard.c:1621:SCardTransmit() Card not transacted: rv=0x8010000C
|
||||||
|
|
||||||
|
src/eventhandler.c | 2 +-
|
||||||
|
src/readerfactory.c | 2 +-
|
||||||
|
src/winscard.c | 14 +++++++-------
|
||||||
|
3 files changed, 9 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
commit fecbcac0e6a8cf43b691151fef2967600098b49b
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Aug 13 14:52:42 2022 +0200
|
||||||
|
|
||||||
|
UnitaryTests: fix a deprecation warning
|
||||||
|
|
||||||
|
UnitaryTests/ThreadSafeConnect.py:87: DeprecationWarning: getName() is deprecated, get the name attribute instead
|
||||||
|
print("joined:", thread.getName())
|
||||||
|
|
||||||
|
UnitaryTests/ThreadSafeConnect.py | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
commit 13bd3dcc9fa1ae6894ac4f882c5a62b28a6adde5
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Aug 13 14:41:59 2022 +0200
|
||||||
|
|
||||||
|
export rv2txt() function
|
||||||
|
|
||||||
|
convert from integer rv value to a string value
|
||||||
|
SCARD_S_SUCCESS -> "SCARD_S_SUCCESS"
|
||||||
|
|
||||||
|
src/PCSC/debuglog.h | 2 ++
|
||||||
|
src/debuglog.c | 2 +-
|
||||||
|
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit 002d1ffef359cfba1c45f24c78ac21e18925e670
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Fri Aug 12 17:51:37 2022 +0200
|
||||||
|
|
||||||
|
Improve the log from pcscd
|
||||||
|
|
||||||
|
- log the return code in text instead of hex
|
||||||
|
00000002 [139848448452160] winscard_svc.c:523:ContextThread() CONNECT for client 12, rv=SCARD_E_UNKNOWN_READER
|
||||||
|
insted of:
|
||||||
|
00000004 [140270933177920] winscard_svc.c:523:ContextThread() CONNECT rv=0x80100009 for client 12
|
||||||
|
|
||||||
|
- colorize the return value in red in case it is different from SCARD_S_SUCCESS
|
||||||
|
|
||||||
|
The idea is to more easily spot an error code in the values returned by
|
||||||
|
pcscd.
|
||||||
|
|
||||||
|
src/PCSC/debuglog.h | 5 +++
|
||||||
|
src/debuglog.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++----
|
||||||
|
src/winscard_svc.c | 2 +-
|
||||||
|
3 files changed, 107 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
commit e2de54e00f2ebeebf633adef32228d2af33a6483
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sat Jul 30 14:02:49 2022 +0200
|
||||||
|
|
||||||
|
pcsc-spy: log the pioSendPci & pioRecvPci SCardTransmit() parameters
|
||||||
|
|
||||||
|
The pioSendPci contains the protocol to use and may be important to
|
||||||
|
diagnose a SCARD_E_PROTO_MISMATCH error.
|
||||||
|
|
||||||
|
src/spy/libpcscspy.c | 4 ++++
|
||||||
|
src/spy/pcsc-spy | 30 ++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 34 insertions(+)
|
||||||
|
|
||||||
|
commit af1f32ca3762374dc66aac972c0c3fc50e9ae566
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Jul 17 17:57:26 2022 +0200
|
||||||
|
|
||||||
|
pcscd.8: remove reference to bundleTool
|
||||||
|
|
||||||
|
bundleTool is no more provided with pcsc-lite since
|
||||||
|
84448b0d2a7b5300837c40311f12d81a959a9f45 in 2006.
|
||||||
|
|
||||||
|
doc/pcscd.8.in | 1 -
|
||||||
|
1 file changed, 1 deletion(-)
|
||||||
|
|
||||||
|
commit ff8f77d445ebf7f863ed4cf4951b7ab6e1d08426
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Jul 17 17:52:29 2022 +0200
|
||||||
|
|
||||||
|
pcscd.8: fix typo in manpage
|
||||||
|
|
||||||
|
doc/pcscd.8.in | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
commit c35130f2215b75c6d54c4f0162d68548a6de4bab
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Jun 19 21:32:20 2022 +0200
|
||||||
|
|
||||||
|
Improve SCardDisconnect fix
|
||||||
|
|
||||||
|
Same justification as for the previous patch. RFReaderInfoById() may
|
||||||
|
return SCARD_E_READER_UNAVAILABLE.
|
||||||
|
|
||||||
|
src/winscard.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit d7a08877c3f1d423f8fcfcb5b60f2cf6fefeceda
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Jun 19 21:27:46 2022 +0200
|
||||||
|
|
||||||
|
Improve SCardReleaseContext fix
|
||||||
|
|
||||||
|
From Maksim Ivanov:
|
||||||
|
SCARD_E_READER_UNAVAILABLE can be returned by RFReaderInfoById(): it's a
|
||||||
|
corner case when the reader context is still there, but has a zero
|
||||||
|
reference count.
|
||||||
|
|
||||||
|
See RFReaderInfoById() using the REF_READER macro, which calls
|
||||||
|
_RefReader() (and returns its error code on error), which in turn has
|
||||||
|
this code:
|
||||||
|
|
||||||
|
if (0 == sReader->reference)
|
||||||
|
return SCARD_E_READER_UNAVAILABLE;
|
||||||
|
|
||||||
|
src/winscard_svc.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
commit d0e594789096c7b99ace1ec6ab2cecb7961747cb
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Jun 19 18:53:36 2022 +0200
|
||||||
|
|
||||||
|
Test orphan handles
|
||||||
|
|
||||||
|
Check the return values of SCardDisconnect() and SCardReleaseContext()
|
||||||
|
after a reader removal.
|
||||||
|
|
||||||
|
UnitaryTests/SCard_RemovedReader.py | 80 +++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 80 insertions(+)
|
||||||
|
|
||||||
|
commit a4e5bf41ae652fd3837cc446a5a8cce0f4249845
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Sun Jun 19 18:49:42 2022 +0200
|
||||||
|
|
||||||
|
Fix SCardDisconnect on orphan handle
|
||||||
|
|
||||||
|
If the reader is removed between SCardConnect() and SCardDisconnect()
|
||||||
|
then SCardDisconnect() should not fail with SCARD_E_INVALID_VALUE.
|
||||||
|
|
||||||
|
We now have the same behavior as on Windows 10.
|
||||||
|
|
||||||
|
This patch is quiet similar to the previous one from Maksim Ivanov.
|
||||||
|
Thanks for the idea.
|
||||||
|
|
||||||
|
src/winscard.c | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
commit 2735a6d1b7ffa5ca81e602417516a9c0702c0fcd
|
||||||
|
Author: Maksim Ivanov <emaxx@google.com>
|
||||||
|
Date: Sat Jun 18 13:46:38 2022 +0200
|
||||||
|
|
||||||
|
Fix SCardReleaseContext failure on orphan handles
|
||||||
|
|
||||||
|
Fix returning a spurious error from SCardReleaseContext() for a
|
||||||
|
correct SCARDCONTEXT, in case there was an orphan SCARDHANDLE left after
|
||||||
|
disconnecting a reader.
|
||||||
|
|
||||||
|
The error was caused by the fact that SCardReleaseContext attempts to do
|
||||||
|
SCardDisconnect for all active SCARDHANDLEs stored in SCARDCONTEXT,
|
||||||
|
which fails when the handle was already deleted by the hotplug code from
|
||||||
|
READER_CONTEXT or the reader got zero reference count.
|
||||||
|
|
||||||
|
src/winscard_svc.c | 59 ++++++++++++++++++++++++++++++------------------------
|
||||||
|
1 file changed, 33 insertions(+), 26 deletions(-)
|
||||||
|
|
||||||
|
commit 2c3e9156bea6d658f5f7af801f5b92cdb9c83882
|
||||||
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
Date: Mon Jun 13 17:11:50 2022 +0200
|
||||||
|
|
||||||
|
pcscd.h: remove unused PCSCLITE_STATUS_WAIT
|
||||||
|
|
||||||
|
PCSCLITE_STATUS_WAIT is no more used since
|
||||||
|
c2a93242e445558ead8eea40223482ee8995954a in 2008.
|
||||||
|
|
||||||
|
src/pcscd.h.in | 2 --
|
||||||
|
1 file changed, 2 deletions(-)
|
||||||
|
|
||||||
|
commit 41dc5a51321bc3198af36574f73dc007cab72a7d (tag: 1.9.8)
|
||||||
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
Date: Sat Jun 11 10:49:34 2022 +0200
|
Date: Sat Jun 11 10:49:34 2022 +0200
|
||||||
|
|
||||||
|
@ -10,7 +296,7 @@ Date: Sat Jun 11 10:49:34 2022 +0200
|
||||||
configure.ac | 2 +-
|
configure.ac | 2 +-
|
||||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
commit f7f80db5fae5f15c0d0ce2e6cd81a5c11c0a7510 (zotac/master, origin/master, origin/HEAD, github/master)
|
commit f7f80db5fae5f15c0d0ce2e6cd81a5c11c0a7510
|
||||||
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
Author: Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
Date: Fri Jun 10 09:58:46 2022 +0200
|
Date: Fri Jun 10 09:58:46 2022 +0200
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ DIST_SUBDIRS = $(SUBDIRS)
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||||
$(top_srcdir)/src/PCSC/pcsclite.h.in AUTHORS COPYING ChangeLog \
|
$(top_srcdir)/src/PCSC/pcsclite.h.in AUTHORS COPYING ChangeLog \
|
||||||
INSTALL NEWS README TODO ar-lib compile config.guess \
|
INSTALL NEWS README TODO ar-lib compile config.guess \
|
||||||
config.sub install-sh ltmain.sh missing ylwrap
|
config.sub depcomp install-sh ltmain.sh missing ylwrap
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
distdir = $(PACKAGE)-$(VERSION)
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
top_distdir = $(distdir)
|
top_distdir = $(distdir)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.71 for pcsc-lite 1.9.8.
|
# Generated by GNU Autoconf 2.71 for pcsc-lite 1.9.9.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
|
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
|
||||||
|
@ -618,8 +618,8 @@ MAKEFLAGS=
|
||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='pcsc-lite'
|
PACKAGE_NAME='pcsc-lite'
|
||||||
PACKAGE_TARNAME='pcsc-lite'
|
PACKAGE_TARNAME='pcsc-lite'
|
||||||
PACKAGE_VERSION='1.9.8'
|
PACKAGE_VERSION='1.9.9'
|
||||||
PACKAGE_STRING='pcsc-lite 1.9.8'
|
PACKAGE_STRING='pcsc-lite 1.9.9'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL=''
|
||||||
|
|
||||||
|
@ -1424,7 +1424,7 @@ if test "$ac_init_help" = "long"; then
|
||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures pcsc-lite 1.9.8 to adapt to many kinds of systems.
|
\`configure' configures pcsc-lite 1.9.9 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
|
@ -1495,7 +1495,7 @@ fi
|
||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of pcsc-lite 1.9.8:";;
|
short | recursive ) echo "Configuration of pcsc-lite 1.9.9:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
|
@ -1649,7 +1649,7 @@ fi
|
||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
pcsc-lite configure 1.9.8
|
pcsc-lite configure 1.9.9
|
||||||
generated by GNU Autoconf 2.71
|
generated by GNU Autoconf 2.71
|
||||||
|
|
||||||
Copyright (C) 2021 Free Software Foundation, Inc.
|
Copyright (C) 2021 Free Software Foundation, Inc.
|
||||||
|
@ -2065,7 +2065,7 @@ cat >config.log <<_ACEOF
|
||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by pcsc-lite $as_me 1.9.8, which was
|
It was created by pcsc-lite $as_me 1.9.9, which was
|
||||||
generated by GNU Autoconf 2.71. Invocation command line was
|
generated by GNU Autoconf 2.71. Invocation command line was
|
||||||
|
|
||||||
$ $0$ac_configure_args_raw
|
$ $0$ac_configure_args_raw
|
||||||
|
@ -3336,7 +3336,7 @@ fi
|
||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='pcsc-lite'
|
PACKAGE='pcsc-lite'
|
||||||
VERSION='1.9.8'
|
VERSION='1.9.9'
|
||||||
|
|
||||||
|
|
||||||
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
|
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
|
||||||
|
@ -17242,7 +17242,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by pcsc-lite $as_me 1.9.8, which was
|
This file was extended by pcsc-lite $as_me 1.9.9, which was
|
||||||
generated by GNU Autoconf 2.71. Invocation command line was
|
generated by GNU Autoconf 2.71. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
|
@ -17310,7 +17310,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config='$ac_cs_config_escaped'
|
ac_cs_config='$ac_cs_config_escaped'
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
pcsc-lite config.status 1.9.8
|
pcsc-lite config.status 1.9.9
|
||||||
configured by $0, generated by GNU Autoconf 2.71,
|
configured by $0, generated by GNU Autoconf 2.71,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
|
|
||||||
AC_INIT([pcsc-lite],[1.9.8])
|
AC_INIT([pcsc-lite],[1.9.9])
|
||||||
AC_CONFIG_SRCDIR(src/pcscdaemon.c)
|
AC_CONFIG_SRCDIR(src/pcscdaemon.c)
|
||||||
AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip)
|
AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip)
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,65 @@
|
||||||
|
Source: pcsc-lite
|
||||||
|
Section: misc
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Ludovic Rousseau <rousseau@debian.org>
|
||||||
|
Build-Depends: autoconf-archive,
|
||||||
|
debhelper-compat (= 12),
|
||||||
|
flex,
|
||||||
|
libsystemd-dev,
|
||||||
|
libudev-dev [linux-any],
|
||||||
|
libusb2-dev [kfreebsd-any],
|
||||||
|
pkg-config
|
||||||
|
Standards-Version: 4.6.1
|
||||||
|
Rules-Requires-Root: no
|
||||||
|
Vcs-Git: https://salsa.debian.org/debian/pcsc-lite.git
|
||||||
|
Vcs-Browser: https://salsa.debian.org/debian/pcsc-lite
|
||||||
|
Homepage: https://pcsclite.apdu.fr/
|
||||||
|
|
||||||
|
Package: pcscd
|
||||||
|
Architecture: any
|
||||||
|
Depends: libccid | pcsc-ifd-handler, ${shlibs:Depends}, ${misc:Depends}, lsb-base, libpcsclite1 (= ${binary:Version})
|
||||||
|
Suggests: systemd
|
||||||
|
Multi-Arch: foreign
|
||||||
|
Pre-Depends: ${misc:Pre-Depends}
|
||||||
|
Description: Middleware to access a smart card using PC/SC (daemon side)
|
||||||
|
The purpose of PC/SC Lite is to provide a Windows(R) SCard interface
|
||||||
|
in a very small form factor for communicating to smart cards and
|
||||||
|
smart cards readers.
|
||||||
|
.
|
||||||
|
The PC/SC daemon is used to dynamically allocate/deallocate reader
|
||||||
|
drivers at runtime and manage connections to the readers.
|
||||||
|
|
||||||
|
Package: libpcsclite-dev
|
||||||
|
Section: libdevel
|
||||||
|
Architecture: any
|
||||||
|
Depends: libpcsclite1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Pre-Depends: ${misc:Pre-Depends}
|
||||||
|
Recommends: python3
|
||||||
|
Multi-Arch: same
|
||||||
|
Description: Middleware to access a smart card using PC/SC (development files)
|
||||||
|
The purpose of PC/SC Lite is to provide a Windows(R) SCard interface
|
||||||
|
in a very small form factor for communicating to smart cards and
|
||||||
|
smart cards readers.
|
||||||
|
.
|
||||||
|
This package contains the files needed for compiling and linking
|
||||||
|
an application that communicates to any reader available to the
|
||||||
|
PC/SC daemon.
|
||||||
|
.
|
||||||
|
This package also contains the PC/SC spying library: libpcscspy.so
|
||||||
|
See http://ludovicrousseau.blogspot.com/2011/11/pcsc-api-spy-third-try.html
|
||||||
|
|
||||||
|
Package: libpcsclite1
|
||||||
|
Section: libs
|
||||||
|
Architecture: any
|
||||||
|
Breaks: libpcsclite-dev (<< ${binary:Version}), pcscd (<< ${binary:Version})
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Pre-Depends: ${misc:Pre-Depends}
|
||||||
|
Multi-Arch: same
|
||||||
|
Suggests: pcscd (= ${binary:Version})
|
||||||
|
Description: Middleware to access a smart card using PC/SC (library)
|
||||||
|
The purpose of PC/SC Lite is to provide a Windows(R) SCard interface
|
||||||
|
in a very small form factor for communicating to smartcards and
|
||||||
|
readers.
|
||||||
|
.
|
||||||
|
The PC/SC Lite library is used to connect to the PC/SC daemon from
|
||||||
|
a client application and provide access to the desired reader.
|
|
@ -0,0 +1,57 @@
|
||||||
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: pcsc-lite
|
||||||
|
Upstream-Contact: muscle@lists.musclecard.com
|
||||||
|
ludovic.rousseau@free.fr
|
||||||
|
Source: https://salsa.debian.org/rousseau/PCSC
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: Copyright (c) 1999-2003 David Corcoran <corcoran@linuxnet.com>
|
||||||
|
Copyright (c) 2001-2022 Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
License: BSD-3-clause
|
||||||
|
All rights reserved.
|
||||||
|
.
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
.
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. The name of the author may not be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
.
|
||||||
|
Changes to this license can be made only by the copyright author with
|
||||||
|
explicit written consent.
|
||||||
|
.
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
Files: src/simclist.?
|
||||||
|
Copyright: Copyright (c) 2007,2008 Mij <mij@bitchx.it>
|
||||||
|
License: ISC
|
||||||
|
Permission to use, copy, modify, and distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
Files: debian/* src/spy/*
|
||||||
|
Copyright: 2002-2022, Ludovic Rousseau <ludovic.rousseau@free.fr>
|
||||||
|
License: GPL-3+
|
||||||
|
/usr/share/common-licenses/GPL-3
|
|
@ -0,0 +1,2 @@
|
||||||
|
usr/share/doc/pcsc-lite/install_spy.sh
|
||||||
|
usr/share/doc/pcsc-lite/uninstall_spy.sh
|
|
@ -0,0 +1 @@
|
||||||
|
doc/example/pcsc_demo.c
|
|
@ -0,0 +1,5 @@
|
||||||
|
usr/include/PCSC/*
|
||||||
|
usr/lib/*/libpcsclite.so
|
||||||
|
usr/lib/*/pkgconfig/libpcsclite.pc
|
||||||
|
usr/lib/*/libpcscspy.so.*
|
||||||
|
usr/bin/pcsc-spy
|
|
@ -0,0 +1 @@
|
||||||
|
debian/tmp/usr/share/man/man1/pcsc-spy.1
|
|
@ -0,0 +1,24 @@
|
||||||
|
libpcscspy.so.0 libpcsclite-dev #MINVER#
|
||||||
|
* Build-Depends-Package:libpcsclite-dev
|
||||||
|
SCardBeginTransaction@Base 1.8.0
|
||||||
|
SCardCancel@Base 1.8.0
|
||||||
|
SCardConnect@Base 1.8.0
|
||||||
|
SCardControl@Base 1.8.0
|
||||||
|
SCardDisconnect@Base 1.8.0
|
||||||
|
SCardEndTransaction@Base 1.8.0
|
||||||
|
SCardEstablishContext@Base 1.8.0
|
||||||
|
SCardFreeMemory@Base 1.8.0
|
||||||
|
SCardGetAttrib@Base 1.8.0
|
||||||
|
SCardGetStatusChange@Base 1.8.0
|
||||||
|
SCardIsValidContext@Base 1.8.0
|
||||||
|
SCardListReaderGroups@Base 1.8.0
|
||||||
|
SCardListReaders@Base 1.8.0
|
||||||
|
SCardReconnect@Base 1.8.0
|
||||||
|
SCardReleaseContext@Base 1.8.0
|
||||||
|
SCardSetAttrib@Base 1.8.0
|
||||||
|
SCardStatus@Base 1.8.0
|
||||||
|
SCardTransmit@Base 1.8.0
|
||||||
|
g_rgSCardRawPci@Base 1.8.0
|
||||||
|
g_rgSCardT0Pci@Base 1.8.0
|
||||||
|
g_rgSCardT1Pci@Base 1.8.0
|
||||||
|
pcsc_stringify_error@Base 1.8.0
|
|
@ -0,0 +1 @@
|
||||||
|
usr/lib/*/libpcsclite.so.1*
|
|
@ -0,0 +1,24 @@
|
||||||
|
libpcsclite.so.1 libpcsclite1 #MINVER#
|
||||||
|
* Build-Depends-Package:libpcsclite-dev
|
||||||
|
SCardBeginTransaction@Base 1.0.0
|
||||||
|
SCardCancel@Base 1.0.0
|
||||||
|
SCardConnect@Base 1.0.0
|
||||||
|
SCardControl@Base 1.3.0
|
||||||
|
SCardDisconnect@Base 1.0.0
|
||||||
|
SCardEndTransaction@Base 1.0.0
|
||||||
|
SCardEstablishContext@Base 1.0.0
|
||||||
|
SCardFreeMemory@Base 1.5.0
|
||||||
|
SCardGetAttrib@Base 1.0.0
|
||||||
|
SCardGetStatusChange@Base 1.0.0
|
||||||
|
SCardIsValidContext@Base 1.3.3
|
||||||
|
SCardListReaderGroups@Base 1.0.0
|
||||||
|
SCardListReaders@Base 1.0.0
|
||||||
|
SCardReconnect@Base 1.0.0
|
||||||
|
SCardReleaseContext@Base 1.0.0
|
||||||
|
SCardSetAttrib@Base 1.0.0
|
||||||
|
SCardStatus@Base 1.0.0
|
||||||
|
SCardTransmit@Base 1.0.0
|
||||||
|
g_rgSCardRawPci@Base 1.0.0
|
||||||
|
g_rgSCardT0Pci@Base 1.0.0
|
||||||
|
g_rgSCardT1Pci@Base 1.0.0
|
||||||
|
pcsc_stringify_error@Base 1.3.0
|
|
@ -0,0 +1,4 @@
|
||||||
|
usr/share/doc/pcsc-lite/README.DAEMON
|
||||||
|
usr/lib/*/libpcsclite.la
|
||||||
|
usr/lib/*/libpcscspy.so
|
||||||
|
usr/lib/*/libpcscspy.la
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- a/src/PCSC/pcsclite.h.in
|
||||||
|
+++ b/src/PCSC/pcsclite.h.in
|
||||||
|
@@ -281,7 +281,7 @@ extern const SCARD_IO_REQUEST g_rgSCardT
|
||||||
|
|
||||||
|
#define PCSCLITE_VERSION_NUMBER "@VERSION@" /**< Current version */
|
||||||
|
/** Maximum readers context (a slot is count as a reader) */
|
||||||
|
-#define PCSCLITE_MAX_READERS_CONTEXTS 16
|
||||||
|
+#define PCSCLITE_MAX_READERS_CONTEXTS 256
|
||||||
|
|
||||||
|
#define MAX_READERNAME 128
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
256slots.patch
|
|
@ -0,0 +1,3 @@
|
||||||
|
README
|
||||||
|
SECURITY
|
||||||
|
usr/share/doc/pcsc-lite/README.polkit
|
|
@ -0,0 +1,146 @@
|
||||||
|
#! /bin/sh
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: pcscd
|
||||||
|
# Required-Start: $local_fs $remote_fs $syslog
|
||||||
|
# Required-Stop: $local_fs $remote_fs $syslog
|
||||||
|
# Should-Start: udev
|
||||||
|
# Should-Stop: udev
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: Daemon to access a smart card using PC/SC
|
||||||
|
# Description: The PC/SC daemon is used to dynamically
|
||||||
|
# allocate/deallocate reader drivers at runtime and manage
|
||||||
|
# connections to the readers.
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# Authors:
|
||||||
|
# Carlos Prados Bocos <cprados@debian.org>
|
||||||
|
# Ludovic Rousseau <rousseau@debian.org>
|
||||||
|
|
||||||
|
# Do NOT "set -e"
|
||||||
|
|
||||||
|
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||||
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||||
|
DESC="PCSC Lite resource manager"
|
||||||
|
NAME=pcscd
|
||||||
|
DAEMON=/usr/sbin/$NAME
|
||||||
|
IPCDIR=/var/run/pcscd
|
||||||
|
PIDFILE=$IPCDIR/$NAME.pid
|
||||||
|
SCRIPTNAME=/etc/init.d/$NAME
|
||||||
|
|
||||||
|
# if you need to pass arguments to pcscd you should edit the file
|
||||||
|
# /etc/default/pcscd and add a line
|
||||||
|
# DAEMON_ARGS="--your-option"
|
||||||
|
|
||||||
|
# Exit if the package is not installed
|
||||||
|
[ -x "$DAEMON" ] || exit 0
|
||||||
|
|
||||||
|
# Read configuration variable file if it is present
|
||||||
|
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||||
|
|
||||||
|
# Load the VERBOSE setting and other rcS variables
|
||||||
|
. /lib/init/vars.sh
|
||||||
|
|
||||||
|
# Define LSB log_* functions.
|
||||||
|
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
# get LANG variable (code from /etc/init.d/keymap.sh)
|
||||||
|
ENV_FILE="none"
|
||||||
|
[ -r /etc/environment ] && ENV_FILE="/etc/environment"
|
||||||
|
[ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
|
||||||
|
|
||||||
|
value=$(grep -E "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
|
||||||
|
eval LANG=$value
|
||||||
|
|
||||||
|
#
|
||||||
|
# Function that starts the daemon/service
|
||||||
|
#
|
||||||
|
do_start()
|
||||||
|
{
|
||||||
|
# create $IPCDIR with correct access rights
|
||||||
|
if [ ! -d $IPCDIR ]
|
||||||
|
then
|
||||||
|
rm -rf $IPCDIR
|
||||||
|
mkdir $IPCDIR
|
||||||
|
fi
|
||||||
|
chmod 0755 $IPCDIR
|
||||||
|
|
||||||
|
# Return
|
||||||
|
# 0 if daemon has been started
|
||||||
|
# 1 if daemon was already running
|
||||||
|
# 2 if daemon could not be started
|
||||||
|
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|
||||||
|
|| return 1
|
||||||
|
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
|
||||||
|
$DAEMON_ARGS \
|
||||||
|
|| return 2
|
||||||
|
# Add code here, if necessary, that waits for the process to be ready
|
||||||
|
# to handle requests from services started subsequently which depend
|
||||||
|
# on this one. As a last resort, sleep for some time.
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Function that stops the daemon/service
|
||||||
|
#
|
||||||
|
do_stop()
|
||||||
|
{
|
||||||
|
# Return
|
||||||
|
# 0 if daemon has been stopped
|
||||||
|
# 1 if daemon was already stopped
|
||||||
|
# 2 if daemon could not be stopped
|
||||||
|
# other if a failure occurred
|
||||||
|
start-stop-daemon --stop --quiet --retry=3 --pidfile $PIDFILE --name $NAME
|
||||||
|
RETVAL="$?"
|
||||||
|
[ "$RETVAL" = 2 ] && return 2
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||||
|
do_start
|
||||||
|
case "$?" in
|
||||||
|
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||||
|
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||||
|
do_stop
|
||||||
|
case "$?" in
|
||||||
|
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||||
|
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||||
|
;;
|
||||||
|
restart|force-reload)
|
||||||
|
#
|
||||||
|
# If the "reload" option is implemented then remove the
|
||||||
|
# 'force-reload' alias
|
||||||
|
#
|
||||||
|
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||||
|
do_stop
|
||||||
|
case "$?" in
|
||||||
|
0|1)
|
||||||
|
do_start
|
||||||
|
case "$?" in
|
||||||
|
0) log_end_msg 0 ;;
|
||||||
|
1) log_end_msg 1 ;; # Old process is still running
|
||||||
|
*) log_end_msg 1 ;; # Failed to start
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# Failed to stop
|
||||||
|
log_end_msg 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||||
|
exit 3
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
:
|
|
@ -0,0 +1,3 @@
|
||||||
|
usr/sbin/pcscd
|
||||||
|
usr/lib/systemd/system/pcscd.socket
|
||||||
|
usr/lib/systemd/system/pcscd.service
|
|
@ -0,0 +1 @@
|
||||||
|
rm_conffile /etc/reader.conf.d/0comments 1.9.3-2~ pcscd
|
|
@ -0,0 +1,2 @@
|
||||||
|
debian/tmp/usr/share/man/man8/pcscd.8
|
||||||
|
debian/tmp/usr/share/man/man5/reader.conf.5
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
|
||||||
|
ifeq ($(DEB_HOST_ARCH_OS),hurd)
|
||||||
|
EXTRA_CONFIGURE_ARGS += --disable-usb
|
||||||
|
endif
|
||||||
|
|
||||||
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@
|
||||||
|
|
||||||
|
override_dh_auto_configure:
|
||||||
|
dh_auto_configure -- $(EXTRA_CONFIGURE_ARGS) \
|
||||||
|
--with-systemdsystemunitdir=/usr/lib/systemd/system \
|
||||||
|
--enable-usbdropdir=/usr/lib/pcsc/drivers \
|
||||||
|
--enable-ipcdir=/run/pcscd \
|
||||||
|
$(shell dpkg-buildflags --export=configure)
|
||||||
|
|
||||||
|
ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes) $(DEB_HOST_ARCH), yes i386)
|
||||||
|
skip_packages = -Npcscd
|
||||||
|
endif
|
||||||
|
|
||||||
|
override_dh_builddeb:
|
||||||
|
dh_builddeb ${skip_packages}
|
||||||
|
|
||||||
|
override_dh_gencontrol:
|
||||||
|
dh_gencontrol ${skip_packages}
|
|
@ -0,0 +1 @@
|
||||||
|
3.0 (quilt)
|
|
@ -0,0 +1,5 @@
|
||||||
|
Name: pcsc-lite
|
||||||
|
Repository-Browse: https://salsa.debian.org/rousseau/PCSC
|
||||||
|
Repository: https://salsa.debian.org/rousseau/PCSC.git
|
||||||
|
Bug-Database: https://salsa.debian.org/rousseau/PCSC/issues
|
||||||
|
Bug-Submit: https://salsa.debian.org/rousseau/PCSC/issues/new
|
|
@ -0,0 +1,63 @@
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
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
|
||||||
|
=rjKU
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
|
@ -0,0 +1,4 @@
|
||||||
|
version=4
|
||||||
|
opts=pgpsigurlmangle=s/$/.asc/ \
|
||||||
|
https://pcsclite.apdu.fr/files/ \
|
||||||
|
pcsc-lite-(\d.*)\.(?:tgz|tar\.(?:gz|bz2|xz))
|
|
@ -77,7 +77,7 @@ files to detect added or removed non-USB readers (serial or PCMCIA).
|
||||||
.BR \-x ", " \-\-auto\-exit
|
.BR \-x ", " \-\-auto\-exit
|
||||||
pcscd will quit after 60 seconds of inactivity after the release of
|
pcscd will quit after 60 seconds of inactivity after the release of
|
||||||
the last PC/SC context. This is used when pcscd
|
the last PC/SC context. This is used when pcscd
|
||||||
os started on demand by systemd.
|
is started on demand by systemd.
|
||||||
.TP
|
.TP
|
||||||
.BR \-S ", " \-\-reader\-name\-no\-serial
|
.BR \-S ", " \-\-reader\-name\-no\-serial
|
||||||
Do not include the USB serial number in the reader name.
|
Do not include the USB serial number in the reader name.
|
||||||
|
@ -90,7 +90,7 @@ coordinates communications with smart card readers and smart cards and
|
||||||
cryptographic tokens that are connected to the system.
|
cryptographic tokens that are connected to the system.
|
||||||
.PP
|
.PP
|
||||||
It allows applications to access smart cards and readers using the
|
It allows applications to access smart cards and readers using the
|
||||||
winscard API but without knowing details of the card or reader.
|
WinSCard API but without knowing details of the card or reader.
|
||||||
.PP
|
.PP
|
||||||
pcscd coordinates the loading of drivers for card readers.
|
pcscd coordinates the loading of drivers for card readers.
|
||||||
.
|
.
|
||||||
|
@ -125,7 +125,6 @@ file.
|
||||||
: directory containing bundles for USB drivers
|
: directory containing bundles for USB drivers
|
||||||
.
|
.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR bundleTool (8),
|
|
||||||
.BR reader.conf (5),
|
.BR reader.conf (5),
|
||||||
.BR syslog (3)
|
.BR syslog (3)
|
||||||
.
|
.
|
||||||
|
|
|
@ -92,9 +92,11 @@ enum {
|
||||||
#define Log2(priority, fmt, data) do {(void)priority; } while(0)
|
#define Log2(priority, fmt, data) do {(void)priority; } while(0)
|
||||||
#define Log3(priority, fmt, data1, data2) do {int p = priority; (void)p; } while(0)
|
#define Log3(priority, fmt, data1, data2) do {int p = priority; (void)p; } while(0)
|
||||||
#define Log4(priority, fmt, data1, data2, data3) do { } while(0)
|
#define Log4(priority, fmt, data1, data2, data3) do { } while(0)
|
||||||
|
#define LogRv4(priority, rv, fmt, data1, data2) do { } while(0)
|
||||||
#define Log5(priority, fmt, data1, data2, data3, data4) do { } while(0)
|
#define Log5(priority, fmt, data1, data2, data3, data4) do { } while(0)
|
||||||
#define Log9(priority, fmt, data1, data2, data3, data4, data5, data6, data7, data8) do { } while(0)
|
#define Log9(priority, fmt, data1, data2, data3, data4, data5, data6, data7, data8) do { } while(0)
|
||||||
#define LogXxd(priority, msg, buffer, size) do { } while(0)
|
#define LogXxd(priority, msg, buffer, size) do { } while(0)
|
||||||
|
#define rv2text(rv) ""
|
||||||
|
|
||||||
#define DebugLogA(a)
|
#define DebugLogA(a)
|
||||||
#define DebugLogB(a, b)
|
#define DebugLogB(a, b)
|
||||||
|
@ -107,9 +109,11 @@ enum {
|
||||||
#define Log2(priority, fmt, data) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data)
|
#define Log2(priority, fmt, data) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data)
|
||||||
#define Log3(priority, fmt, data1, data2) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2)
|
#define Log3(priority, fmt, data1, data2) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2)
|
||||||
#define Log4(priority, fmt, data1, data2, data3) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2, data3)
|
#define Log4(priority, fmt, data1, data2, data3) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2, data3)
|
||||||
|
#define LogRv4(priority, rv, fmt, data1, data2) log_msg_rv(priority, rv, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2)
|
||||||
#define Log5(priority, fmt, data1, data2, data3, data4) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2, data3, data4)
|
#define Log5(priority, fmt, data1, data2, data3, data4) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2, data3, data4)
|
||||||
#define Log9(priority, fmt, data1, data2, data3, data4, data5, data6, data7, data8) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2, data3, data4, data5, data6, data7, data8)
|
#define Log9(priority, fmt, data1, data2, data3, data4, data5, data6, data7, data8) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2, data3, data4, data5, data6, data7, data8)
|
||||||
#define LogXxd(priority, msg, buffer, size) log_xxd(priority, msg, buffer, size)
|
#define LogXxd(priority, msg, buffer, size) log_xxd(priority, msg, buffer, size)
|
||||||
|
const char * rv2text(unsigned int rv);
|
||||||
|
|
||||||
#define DebugLogA(a) Log1(PCSC_LOG_INFO, a)
|
#define DebugLogA(a) Log1(PCSC_LOG_INFO, a)
|
||||||
#define DebugLogB(a, b) Log2(PCSC_LOG_INFO, a, b)
|
#define DebugLogB(a, b) Log2(PCSC_LOG_INFO, a, b)
|
||||||
|
@ -117,6 +121,9 @@ enum {
|
||||||
|
|
||||||
#endif /* NO_LOG */
|
#endif /* NO_LOG */
|
||||||
|
|
||||||
|
PCSC_API void log_msg_rv(const int priority, unsigned int rv, const char *fmt, ...)
|
||||||
|
__attribute__((format(printf, 3, 4)));
|
||||||
|
|
||||||
PCSC_API void log_msg(const int priority, const char *fmt, ...)
|
PCSC_API void log_msg(const int priority, const char *fmt, ...)
|
||||||
__attribute__((format(printf, 2, 3)));
|
__attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
|
|
109
src/debuglog.c
109
src/debuglog.c
|
@ -110,7 +110,27 @@ static char LogLevel = PCSC_LOG_ERROR;
|
||||||
|
|
||||||
static signed char LogDoColor = 0; /**< no color by default */
|
static signed char LogDoColor = 0; /**< no color by default */
|
||||||
|
|
||||||
static void log_line(const int priority, const char *DebugBuffer);
|
static void log_line(const int priority, const char *DebugBuffer,
|
||||||
|
unsigned int rv);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* log a message with the RV value returned by the daemon
|
||||||
|
*/
|
||||||
|
void log_msg_rv(const int priority, unsigned int rv, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
char DebugBuffer[DEBUG_BUF_SIZE];
|
||||||
|
va_list argptr;
|
||||||
|
|
||||||
|
if ((priority < LogLevel) /* log priority lower than threshold? */
|
||||||
|
|| (DEBUGLOG_NO_DEBUG == LogMsgType))
|
||||||
|
return;
|
||||||
|
|
||||||
|
va_start(argptr, fmt);
|
||||||
|
vsnprintf(DebugBuffer, sizeof DebugBuffer, fmt, argptr);
|
||||||
|
va_end(argptr);
|
||||||
|
|
||||||
|
log_line(priority, DebugBuffer, rv);
|
||||||
|
}
|
||||||
|
|
||||||
void log_msg(const int priority, const char *fmt, ...)
|
void log_msg(const int priority, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -125,10 +145,62 @@ void log_msg(const int priority, const char *fmt, ...)
|
||||||
vsnprintf(DebugBuffer, sizeof DebugBuffer, fmt, argptr);
|
vsnprintf(DebugBuffer, sizeof DebugBuffer, fmt, argptr);
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
log_line(priority, DebugBuffer);
|
log_line(priority, DebugBuffer, -1);
|
||||||
} /* log_msg */
|
} /* log_msg */
|
||||||
|
|
||||||
static void log_line(const int priority, const char *DebugBuffer)
|
/* convert from integer rv value to a string value
|
||||||
|
* SCARD_S_SUCCESS -> "SCARD_S_SUCCESS"
|
||||||
|
*/
|
||||||
|
const char * rv2text(unsigned int rv)
|
||||||
|
{
|
||||||
|
const char *rv_text = NULL;
|
||||||
|
static __thread char strError[30];
|
||||||
|
|
||||||
|
#define CASE(x) \
|
||||||
|
case x: \
|
||||||
|
rv_text = "rv=" #x; \
|
||||||
|
break
|
||||||
|
|
||||||
|
if (rv != (unsigned int)-1)
|
||||||
|
{
|
||||||
|
switch (rv)
|
||||||
|
{
|
||||||
|
CASE(SCARD_S_SUCCESS);
|
||||||
|
CASE(SCARD_E_CANCELLED);
|
||||||
|
CASE(SCARD_E_INSUFFICIENT_BUFFER);
|
||||||
|
CASE(SCARD_E_INVALID_HANDLE);
|
||||||
|
CASE(SCARD_E_INVALID_PARAMETER);
|
||||||
|
CASE(SCARD_E_INVALID_VALUE);
|
||||||
|
CASE(SCARD_E_NO_MEMORY);
|
||||||
|
CASE(SCARD_E_NO_SERVICE);
|
||||||
|
CASE(SCARD_E_NO_SMARTCARD);
|
||||||
|
CASE(SCARD_E_NOT_TRANSACTED);
|
||||||
|
CASE(SCARD_E_PROTO_MISMATCH);
|
||||||
|
CASE(SCARD_E_READER_UNAVAILABLE);
|
||||||
|
CASE(SCARD_E_SHARING_VIOLATION);
|
||||||
|
CASE(SCARD_E_TIMEOUT);
|
||||||
|
CASE(SCARD_E_UNKNOWN_READER);
|
||||||
|
CASE(SCARD_E_UNSUPPORTED_FEATURE);
|
||||||
|
CASE(SCARD_F_COMM_ERROR);
|
||||||
|
CASE(SCARD_F_INTERNAL_ERROR);
|
||||||
|
CASE(SCARD_W_REMOVED_CARD);
|
||||||
|
CASE(SCARD_W_RESET_CARD);
|
||||||
|
CASE(SCARD_W_UNPOWERED_CARD);
|
||||||
|
CASE(SCARD_W_UNRESPONSIVE_CARD);
|
||||||
|
CASE(SCARD_E_NO_READERS_AVAILABLE);
|
||||||
|
|
||||||
|
default:
|
||||||
|
(void)snprintf(strError, sizeof(strError)-1,
|
||||||
|
"Unknown error: 0x%08X", rv);
|
||||||
|
rv_text = strError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv_text;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void log_line(const int priority, const char *DebugBuffer,
|
||||||
|
unsigned int rv)
|
||||||
{
|
{
|
||||||
if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
|
if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
|
||||||
syslog(LOG_INFO, "%s", DebugBuffer);
|
syslog(LOG_INFO, "%s", DebugBuffer);
|
||||||
|
@ -139,6 +211,7 @@ static void log_line(const int priority, const char *DebugBuffer)
|
||||||
struct timeval tmp;
|
struct timeval tmp;
|
||||||
int delta;
|
int delta;
|
||||||
pthread_t thread_id;
|
pthread_t thread_id;
|
||||||
|
const char *rv_text = NULL;
|
||||||
|
|
||||||
gettimeofday(&new_time, NULL);
|
gettimeofday(&new_time, NULL);
|
||||||
if (0 == last_time.tv_sec)
|
if (0 == last_time.tv_sec)
|
||||||
|
@ -160,6 +233,8 @@ static void log_line(const int priority, const char *DebugBuffer)
|
||||||
|
|
||||||
thread_id = pthread_self();
|
thread_id = pthread_self();
|
||||||
|
|
||||||
|
rv_text = rv2text(rv);
|
||||||
|
|
||||||
if (LogDoColor)
|
if (LogDoColor)
|
||||||
{
|
{
|
||||||
const char *color_pfx = "", *color_sfx = "\33[0m";
|
const char *color_pfx = "", *color_sfx = "\33[0m";
|
||||||
|
@ -190,13 +265,31 @@ static void log_line(const int priority, const char *DebugBuffer)
|
||||||
#else
|
#else
|
||||||
#define THREAD_FORMAT "%lu"
|
#define THREAD_FORMAT "%lu"
|
||||||
#endif
|
#endif
|
||||||
printf("%s%.8d%s [" THREAD_FORMAT "] %s%s%s\n",
|
if (rv_text)
|
||||||
time_pfx, delta, time_sfx, thread_id,
|
{
|
||||||
color_pfx, DebugBuffer, color_sfx);
|
const char * rv_pfx = "", * rv_sfx = "";
|
||||||
|
if (rv != SCARD_S_SUCCESS)
|
||||||
|
{
|
||||||
|
rv_pfx = "\33[31m"; /* Red */
|
||||||
|
rv_sfx = "\33[0m";
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%s%.8d%s [" THREAD_FORMAT "] %s%s%s, %s%s%s\n",
|
||||||
|
time_pfx, delta, time_sfx, thread_id,
|
||||||
|
color_pfx, DebugBuffer, color_sfx,
|
||||||
|
rv_pfx, rv_text, rv_sfx);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("%s%.8d%s [" THREAD_FORMAT "] %s%s%s\n",
|
||||||
|
time_pfx, delta, time_sfx, thread_id,
|
||||||
|
color_pfx, DebugBuffer, color_sfx);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("%.8d %s\n", delta, DebugBuffer);
|
if (rv_text)
|
||||||
|
printf("%.8d %s, %s\n", delta, DebugBuffer, rv_text);
|
||||||
|
else
|
||||||
|
printf("%.8d %s\n", delta, DebugBuffer);
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
@ -220,7 +313,7 @@ static void log_xxd_always(const int priority, const char *msg,
|
||||||
c += 3;
|
c += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_line(priority, DebugBuffer);
|
log_line(priority, DebugBuffer, -1);
|
||||||
} /* log_xxd_always */
|
} /* log_xxd_always */
|
||||||
|
|
||||||
void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
|
void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
|
||||||
|
|
|
@ -213,7 +213,9 @@ PCSC_API const char* pcsc_stringify_error(const LONG pcscError)
|
||||||
case SCARD_W_REMOVED_CARD:
|
case SCARD_W_REMOVED_CARD:
|
||||||
msg = "Card was removed.";
|
msg = "Card was removed.";
|
||||||
break;
|
break;
|
||||||
/* case SCARD_W_SECURITY_VIOLATION: */
|
case SCARD_W_SECURITY_VIOLATION:
|
||||||
|
msg = "Access denied.";
|
||||||
|
break;
|
||||||
/* case SCARD_W_WRONG_CHV: */
|
/* case SCARD_W_WRONG_CHV: */
|
||||||
/* case SCARD_W_CHV_BLOCKED: */
|
/* case SCARD_W_CHV_BLOCKED: */
|
||||||
/* case SCARD_W_EOF: */
|
/* case SCARD_W_EOF: */
|
||||||
|
|
|
@ -302,7 +302,7 @@ static void * EHStatusHandlerThread(READER_CONTEXT * rContext)
|
||||||
readerState = SCARD_PRESENT | SCARD_SWALLOWED;
|
readerState = SCARD_PRESENT | SCARD_SWALLOWED;
|
||||||
RFSetPowerState(rContext, POWER_STATE_UNPOWERED);
|
RFSetPowerState(rContext, POWER_STATE_UNPOWERED);
|
||||||
Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");
|
Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");
|
||||||
Log3(PCSC_LOG_ERROR, "Error powering up card: %ld 0x%04lX", rv, rv);
|
Log2(PCSC_LOG_ERROR, "Error powering up card: %s", rv2text(rv));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,6 @@
|
||||||
#define PCSC_MAX_CONTEXT_CARD_HANDLES 200
|
#define PCSC_MAX_CONTEXT_CARD_HANDLES 200
|
||||||
#define PCSC_MAX_READER_HANDLES 200
|
#define PCSC_MAX_READER_HANDLES 200
|
||||||
|
|
||||||
#define PCSCLITE_STATUS_WAIT 200000 /**< Status Change Sleep */
|
|
||||||
|
|
||||||
/** Different values for struct ReaderContext powerState field */
|
/** Different values for struct ReaderContext powerState field */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -1395,7 +1395,7 @@ void RFCleanupReaders(void)
|
||||||
REMOVE_READER_NO_FLAG);
|
REMOVE_READER_NO_FLAG);
|
||||||
|
|
||||||
if (rv != SCARD_S_SUCCESS)
|
if (rv != SCARD_S_SUCCESS)
|
||||||
Log2(PCSC_LOG_ERROR, "RFRemoveReader error: 0x%08lX", rv);
|
Log2(PCSC_LOG_ERROR, "RFRemoveReader error: %s", rv2text(rv));
|
||||||
}
|
}
|
||||||
|
|
||||||
free(sReadersContexts[i]);
|
free(sReadersContexts[i]);
|
||||||
|
|
|
@ -590,9 +590,13 @@ PCSC_API p_SCardTransmit(SCardTransmit)
|
||||||
|
|
||||||
Enter();
|
Enter();
|
||||||
spy_long(hCard);
|
spy_long(hCard);
|
||||||
|
spy_long(pioSendPci->dwProtocol);
|
||||||
|
spy_long(pioSendPci->cbPciLength);
|
||||||
spy_buffer(pbSendBuffer, cbSendLength);
|
spy_buffer(pbSendBuffer, cbSendLength);
|
||||||
rv = spy.SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength,
|
rv = spy.SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength,
|
||||||
pioRecvPci, pbRecvBuffer, pcbRecvLength);
|
pioRecvPci, pbRecvBuffer, pcbRecvLength);
|
||||||
|
spy_long(pioRecvPci->dwProtocol);
|
||||||
|
spy_long(pioRecvPci->cbPciLength);
|
||||||
if (pcbRecvLength)
|
if (pcbRecvLength)
|
||||||
spy_buffer(pbRecvBuffer, *pcbRecvLength);
|
spy_buffer(pbRecvBuffer, *pcbRecvLength);
|
||||||
else
|
else
|
||||||
|
|
|
@ -219,6 +219,20 @@ class PCSCspy(object):
|
||||||
else:
|
else:
|
||||||
self.log_in("hCard: %s" % hCard)
|
self.log_in("hCard: %s" % hCard)
|
||||||
|
|
||||||
|
def log_in_scard_io_request(self):
|
||||||
|
""" log SCARD_IO_REQUEST IN parameter """
|
||||||
|
dwProtocol = self.get_line()
|
||||||
|
if self.diffable:
|
||||||
|
self.log_in("pioSendPci.dwProtocol: 0x????")
|
||||||
|
else:
|
||||||
|
self.log_in("pioSendPci.dwProtocol: %s" % dwProtocol)
|
||||||
|
|
||||||
|
cbPciLength = self.get_line()
|
||||||
|
if self.diffable:
|
||||||
|
self.log_in("pioSendPci.cbPciLength: 0x????")
|
||||||
|
else:
|
||||||
|
self.log_in("pioSendPci.cbPciLength: %s" % cbPciLength)
|
||||||
|
|
||||||
def log_in_hContext(self):
|
def log_in_hContext(self):
|
||||||
""" log hContext IN parameter """
|
""" log hContext IN parameter """
|
||||||
hContext = self.get_line()
|
hContext = self.get_line()
|
||||||
|
@ -289,6 +303,20 @@ class PCSCspy(object):
|
||||||
self.log_in("dwPreferredProtocols: %s (%s)" % (dwPreferredProtocols,
|
self.log_in("dwPreferredProtocols: %s (%s)" % (dwPreferredProtocols,
|
||||||
", ".join(PreferredProtocols)))
|
", ".join(PreferredProtocols)))
|
||||||
|
|
||||||
|
def log_out_scard_io_request(self):
|
||||||
|
""" log SCARD_IO_REQUEST OUT parameter """
|
||||||
|
dwProtocol = self.get_line()
|
||||||
|
if self.diffable:
|
||||||
|
self.log_out("pioRecvPci.dwProtocol: 0x????")
|
||||||
|
else:
|
||||||
|
self.log_out("pioRecvPci.dwProtocol: %s" % dwProtocol)
|
||||||
|
|
||||||
|
cbPciLength = self.get_line()
|
||||||
|
if self.diffable:
|
||||||
|
self.log_out("pioRecvPci.cbPciLength: 0x????")
|
||||||
|
else:
|
||||||
|
self.log_out("pioRecvPci.cbPciLength: %s" % cbPciLength)
|
||||||
|
|
||||||
def log_out_dwActiveProtocol(self):
|
def log_out_dwActiveProtocol(self):
|
||||||
""" log dwActiveProtocol OUT parameter """
|
""" log dwActiveProtocol OUT parameter """
|
||||||
dwActiveProtocol = self.get_line()
|
dwActiveProtocol = self.get_line()
|
||||||
|
@ -510,8 +538,10 @@ class PCSCspy(object):
|
||||||
""" SCardTransmit """
|
""" SCardTransmit """
|
||||||
self.log_name("SCardTransmit")
|
self.log_name("SCardTransmit")
|
||||||
self.log_in_hCard()
|
self.log_in_hCard()
|
||||||
|
self.log_in_scard_io_request()
|
||||||
self.log_in2("bSendLength")
|
self.log_in2("bSendLength")
|
||||||
self.log_buffer("bSendBuffer", "in")
|
self.log_buffer("bSendBuffer", "in")
|
||||||
|
self.log_out_scard_io_request()
|
||||||
self.log_out2("bRecvLength")
|
self.log_out2("bRecvLength")
|
||||||
self.log_buffer("bRecvBuffer", "out")
|
self.log_buffer("bRecvBuffer", "out")
|
||||||
self._log_rv()
|
self._log_rv()
|
||||||
|
|
|
@ -335,8 +335,8 @@ LONG SCardConnect(/*@unused@*/ SCARDCONTEXT hContext, LPCSTR szReader,
|
||||||
rContext->readerState->cardAtrLength);
|
rContext->readerState->cardAtrLength);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Log3(PCSC_LOG_ERROR, "Error powering up card: %ld 0x%04lX",
|
Log2(PCSC_LOG_ERROR, "Error powering up card: %s",
|
||||||
rv, rv);
|
rv2text(rv));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! (rContext->readerState->readerState & SCARD_POWERED))
|
if (! (rContext->readerState->readerState & SCARD_POWERED))
|
||||||
|
@ -840,6 +840,9 @@ LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
|
||||||
|
|
||||||
/* get rContext corresponding to hCard */
|
/* get rContext corresponding to hCard */
|
||||||
rv = RFReaderInfoById(hCard, &rContext);
|
rv = RFReaderInfoById(hCard, &rContext);
|
||||||
|
/* ignore reader removal */
|
||||||
|
if (SCARD_E_INVALID_VALUE == rv || SCARD_E_READER_UNAVAILABLE == rv)
|
||||||
|
return SCARD_S_SUCCESS;
|
||||||
if (rv != SCARD_S_SUCCESS)
|
if (rv != SCARD_S_SUCCESS)
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
|
@ -924,8 +927,8 @@ LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (SCARD_UNPOWER_CARD == dwDisposition)
|
if (SCARD_UNPOWER_CARD == dwDisposition)
|
||||||
Log3(PCSC_LOG_ERROR, "Error powering down card: %ld 0x%04lX",
|
Log2(PCSC_LOG_ERROR, "Error powering down card: %s",
|
||||||
rv, rv);
|
rv2text(rv));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rContext->readerState->cardAtrLength = 0;
|
rContext->readerState->cardAtrLength = 0;
|
||||||
|
@ -1077,7 +1080,7 @@ LONG SCardBeginTransaction(SCARDHANDLE hCard)
|
||||||
if (SCARD_E_SHARING_VIOLATION == rv)
|
if (SCARD_E_SHARING_VIOLATION == rv)
|
||||||
(void)SYS_USleep(PCSCLITE_LOCK_POLL_RATE);
|
(void)SYS_USleep(PCSCLITE_LOCK_POLL_RATE);
|
||||||
|
|
||||||
Log2(PCSC_LOG_DEBUG, "Status: 0x%08lX", rv);
|
Log2(PCSC_LOG_DEBUG, "Status: %s", rv2text(rv));
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
UNREF_READER(rContext)
|
UNREF_READER(rContext)
|
||||||
|
@ -1229,7 +1232,7 @@ LONG SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition)
|
||||||
if (rv == SCARD_S_SUCCESS)
|
if (rv == SCARD_S_SUCCESS)
|
||||||
rv = rv2;
|
rv = rv2;
|
||||||
|
|
||||||
Log2(PCSC_LOG_DEBUG, "Status: 0x%08lX", rv);
|
Log2(PCSC_LOG_DEBUG, "Status: %s", rv2text(rv));
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
UNREF_READER(rContext)
|
UNREF_READER(rContext)
|
||||||
|
@ -1615,7 +1618,7 @@ LONG SCardTransmit(SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci,
|
||||||
if (rv != SCARD_S_SUCCESS)
|
if (rv != SCARD_S_SUCCESS)
|
||||||
{
|
{
|
||||||
*pcbRecvLength = 0;
|
*pcbRecvLength = 0;
|
||||||
Log2(PCSC_LOG_ERROR, "Card not transacted: 0x%08lX", rv);
|
Log2(PCSC_LOG_ERROR, "Card not transacted: %s", rv2text(rv));
|
||||||
|
|
||||||
if (SCARD_E_NO_SMARTCARD == rv)
|
if (SCARD_E_NO_SMARTCARD == rv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -134,9 +134,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//#define DO_PROFILE
|
//#define DO_PROFILE
|
||||||
|
|
||||||
|
|
||||||
/** used for backward compatibility */
|
|
||||||
#define SCARD_PROTOCOL_ANY_OLD 0x1000
|
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
|
@ -530,6 +527,7 @@ DESTRUCTOR static void destructor(void)
|
||||||
* @retval SCARD_E_NO_SERVICE The server is not running (\ref SCARD_E_NO_SERVICE)
|
* @retval SCARD_E_NO_SERVICE The server is not running (\ref SCARD_E_NO_SERVICE)
|
||||||
* @retval SCARD_F_COMM_ERROR An internal communications error has been detected (\ref SCARD_F_COMM_ERROR)
|
* @retval SCARD_F_COMM_ERROR An internal communications error has been detected (\ref SCARD_F_COMM_ERROR)
|
||||||
* @retval SCARD_F_INTERNAL_ERROR An internal consistency check failed (\ref SCARD_F_INTERNAL_ERROR)
|
* @retval SCARD_F_INTERNAL_ERROR An internal consistency check failed (\ref SCARD_F_INTERNAL_ERROR)
|
||||||
|
* @retval SCARD_W_SECURITY_VIOLATION Access was denied by the daemon (Polkit issue?). (\ref SCARD_W_SECURITY_VIOLATION)
|
||||||
*/
|
*/
|
||||||
static LONG SCardEstablishContextTH(DWORD dwScope,
|
static LONG SCardEstablishContextTH(DWORD dwScope,
|
||||||
/*@unused@*/ LPCVOID pvReserved1,
|
/*@unused@*/ LPCVOID pvReserved1,
|
||||||
|
@ -609,7 +607,6 @@ static LONG SCardEstablishContextTH(DWORD dwScope,
|
||||||
{
|
{
|
||||||
Log1(PCSC_LOG_CRITICAL,
|
Log1(PCSC_LOG_CRITICAL,
|
||||||
"Your pcscd is too old and does not support CMD_VERSION");
|
"Your pcscd is too old and does not support CMD_VERSION");
|
||||||
rv = SCARD_F_COMM_ERROR;
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -506,7 +506,11 @@ INTERNAL LONG MessageReceive(void *buffer_void, uint64_t buffer_size,
|
||||||
* other errors are fatal */
|
* other errors are fatal */
|
||||||
if (errno != EINTR && errno != EAGAIN)
|
if (errno != EINTR && errno != EAGAIN)
|
||||||
{
|
{
|
||||||
retval = SCARD_F_COMM_ERROR;
|
/* connection reseted by pcscd? */
|
||||||
|
if (ECONNRESET == errno)
|
||||||
|
retval = SCARD_W_SECURITY_VIOLATION;
|
||||||
|
else
|
||||||
|
retval = SCARD_F_COMM_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ static const char *CommandsText[] = {
|
||||||
WRITE_BODY_WITH_COMMAND(CommandsText[header.command], v)
|
WRITE_BODY_WITH_COMMAND(CommandsText[header.command], v)
|
||||||
#define WRITE_BODY_WITH_COMMAND(command, v) \
|
#define WRITE_BODY_WITH_COMMAND(command, v) \
|
||||||
do { \
|
do { \
|
||||||
Log4(PCSC_LOG_DEBUG, "%s rv=0x%X for client %d", command, v.rv, filedes); \
|
LogRv4(PCSC_LOG_DEBUG, v.rv, "%s for client %d", command, filedes); \
|
||||||
ret = MessageSend(&v, sizeof(v), filedes); \
|
ret = MessageSend(&v, sizeof(v), filedes); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -886,47 +886,53 @@ static LONG MSGRemoveContext(SCARDCONTEXT hContext, SCONTEXT * threadContext)
|
||||||
hCard = *(int32_t *)ptr;
|
hCard = *(int32_t *)ptr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unlock the sharing
|
* Unlock the sharing. If the reader or handle already
|
||||||
|
* disappeared, skip the disconnection part and just delete the
|
||||||
|
* orphan handle.
|
||||||
*/
|
*/
|
||||||
rv = RFReaderInfoById(hCard, &rContext);
|
rv = RFReaderInfoById(hCard, &rContext);
|
||||||
if (rv != SCARD_S_SUCCESS)
|
if (rv != SCARD_S_SUCCESS && rv != SCARD_E_INVALID_VALUE
|
||||||
|
&& rv != SCARD_E_READER_UNAVAILABLE)
|
||||||
{
|
{
|
||||||
(void)pthread_mutex_unlock(&threadContext->cardsList_lock);
|
(void)pthread_mutex_unlock(&threadContext->cardsList_lock);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == rContext->hLockId)
|
if (rContext)
|
||||||
{
|
{
|
||||||
/* no lock. Just leave the card */
|
if (0 == rContext->hLockId)
|
||||||
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (hCard != rContext->hLockId)
|
|
||||||
{
|
{
|
||||||
/*
|
/* no lock. Just leave the card */
|
||||||
* if the card is locked by someone else we do not reset it
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* decrement card use */
|
|
||||||
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* release the lock */
|
if (hCard != rContext->hLockId)
|
||||||
rContext->hLockId = 0;
|
{
|
||||||
|
/*
|
||||||
|
* if the card is locked by someone else we do not reset it
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/* decrement card use */
|
||||||
* We will use SCardStatus to see if the card has been
|
|
||||||
* reset there is no need to reset each time
|
|
||||||
* Disconnect is called
|
|
||||||
*/
|
|
||||||
rv = SCardStatus(hCard, NULL, NULL, NULL, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
if (rv == SCARD_W_RESET_CARD || rv == SCARD_W_REMOVED_CARD)
|
|
||||||
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
(void)SCardDisconnect(hCard, SCARD_RESET_CARD);
|
{
|
||||||
|
/* release the lock */
|
||||||
|
rContext->hLockId = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We will use SCardStatus to see if the card has been
|
||||||
|
* reset there is no need to reset each time
|
||||||
|
* Disconnect is called
|
||||||
|
*/
|
||||||
|
rv = SCardStatus(hCard, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
if (rv == SCARD_W_RESET_CARD || rv == SCARD_W_REMOVED_CARD)
|
||||||
|
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
||||||
|
else
|
||||||
|
(void)SCardDisconnect(hCard, SCARD_RESET_CARD);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -936,7 +942,9 @@ static LONG MSGRemoveContext(SCARDCONTEXT hContext, SCONTEXT * threadContext)
|
||||||
Log2(PCSC_LOG_CRITICAL,
|
Log2(PCSC_LOG_CRITICAL,
|
||||||
"list_delete_at failed with return value: %d", lrv);
|
"list_delete_at failed with return value: %d", lrv);
|
||||||
|
|
||||||
UNREF_READER(rContext)
|
if (rContext) {
|
||||||
|
UNREF_READER(rContext)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(void)pthread_mutex_unlock(&threadContext->cardsList_lock);
|
(void)pthread_mutex_unlock(&threadContext->cardsList_lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue