Patchwork libcacard: correct T0 historical bytes size

login
register
mail settings
Submitter Marc-André Lureau
Date Dec. 2, 2012, 9 p.m.
Message ID <1354482055-10421-1-git-send-email-marcandre.lureau@redhat.com>
Download mbox | patch
Permalink /patch/203252/
State New
Headers show

Comments

Marc-André Lureau - Dec. 2, 2012, 9 p.m.
The VCARD_ATR_PREFIX macro adds a prefix of 6 characters only.

pcsc_scan was complaining before the patch:

+ Historical bytes: 56 43 41 52 44 5F 4E 53 53
 ERROR! ATR is truncated: 2 byte(s) is/are missing
---
 libcacard/vcardt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Marc-André Lureau - Jan. 14, 2013, 4:18 p.m.
ping

On Sun, Dec 2, 2012 at 10:00 PM, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
> The VCARD_ATR_PREFIX macro adds a prefix of 6 characters only.
>
> pcsc_scan was complaining before the patch:
>
> + Historical bytes: 56 43 41 52 44 5F 4E 53 53
>  ERROR! ATR is truncated: 2 byte(s) is/are missing
> ---
>  libcacard/vcardt.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> index d3e9522..538bdde 100644
> --- a/libcacard/vcardt.h
> +++ b/libcacard/vcardt.h
> @@ -26,7 +26,7 @@ typedef struct VCardEmulStruct VCardEmul;
>  #define MAX_CHANNEL 4
>
>  /* create an ATR with appropriate historical bytes */
> -#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
> +#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
>                                 'V', 'C', 'A', 'R', 'D', '_'
>
>
> --
> 1.7.11.7
>
Marc-André Lureau - Feb. 26, 2013, 12:58 p.m.
ping

On Mon, Jan 14, 2013 at 5:18 PM, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
> ping
>
> On Sun, Dec 2, 2012 at 10:00 PM, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
>> The VCARD_ATR_PREFIX macro adds a prefix of 6 characters only.
>>
>> pcsc_scan was complaining before the patch:
>>
>> + Historical bytes: 56 43 41 52 44 5F 4E 53 53
>>  ERROR! ATR is truncated: 2 byte(s) is/are missing
>> ---
>>  libcacard/vcardt.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
>> index d3e9522..538bdde 100644
>> --- a/libcacard/vcardt.h
>> +++ b/libcacard/vcardt.h
>> @@ -26,7 +26,7 @@ typedef struct VCardEmulStruct VCardEmul;
>>  #define MAX_CHANNEL 4
>>
>>  /* create an ATR with appropriate historical bytes */
>> -#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
>> +#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
>>                                 'V', 'C', 'A', 'R', 'D', '_'
>>
>>
>> --
>> 1.7.11.7
>>
>
>
>
> --
> Marc-André Lureau
Alon Levy - March 5, 2013, 4:11 p.m.
On Tue, Feb 26, 2013 at 01:58:36PM +0100, Marc-André Lureau wrote:
> ping

Works, thanks.

Reviewed-by: Alon Levy <alevy@redhat.com>

> 
> On Mon, Jan 14, 2013 at 5:18 PM, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
> > ping
> >
> > On Sun, Dec 2, 2012 at 10:00 PM, Marc-André Lureau
> > <marcandre.lureau@gmail.com> wrote:
> >> The VCARD_ATR_PREFIX macro adds a prefix of 6 characters only.
> >>
> >> pcsc_scan was complaining before the patch:
> >>
> >> + Historical bytes: 56 43 41 52 44 5F 4E 53 53
> >>  ERROR! ATR is truncated: 2 byte(s) is/are missing
> >> ---
> >>  libcacard/vcardt.h | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> >> index d3e9522..538bdde 100644
> >> --- a/libcacard/vcardt.h
> >> +++ b/libcacard/vcardt.h
> >> @@ -26,7 +26,7 @@ typedef struct VCardEmulStruct VCardEmul;
> >>  #define MAX_CHANNEL 4
> >>
> >>  /* create an ATR with appropriate historical bytes */
> >> -#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
> >> +#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
> >>                                 'V', 'C', 'A', 'R', 'D', '_'
> >>
> >>
> >> --
> >> 1.7.11.7
> >>
> >
> >
> >
> > --
> > Marc-André Lureau
> 
> 
> 
> -- 
> Marc-André Lureau
>

Patch

diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
index d3e9522..538bdde 100644
--- a/libcacard/vcardt.h
+++ b/libcacard/vcardt.h
@@ -26,7 +26,7 @@  typedef struct VCardEmulStruct VCardEmul;
 #define MAX_CHANNEL 4
 
 /* create an ATR with appropriate historical bytes */
-#define VCARD_ATR_PREFIX(size) 0x3b, 0x68+(size), 0x00, 0xff, \
+#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
                                'V', 'C', 'A', 'R', 'D', '_'