Home GnuPG
Diffusion GnuPG 682da55aa985

fix wLangId in ccid-driver.c
682da55aa985Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

fix wLangId in ccid-driver.c

This is not a part of pin pad support series of mine.

As I found the bug while I am preparing the patches, I report this.

As CCID protocol is little endian, wLangId of US English = 0x0409
is represented as two bytes of 0x09 then 0x04.

It is really confusing that the code like following is floating
around:
pin_verify -> wLangId = HOST_TO_CCID_16(0x0904);

But, it is 0x0409 (not 0x0904). It is defined in the documentation:

http://www.usb.org/developers/docs/USB_LANGIDs.pdf

and origin of this table is Microsoft. We can see it at:

http://msdn.microsoft.com/en-us/library/bb165625%28VS.80%29.aspx

Yes, it would be better not to hard-code 0x0409. It would be better
to try current locale of the user, or to use the first entry of string
descriptor. I don't have time to implement such a thing...

Details

Provenance
gniibeAuthored on Jan 13 2011, 8:38 AM
wernerCommitted on Mar 2 2011, 4:52 PM
Parents
rG1c09def22d97: Fix usage of SHA-2 algorithm with OpenPGP cards.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG682da55aa985: fix wLangId in ccid-driver.c (authored by NIIBE Yutaka <gniibe@fsij.org>).Mar 2 2011, 4:52 PM