pbExtraBytes = &((BYTE*) call->pioSendPci)[sizeof(SCARD_IO_REQUEST)];
Stream_Read(s, pbExtraBytes, ioSendPci.cbExtraBytes);
+
+ smartcard_unpack_read_size_align(smartcard, s, ioSendPci.cbExtraBytes, 4);
}
else
{
}
Stream_Read(s, call->pbSendBuffer, call->cbSendLength);
+
+ smartcard_unpack_read_size_align(smartcard, s, call->cbSendLength, 4);
}
if (pioRecvPciNdrPtr)
{
- if (Stream_GetRemainingLength(s) < 8)
+ if (Stream_GetRemainingLength(s) < 16)
{
WLog_WARN(TAG, "Transmit_Call is too short: Actual: %d, Expected: %d",
(int) Stream_GetRemainingLength(s), 16);
return STATUS_BUFFER_TOO_SMALL;
}
- Stream_Read_UINT32(s, length); /* Length (4 bytes) */
-
Stream_Read_UINT32(s, ioRecvPci.dwProtocol); /* dwProtocol (4 bytes) */
Stream_Read_UINT32(s, ioRecvPci.cbExtraBytes); /* cbExtraBytes (4 bytes) */
+ Stream_Read_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */
+ Stream_Read_UINT32(s, length); /* Length (4 bytes) */
if (ioRecvPci.cbExtraBytes > 1024)
{
return STATUS_INVALID_PARAMETER;
}
- if (length < ioRecvPci.cbExtraBytes)
+ if (length != ioRecvPci.cbExtraBytes)
{
WLog_WARN(TAG, "Transmit_Call unexpected length: Actual: %d, Expected: %d (ioRecvPci.cbExtraBytes)",
(int) length, (int) ioRecvPci.cbExtraBytes);
pbExtraBytes = &((BYTE*) call->pioRecvPci)[sizeof(SCARD_IO_REQUEST)];
Stream_Read(s, pbExtraBytes, ioRecvPci.cbExtraBytes);
+
+ smartcard_unpack_read_size_align(smartcard, s, ioRecvPci.cbExtraBytes, 4);
}
return SCARD_S_SUCCESS;
WLog_DBG(TAG, "pioRecvPci: null");
}
- WLog_DBG(TAG, "fpbRecvBufferIsNULL: %d cbRecvLength: 0x%08X",
+ WLog_DBG(TAG, "fpbRecvBufferIsNULL: %d cbRecvLength: %d",
call->fpbRecvBufferIsNULL, call->cbRecvLength);
WLog_DBG(TAG, "}");