[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v23 08/11] libcacard: add passthru
From: |
Jes Sorensen |
Subject: |
Re: [Qemu-devel] [PATCH v23 08/11] libcacard: add passthru |
Date: |
Mon, 28 Mar 2011 15:27:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 |
On 03/23/11 14:19, Alon Levy wrote:
> diff --git a/libcacard/passthru.c b/libcacard/passthru.c
> new file mode 100644
> index 0000000..d78e2db
> --- /dev/null
> +++ b/libcacard/passthru.c
> @@ -0,0 +1,609 @@
> +/*
> + * implement the applets for the CAC card.
> + *
> + * This work is licensed under the terms of the GNU LGPL, version 2.1 or
> later.
> + * See the COPYING.LIB file in the top-level directory.
> + */
> +#ifdef USE_PASSTHRU
> +#include <stdlib.h>
> +#include <string.h>
> +
> +#include <pcsclite.h>
> +
> +#include "qemu-thread.h"
> +
> +#include "vcard.h"
> +#include "vcard_emul.h"
> +#include "card_7816.h"
> +#include "vreader.h"
> +#include "vcard_emul.h"
> +#include "passthru.h"
> +
> +/*
> + * Passthru applet private data
> + */
> +struct VCardAppletPrivateStruct {
> + char *reader_name;
> + /* pcsc-lite parameters */
> + SCARDHANDLE hCard;
> + uint32_t hProtocol;
> + SCARD_IO_REQUEST *send_io;
> + unsigned char atr[MAX_ATR_SIZE];
> + int atr_len;
> +};
> +
> +static SCARDCONTEXT global_context;
> +
> +#define MAX_RESPONSE_LENGTH 261 /*65537 */
> +/*
> + * handle all the APDU's that are common to all CAC applets
> + */
> +static VCardStatus
> +passthru_process_apdu(VCard *card, VCardAPDU *apdu, VCardResponse **response)
> +{
> + LONG rv;
Where does this odd LONG type come from? I think Windows uses LONG so
having your own type would conflict with that, and of course we don't
really want Windows types directly in QEMU either, so I am curious?
Otherwise the code looks fine.
Cheers,
Jes
- Re: [Qemu-devel] [PATCH v23 04/11] introduce libcacard/vscard_common.h, (continued)
- [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Alon Levy, 2011/03/23
- Re: [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Jes Sorensen, 2011/03/28
- Re: [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Alon Levy, 2011/03/28
- Re: [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Alon Levy, 2011/03/28
- Re: [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Jes Sorensen, 2011/03/28
- Re: [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Blue Swirl, 2011/03/28
- Re: [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Alon Levy, 2011/03/28
- Re: [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus, Blue Swirl, 2011/03/28
[Qemu-devel] [PATCH v23 08/11] libcacard: add passthru, Alon Levy, 2011/03/23
- Re: [Qemu-devel] [PATCH v23 08/11] libcacard: add passthru,
Jes Sorensen <=
[Qemu-devel] [PATCH v23 09/11] libcacard: add docs, Alon Levy, 2011/03/23
[Qemu-devel] [PATCH v23 07/11] libcacard: add vscclient, Alon Levy, 2011/03/23
[Qemu-devel] [PATCH v23 11/11] ccid: add docs, Alon Levy, 2011/03/23