Page MenuHome GnuPG

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

Description

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;

by

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 https://sourceforge.net/tracker/index.php?func=detail&aid=1839364&group_id=20789&atid=120789.
rousseau added a subscriber: rousseau.

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

werner claimed this task.