Previously, some internals of the pipe module were public, while parts
of the public interface where only pub(crate). This patch fixes
visibility in the pipe module so that internals are private and the
public API is public.
It also fixes some clippy lints on the way.
When we receive a CTAPHID_CANCEL command and cancel a user presence
check, we still need to respond to the original command, typically with
a CTAP2_ERR_KEEPALIVE_CANCEL error. And if we already finished
executing the command, there is no harm in sending out its response.
With this patch, we never discard responses that have already been
calculated. Also, we never reset the pipe state and just finish the
normal command flow. We just set the interrupt flag if the
authenticator is currently processing a command.
Our packet buffer is smaller than the response buffer used by
ctaphid-dispatch. Therefore we have to check whether a response fits
into the buffer and return an error if not.