Lines Matching refs:resp

193     uint8_t *resp;  in transmit()  local
199 resp = (uint8_t*)malloc(65536 * sizeof(uint8_t)); in transmit()
207 resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536); in transmit()
216 dump_bytes("RESP: ", ':', resp, resp_len, stdout); in transmit()
218 memcpy(&result[0], resp, resp_len); in transmit()
225 if(resp) free(resp); in transmit()
260 uint8_t *resp; in openLogicalChannel() local
267 resp = (uint8_t*)malloc(65536 * sizeof(uint8_t)); in openLogicalChannel()
269 if (apdu != NULL && resp!=NULL) { in openLogicalChannel()
279 resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536); in openLogicalChannel()
284 dump_bytes("RESP: ", ':', resp, resp_len, stdout); in openLogicalChannel()
294 if(resp) free(resp); in openLogicalChannel()
297 } else if (resp[resp_len - 2] == 0x90 && resp[resp_len - 1] == 0x00) { in openLogicalChannel()
298 resApduBuff.channelNumber = resp[0]; in openLogicalChannel()
302 if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x81) { in openLogicalChannel()
304 }else if (resp[resp_len - 2] == 0x68 && resp[resp_len - 1] == 0x81) { in openLogicalChannel()
311 if(resp) free(resp); in openLogicalChannel()
317 if(resp) free(resp); in openLogicalChannel()
329 resp = (uint8_t*)malloc(65536 * sizeof(uint8_t)); in openLogicalChannel()
331 if (apdu != NULL && resp!=NULL) { in openLogicalChannel()
344 resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536); in openLogicalChannel()
355 dump_bytes("RESP: ", ':', resp, resp_len, stdout); in openLogicalChannel()
357 … if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) { in openLogicalChannel()
359 memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len); in openLogicalChannel()
362 else if (resp[resp_len - 2] == 0x61) { in openLogicalChannel()
364 memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2); in openLogicalChannel()
366 getResponse[4] = resp[resp_len - 1]; in openLogicalChannel()
372 memset(resp, 0, resp_len); in openLogicalChannel()
377 else if (resp[resp_len - 2] == 0x6C) { in openLogicalChannel()
379 memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2); in openLogicalChannel()
381 apdu[4] = resp[resp_len - 1]; in openLogicalChannel()
383 memset(resp, 0, resp_len); in openLogicalChannel()
386 else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x80) { in openLogicalChannel()
389 else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x81) { in openLogicalChannel()
392 else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x82) { in openLogicalChannel()
395 else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x86) { in openLogicalChannel()
398 else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x87) { in openLogicalChannel()
413 if(resp) free(resp); in openLogicalChannel()
424 uint8_t *resp; in openBasicChannel() local
458 resp = (uint8_t*)malloc(65536 * sizeof(uint8_t)); in openBasicChannel()
474 resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536); in openBasicChannel()
484 dump_bytes("RESP: ", ':', resp, resp_len, stdout); in openBasicChannel()
486 … if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) { in openBasicChannel()
488 memcpy(&result[getResponseOffset], resp, resp_len); in openBasicChannel()
494 else if (resp[resp_len - 2] == 0x61) { in openBasicChannel()
496 memcpy(&result[getResponseOffset], resp, resp_len - 2); in openBasicChannel()
498 getResponse[4] = resp[resp_len - 1]; in openBasicChannel()
504 memset(resp, 0, resp_len); in openBasicChannel()
508 else if (resp[resp_len - 2] == 0x6C) { in openBasicChannel()
510 memcpy(&result[getResponseOffset], resp, resp_len - 2); in openBasicChannel()
512 apdu[4] = resp[resp_len - 1]; in openBasicChannel()
515 memset(resp, 0, resp_len); in openBasicChannel()
518 else if (resp[resp_len - 2] == 0x68 && resp[resp_len - 1] == 0x81) { in openBasicChannel()
521 else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x81) { in openBasicChannel()
535 if(resp) free(resp); in openBasicChannel()
545 uint8_t *resp; in closeChannel() local
564 resp = (uint8_t*)malloc(65536 * sizeof(uint8_t)); in closeChannel()
576 resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536); in closeChannel()
583 } else if ((resp[resp_len - 2] == 0x90) && (resp[resp_len - 1] == 0x00)) { in closeChannel()
590 if(resp) free(resp); in closeChannel()
650 SecureElement::run_apdu(struct se_gto_ctx *ctx, const uint8_t *apdu, uint8_t *resp, int n, int verb… in run_apdu() argument
658 n = se_gto_apdu_transmit(ctx, apdu, n, resp, sizeof(resp)); in run_apdu()
663 dump_bytes("RESP: ", ':', resp, n, stdout); in run_apdu()
669 sw = (resp[n - 2] << 8) | resp[n - 1]; in run_apdu()
672 dump_bytes("RESP: ", ':', resp, n - 2, stdout); in run_apdu()