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

add Japanese national card driver #801

Closed
wants to merge 5 commits into from
Closed

add Japanese national card driver #801

wants to merge 5 commits into from

Conversation

hamano
Copy link
Contributor

@hamano hamano commented Jun 17, 2016

Japan began to distribute national ID card from this year.
One of application called JPKI has two digital certificate.
I wrote driver for this card.
Thank you.

return SC_ERROR_OUT_OF_MEMORY;
}
memset(drvdata, 0, sizeof (struct jpki_private_data));
sc_format_path("D3 92 f0 00 26 01 00 00 00 01", &drvdata->aid);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're selecting this AID multiple times. Could you use something like a define or a global const for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix 4f25429

@viktorTarasov
Copy link
Member

Could you rebase your PR into 1-2 commits?

@hamano
Copy link
Contributor Author

hamano commented Jun 25, 2016

@viktorTarasov OK, I've rebase and force pushed into this branch.
Thank you.

#include <string.h>
#include <stdio.h>
#ifdef ENABLE_OPENSSL
#include <openssl/x509v3.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you using this include?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed e495e8d

@viktorTarasov
Copy link
Member

@hamano
For me it's OK.

Just little remark:
if for you it's not a principal question, could you change the SC_LOG_DEBUG_VERBOSE debug level to SC_LOG_DEBUG_NORMAL and use everywhere the LOG_FUNC_CALLED style for debug message calls, instead of SC_FUNC_CALLED style. (sc_log instead of sc_debug, etc)

Also, if in some function you have the FUNC_CALLED debug message call, it's better to insert also the FUNC_RETURN message. (without fanaticism, of cause).

@hamano
Copy link
Contributor Author

hamano commented Jul 4, 2016

Thanks for your review.
fixed 83db4f1

LOG_TEST_RET(card->ctx, rc, "APDU transmit failed");
if (apdu.sw1 != 0x63) {
sc_log(card->ctx, "VERIFY GET_INFO error");
LOG_FUNC_RETURN(card->ctx, SC_ERROR_CARD_CMD_FAILED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your card is ISO 7816 compliant, then you should get 9000 when the user is logged with this APDU. In this case you should not return an error!

@frankmorgner
Copy link
Member

how have you tested your implementation?

viktorTarasov pushed a commit that referenced this pull request Jul 10, 2016
VTA: cosmetic touch and rebase to one commit
close PR #801
@viktorTarasov
Copy link
Member

applied in f80673e

@hamano
Copy link
Contributor Author

hamano commented Jul 11, 2016

@frankmorgner I've tested pkcs11-tool -l -s and SSH login.
Is there any other test that you recommend?

@hamano
Copy link
Contributor Author

hamano commented Jul 11, 2016

@viktorTarasov please merge 83db4f1 9ed8537 9599d0c
Should I rebase these commits?

@viktorTarasov
Copy link
Member

@hamano

please merge ...

All these commits are rebased into one (few minor fixes are added) and applied to master.
Look onto the sources in f80673e.

@hamano
Copy link
Contributor Author

hamano commented Jul 11, 2016

@viktorTarasov OK, Thanks!
Now I'm working in progress:

  • C_SignUpdate() does not working.
  • read exactly certificate EF size.
  • add CA certificate

Do you prefer to merge from another PR?

@viktorTarasov
Copy link
Member

@hamano
Yes, you have to do a new PR.

Your card driver is in master, it cannot be rebased, and so, all changes have to pass through a dedicated PR.

hamano added a commit to jpki/OpenSC that referenced this pull request Jul 13, 2016
VTA: cosmetic touch and rebase to one commit
close PR OpenSC#801
viktorTarasov pushed a commit that referenced this pull request Jul 17, 2016
VTA: cosmetic touch and rebase to one commit
close PR #801
hamano added a commit to jpki/OpenSC that referenced this pull request Jul 19, 2016
VTA: cosmetic touch and rebase to one commit
close PR OpenSC#801
hamano added a commit to jpki/OpenSC that referenced this pull request Jul 28, 2016
VTA: cosmetic touch and rebase to one commit
close PR OpenSC#801
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

Successfully merging this pull request may close these issues.

None yet

3 participants