Page MenuHome GnuPG

on Mac OS X Leopard: gpg: Ohhhh jeeee: ATR returned by pcsc_status is too large
Closed, ResolvedPublic


Mac OS X Leopard has many bugs regardings PC/SC. One of them is that the
returned AT is often padded with 0x00 up to MAX_ATR_SIZE (33) bytes.

The problem is that GnuPG uses a wrong test to check for the ATR size:

if (atrlen >= DIM (reader_table[0].atr))

If the ATR size if exactly the maximum size then the ATR is considered too large.
The solution is to use ">" instead of ">=".
A patch is included.

My patch also replaces:

atrlen = 33;


atrlen = sizeof(reader_table[slot].atr);

to make the code more rebust.

The bug was reported on the macgpg bug tracker indicated in the ExtLink field.

Related Objects

Event Timeline

rousseau set External Link to
rousseau added a subscriber: rousseau.

Fixed in gnupg trunk (rev 4810). Will eventually make it into gnupg 1.4.

werner claimed this task.