Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

myeid.profile: Template insane #120

Closed
thefloweringash opened this issue Jan 14, 2013 · 3 comments
Closed

myeid.profile: Template insane #120

thefloweringash opened this issue Jan 14, 2013 · 3 comments

Comments

@thefloweringash
Copy link

Hi,

Running pkcs15-init -C with an Aventra MyEID results in the error:

Couldn't bind to the card: Syntax error

Running pkcs15-init -C -vvv with the same card results in the error:

0x7fff752da180 00:39:46.140694538682402 [pkcs15-init] profile.c:375:sc_profile_load: profile /usr/local/Cellar/opensc/0.13.0/share/opensc/myeid.profile loaded ok
0x7fff752da180 00:39:46.034 [pkcs15-init] profile.c:2394:parse_error: /usr/local/Cellar/opensc/0.13.0/share/opensc/myeid.profile: Template insane: file-ids should be substantially different
0x7fff752da180 00:39:46.4294967330 [pkcs15-init] profile.c:385:sc_profile_load: returning with: -1501 (Syntax error)
0x7fff752da180 00:39:46.4294967330 [pkcs15-init] pkcs15-lib.c:368:sc_pkcs15init_bind: Failed to load profile 'myeid': Syntax error
0x7fff752da180 00:39:46.4294967330 [pkcs15-init] pkcs15-lib.c:379:sc_pkcs15init_bind: Load profile error: -1501 (Syntax error)

Examining the myeid.profile there are two files near the end, privdata and data both of which have file-id = 4501;.

Version 0.13.0 built on OS X 10.8.2 from source at https://sourceforge.net/projects/opensc/files/OpenSC/opensc-0.13.0/opensc-0.13.0.tar.gz

$ opensc-tool --info
opensc 0.13.0 [gcc  4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))]
Enabled features: zlib readline openssl pcsc(/System/Library/Frameworks/PCSC.framework/PCSC)

Thanks

@sjoblomt
Copy link
Contributor

Yes, you are right, there is a syntax error in myeid.profile.

There actually is no reason why the file ID's should be different, since OpenSC will find the free file ID and the profile only defines where to start the search. But this is how it currently works so the myeid.profile should be fixed.

The file-id for "data" should be changed to something else, e.g. 4601:


                EF privdata {
                    file-id   = 4501;
                    structure = transparent;
                    acl       = READ=$PIN, UPDATE=$PIN, DELETE=$PIN;
                }
                EF data {
                    file-id   = 4601;
                    structure = transparent;
                    acl       = READ=NONE, UPDATE=$PIN, DELETE=$PIN;
                }

However, I will push (hopefully today) a fix to myeid.profile if no one does it before me.

@sjoblomt
Copy link
Contributor

Pull request #123 is now done.

@viktorTarasov
Copy link
Member

Pull request #123 accepted in 58679a5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants