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

Epass2003 init #2403

Merged
merged 3 commits into from Jan 25, 2022
Merged

Epass2003 init #2403

merged 3 commits into from Jan 25, 2022

Conversation

dengert
Copy link
Member

@dengert dengert commented Sep 7, 2021

When selecting a file from the token, recreated the OpenSC acls from the sec_attrs which are the acls use by the token.

Fixes #2397

ce7fa42 introduced code that replaced using the file from the profile to use the file from the token. The file from the token did not have the file->acl. The epass2003_process_fci now recreates the file ->acl

Tested with- pkcs15-init using Feitian epass2003:

  • ./pkcs15-init -E
  • ./pkcs15-init --create-pkcs15 --profile pkcs15+onepin --use-default-transport-key --pin 12345678 --puk entersafe --label "A label"
  • /pkcs15-init --generate-key rsa/2048 --key-usage sign,decrypt --auth-id 01 --label "RSA1"

Fix OpenSC#2397

 On branch epass2003-init
 Changes to be committed:
	modified:   card-epass2003.c
pkcs15init/pkcs15-lib.c in sc_pkcs15init_add_app had:
/* FIXME: what to do if sc_pkcs15init_update_dir failed? */

This fixes the problem.

Fixes: OpenSC#2398 in that it will not segfault.

 On branch epass2003-init
 Changes to be committed:
	modified:   ../pkcs15init/pkcs15-lib.c
@lgtm-com
Copy link

lgtm-com bot commented Sep 10, 2021

This pull request fixes 1 alert when merging 84152c9 into a00ead5 - view on LGTM.com

fixed alerts:

  • 1 for FIXME comment

@dengert
Copy link
Member Author

dengert commented Sep 14, 2021

This PR should be ready to merge. It fixes two problems:

It also done NOT require ce7fa42 to be reverted as proposed a possible solution to #2397

Note: user is interested in getting this in to RedHat distribution. Although I have not tried building this with previous versions of OpenSC, it should easily backport to previous versions, as these files have not changed much in last few version.

@FeitianSmartcardReader
Copy link
Contributor

Thanks, @dengert 👍🏻

@frankmorgner frankmorgner merged commit afab2e6 into OpenSC:master Jan 25, 2022
Release 0.23.0 automation moved this from To do to Done Jan 25, 2022
@dengert dengert deleted the epass2003-init branch January 25, 2022 19:19
@dengert dengert mentioned this pull request Mar 29, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

OpenSC 0.22 newly fails to initialize a Feitian ePass2003 Auto USB device
4 participants