So far we skipped the client->server connection and related
configuration transfer from server to client. Now, the server
instructs the client to which bankd ip/port to connect.
we could add a function checking the ATR validity
also before updating the (conditional) checksum we should check if
it is actually present in the ATR
the TDPU response data size can be up to 256.
this length cannot be stored in a uint8_t, which would cause the
length to become 0, no data being send, and the reader reset the
card because of misbehaviour of the card (i.e. no/malformed
response leading to the timeout of the waiting time).
What we're doing is actually legal: We copy the full size of the
destination array, and then overwrite the last byte with NUL. However,
gcc isn't smart enough to see that:
libusb_util.c:162:5: warning: ‘strncpy’ specified bound 20 equals destination size [-Wstringop-truncation]
strncpy(out[out_idx].path, path, sizeof(out[out_idx].path));
Let's copy one byte less to make it happy.
RPM post-build-checks found some issue and marks these as error:
[ 31s] I: Program returns random data in a function
[ 31s] E: osmo-remsim no-return-in-nonvoid-function main.c:49