Change user_state 'challenge' field from string to uchar, which
authorfcusack <fcusack>
Tue, 8 Nov 2005 08:56:21 +0000 (08:56 +0000)
committerfcusack <fcusack>
Tue, 8 Nov 2005 08:56:21 +0000 (08:56 +0000)
commitc966c68815fdbdd923aab073cea8e3ccdf24159a
treebc38ad85b6ff1712032b2bc8b3cec24cf35a35ad
parent00664c776e588630d85e04e611581317de394426
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.
src/modules/rlm_otp/cardops/cryptocard.c
src/modules/rlm_otp/cardops/cryptocard.h
src/modules/rlm_otp/otp.h
src/modules/rlm_otp/otp_cardops.c
src/modules/rlm_otp/otp_cardops.h
src/modules/rlm_otp/otp_rad.h
src/modules/rlm_otp/otp_radstate.c
src/modules/rlm_otp/otp_rlm.c
src/modules/rlm_otp/otp_site.c
src/modules/rlm_otp/otp_state.c
src/modules/rlm_otp/otp_util.c