Change user_state 'challenge' field from string to uchar, which
makes more sense for crypto and other manipulation. Unfortunately,
it is a huge change for such a small gain (basically avoiding
sprintf() and sscanf() conversions.)
Notable changes:
- otp.h: add 'clen' field to user_state; update it wherever the
'challenge' field is set
- otp_cardops.h: add printchallenge() method, OTP_CF_C8 and OTP_CF_C4
Card Feature macros
- cardops keystring2keyblock() method and otp_keystring2keyblock()
now return keylen (instead of 0) on success
- otp_keyblock2keystring() now takes a length arg and returns char *
for easy printing
- remove [unused] 'card_info' and 'log_prefix' args to cardops
updatecsd() method
- otp_gen_challenge() noted as cryptocard-specific with quirky behavior
- otp_challenge_transform() explicitly returns new challenge length
- cryptocard.c:cryptocard_challenge(): Remove hardcoded challenge
length of 8. Yes, *sync* challenge length must be 8 but challenge
might be a different size due to resync with an async challenge.
This worked before but became a bug when we changed the user_state
'challenge' field to be the previous (instead of the next) challenge.