diff --git a/util.c b/util.c index 3b539b1..2788d7c 100644 --- a/util.c +++ b/util.c @@ -144,7 +144,7 @@ init_yubikey(YK_KEY **yk) int challenge_response(YK_KEY *yk, int slot, char *challenge, unsigned int len, bool hmac, unsigned int flags, bool verbose, - char *response, int res_size, int *res_len) + char *response, int res_size, unsigned int *res_len) { int yk_cmd; unsigned int response_len = 0; diff --git a/util.h b/util.h index aa1d2ec..e076169 100644 --- a/util.h +++ b/util.h @@ -67,16 +67,16 @@ int get_user_cfgfile_path(const char *common_path, const char *filename, const c #define CR_RESPONSE_SIZE 20 struct chalresp_state { - unsigned char challenge[CR_CHALLENGE_SIZE]; + char challenge[CR_CHALLENGE_SIZE]; uint8_t challenge_len; - unsigned char response[CR_RESPONSE_SIZE]; + char response[CR_RESPONSE_SIZE]; uint8_t response_len; uint8_t slot; }; typedef struct chalresp_state CR_STATE; -int generate_random(char *buf, int len); +int generate_random(void *buf, int len); int get_user_challenge_file(YK_KEY *yk, const char *chalresp_path, const char *username, char **fn); @@ -86,9 +86,9 @@ int write_chalresp_state(FILE *f, CR_STATE *state); int init_yubikey(YK_KEY **yk); int check_firmware_version(YK_KEY *yk, bool verbose, bool quiet); int challenge_response(YK_KEY *yk, int slot, - unsigned char *challenge, unsigned int len, + char *challenge, unsigned int len, bool hmac, unsigned int flags, bool verbose, - unsigned char *response, int res_size, int *res_len); + char *response, int res_size, unsigned int *res_len); #endif /* HAVE_CR */ diff --git a/ykpamcfg.c b/ykpamcfg.c index 27e5ef5..f0946d0 100644 --- a/ykpamcfg.c +++ b/ykpamcfg.c @@ -118,7 +118,7 @@ parse_args(int argc, char **argv, int do_add_hmac_chalresp(YK_KEY *yk, uint8_t slot, bool verbose, char *output_dir, int *exit_code) { - unsigned char buf[CR_RESPONSE_SIZE + 16]; + char buf[CR_RESPONSE_SIZE + 16]; CR_STATE state; unsigned int flags = 0; int ret = 0;