oberthur: fix max recv size when reading component

This commit is contained in:
Viktor Tarasov 2016-04-28 10:52:25 +02:00
parent 91a28c613c
commit fc76e4ee6d

View File

@ -1482,7 +1482,7 @@ auth_read_component(struct sc_card *card, enum SC_CARDCTL_OBERTHUR_KEY_TYPE type
{ {
struct sc_apdu apdu; struct sc_apdu apdu;
int rv; int rv;
unsigned char resp[SC_MAX_APDU_BUFFER_SIZE]; unsigned char resp[256];
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "num %i, outlen %i, type %i\n", num, outlen, type); sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "num %i, outlen %i, type %i\n", num, outlen, type);
@ -2117,7 +2117,7 @@ auth_read_binary(struct sc_card *card, unsigned int offset,
if (auth_current_ef->magic==SC_FILE_MAGIC && if (auth_current_ef->magic==SC_FILE_MAGIC &&
auth_current_ef->ef_structure == SC_CARDCTL_OBERTHUR_KEY_RSA_PUBLIC) { auth_current_ef->ef_structure == SC_CARDCTL_OBERTHUR_KEY_RSA_PUBLIC) {
int jj; int jj;
unsigned char resp[SC_MAX_APDU_BUFFER_SIZE], *out = NULL; unsigned char resp[256], *out = NULL;
size_t resp_len, out_len; size_t resp_len, out_len;
struct sc_pkcs15_bignum bn[2]; struct sc_pkcs15_bignum bn[2];
struct sc_pkcs15_pubkey_rsa key; struct sc_pkcs15_pubkey_rsa key;