Corrected the server bit in the abort PDU which was missing for the abort messages.

This commit is contained in:
skarg
2006-10-05 22:46:59 +00:00
parent 5b10d86430
commit f45d694a51
19 changed files with 43 additions and 29 deletions
+6 -3
View File
@@ -38,12 +38,15 @@
/* encode service */
int abort_encode_apdu(uint8_t * apdu,
uint8_t invoke_id, uint8_t abort_reason)
uint8_t invoke_id, uint8_t abort_reason, bool server)
{
int apdu_len = 0; /* total length of the apdu, return value */
if (apdu) {
apdu[0] = PDU_TYPE_ABORT;
if (server)
apdu[0] = PDU_TYPE_ABORT & 1;
else
apdu[0] = PDU_TYPE_ABORT;
apdu[1] = invoke_id;
apdu[2] = abort_reason;
apdu_len = 3;
@@ -83,7 +86,7 @@ int abort_decode_apdu(uint8_t * apdu,
return -1;
/* optional checking - most likely was already done prior to this call */
if (apdu_len) {
if (apdu[0] != PDU_TYPE_ABORT)
if ((apdu[0] & 0xF0) != PDU_TYPE_ABORT)
return -1;
if (apdu_len > 1) {
len = abort_decode_service_request(&apdu[1],