diff --git a/src/libopensc/card-gpk.c b/src/libopensc/card-gpk.c index 82cb7c81..495f4911 100644 --- a/src/libopensc/card-gpk.c +++ b/src/libopensc/card-gpk.c @@ -235,7 +235,7 @@ match_path(struct sc_card *card, unsigned short int **pathptr, size_t *pathlen, } static void -ac_to_acl(u_int16_t ac, struct sc_file *file, unsigned int op) +ac_to_acl(unsigned short int ac, struct sc_file *file, unsigned int op) { unsigned int npins, pin; @@ -828,7 +828,7 @@ static int gpk_verify_pin(struct sc_card *card, int ref, const u8 *pin, size_t pinlen, int *tries_left) { - u_int8_t buffer[8]; + u8 buffer[8]; struct sc_apdu apdu; int r; @@ -896,7 +896,7 @@ gpk_erase_card(struct sc_card *card) { struct gpk_private_data *priv = OPSDATA(card); struct sc_apdu apdu; - u_int8_t offset; + u8 offset; int r; SC_FUNC_CALLED(card->ctx, 1); diff --git a/src/libopensc/pkcs15.c b/src/libopensc/pkcs15.c index 0a2cdec6..23b13f72 100644 --- a/src/libopensc/pkcs15.c +++ b/src/libopensc/pkcs15.c @@ -82,7 +82,7 @@ void parse_tokeninfo(struct sc_pkcs15_card *card, const u8 * buf, size_t buflen) u8 label[128]; int label_len = sizeof(label); int flags_len = sizeof(card->flags); - struct sc_asn1_entry asn1_toki[9], asn1_tokeninfo[2]; + struct sc_asn1_entry asn1_toki[9], asn1_tokeninfo[3]; sc_copy_asn1_entry(c_asn1_toki, asn1_toki); sc_copy_asn1_entry(c_asn1_tokeninfo, asn1_tokeninfo); @@ -521,7 +521,7 @@ int sc_pkcs15_bind(struct sc_card *card, } if (p15card->file_odf == NULL) { tmppath = p15card->file_app->path; - sc_append_path_id(&tmppath, "\x50\x31", 2); + sc_append_path_id(&tmppath, (const u8 *) "\x50\x31", 2); } else { tmppath = p15card->file_odf->path; sc_file_free(p15card->file_odf); @@ -544,7 +544,7 @@ int sc_pkcs15_bind(struct sc_card *card, } if (p15card->file_tokeninfo == NULL) { tmppath = p15card->file_app->path; - sc_append_path_id(&tmppath, "\x50\x32", 2); + sc_append_path_id(&tmppath, (const u8 *) "\x50\x32", 2); } else { tmppath = p15card->file_tokeninfo->path; sc_file_free(p15card->file_tokeninfo); diff --git a/src/tools/pkcs15-gpk.c b/src/tools/pkcs15-gpk.c index 80e89634..bb21c661 100644 --- a/src/tools/pkcs15-gpk.c +++ b/src/tools/pkcs15-gpk.c @@ -44,8 +44,8 @@ gpk_lock(struct sc_card *card, struct sc_file *file, unsigned int op) static int gpk_update_pins(struct sc_card *card, struct pin_info *info) { - u_int8_t buffer[GPK_MAX_PINS * 8], *blk; - u_int8_t temp[16]; + u8 buffer[GPK_MAX_PINS * 8], *blk; + u8 temp[16]; unsigned int npins, i, j, tries, cks; int r; @@ -68,7 +68,7 @@ gpk_update_pins(struct sc_card *card, struct pin_info *info) blk[2] = 0x8 | (i + 1); memset(temp, 0, sizeof(temp)); - strncpy(temp, info->secret[i], 8); + strncpy((char *) temp, info->secret[i], 8); blk[4] = (temp[0] << 4) | (temp[1] & 0xF); blk[5] = (temp[2] << 4) | (temp[3] & 0xF); blk[6] = (temp[4] << 4) | (temp[5] & 0xF); @@ -236,7 +236,9 @@ gpk_init_app(struct sc_profile *profile, struct sc_card *card) */ struct pkcomp { unsigned char tag; -// BIGNUM * bn; +#if 0 + BIGNUM * bn; +#endif u8 * data; unsigned int size; }; diff --git a/src/tools/pkcs15-init.c b/src/tools/pkcs15-init.c index 892c9ada..9033d915 100644 --- a/src/tools/pkcs15-init.c +++ b/src/tools/pkcs15-init.c @@ -178,7 +178,7 @@ main(int argc, char **argv) /* Read the PKCS15 structure from the card */ r = sc_pkcs15_bind(card, &p15card); if (r) { - fprintf(stderr, "PKCS#15 initialization failed: %m\n"); + fprintf(stderr, "PKCS#15 initialization failed: %s\n", sc_strerror(r)); goto done; } if (!opt_quiet) @@ -675,7 +675,7 @@ do_verify_pin(struct sc_profile *pro, unsigned int type, unsigned int reference) return SC_ERROR_SECURITY_STATUS_NOT_SATISFIED; } - return sc_verify(card, SC_AC_CHV, reference, pin, strlen(pin), NULL); + return sc_verify(card, SC_AC_CHV, reference, (const u8 *) pin, strlen(pin), NULL); } int diff --git a/src/tools/profile.c b/src/tools/profile.c index 76fe7e14..a8ed8379 100644 --- a/src/tools/profile.c +++ b/src/tools/profile.c @@ -855,7 +855,7 @@ do_prkey_reference(int argc, char **argv) { struct sc_pkcs15_prkey_info *ki = &parser.cur_prkey->pkcs15; - return get_uint(argv[0], &ki->key_reference); + return get_uint(argv[0], (unsigned int *) &ki->key_reference); } static struct command commands[] = { diff --git a/src/tools/profile.h b/src/tools/profile.h index 5a7446fd..0cc2f1bd 100644 --- a/src/tools/profile.h +++ b/src/tools/profile.h @@ -17,7 +17,7 @@ struct auth_info { unsigned int id; /* CHV1, KEY0, ... */ unsigned int ref; size_t key_len; - u_int8_t key[32]; + u8 key[32]; }; struct file_info {