Commit Graph

10 Commits

Author SHA1 Message Date
Harald Welte 628672bc72 bankd: Open PC/SC by default in EXCLUSIVE mode
Let's open the cards in EXCLUSIVE mode, we don't want other applications
tinkering with the card state while we have a bankd worker running on
it.  This change also means that no two bankd workers can trip on
each other accidentially anymore.

Related: OS#5527
Change-Id: I43a1c8c7bd1c0124ee5f605e2e5b04ed8f7836ab
2022-07-15 08:22:29 +02:00
Harald Welte 7f8bce4f06 bankd: Log more clearly if we fail to open a PC/SC reader
Related: SYS#5950
Change-Id: I424f585a8a37f21806898e59e350201119645a21
2022-05-05 19:08:13 +02:00
Harald Welte e9e505c7c5 bankd: Better error messages during start-up
If something goes wrong during startup (missing CSV file, ...)
let's print a more human-readable error message than just asserting.

Change-Id: I95222d44eefc60ad3857fa70ccebbacce60820df
2022-05-03 18:09:14 +02:00
Oliver Smith 0c832fe737 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I2e98f89f6738d03c45a2106820af0912692093f3
2021-12-14 12:20:35 +01:00
Harald Welte 7293e7bcec logging: Replace remaining fprintf() calls with libosmocore logging
Change-Id: I2a772b3180131923d4e2ee7311670b938cb50fe0
2021-12-09 07:58:15 +01:00
Harald Welte 50a0972a87 bankd_pcsc: Don't log every successful SCardTransmit
Contrary to other operations, SCardTransmit has a much higher frequency
and the logs should not be clobbered with "OK" lines all over the place.

Change-Id: Icf87b61d71722b2998ae78f9aee7c4ad94c46da7
2021-12-08 20:44:23 +01:00
Harald Welte 168d72478e bankd_pcsc: Improve logging in non-error case
Before this commit, the PCSC operation (e.g. SCardStatus) is only
printed in the error case, but not in the debug case.  Let's fix that.

[000 CONN_CLIENT_MAPPED_CARD] bankd_pcsc.c:196 : OK

	will become

[000 CONN_CLIENT_MAPPED_CARD] bankd_pcsc.c:196 SCardTransmit: OK

Change-Id: I3c77655c5d1f76be778cb8873d8acf1343c87b05
2021-12-08 15:57:52 +01:00
Harald Welte 753c8aa87a bankd: regex matching of reader names
So far, bankd did a 1:1 string match of the CSV file line against
the reader name.  As pcsc-lite reader names unfortunately tend to
change at times, we introduce matching by regular expressions in
this patch.

Change-Id: I58b71f9562e152e7ed21b55d7b876bba481b01f8
2021-02-03 08:46:21 +00:00
Harald Welte bbd18bd7fe bankd: Implement card reset based on clientSlotStatusInd
If a client is sending us a clientSlotStatusInd indicating that
the modem has switched off VCC or activated RST, bankd will
now issue a respective PC/SC command to perform a cold or warm
reset of the card.

Change-Id: Ifa615d239ec3ad6daebd8e99e4f7d5b99d32c0e1
Closes: OS#4330
2019-12-17 13:31:20 +01:00
Harald Welte d7468e0b8c configure.ac: Add --disable-remsim-bankd
This allows builds on small/embedded platforms to avoid all the
dependencies required by remsim-bankd, including libpcsc-lite

Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e
2019-04-03 13:11:57 +02:00