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

Dnie better wrapping/unwrapping of the secure apdus #1028

Merged
merged 2 commits into from
Apr 20, 2017

Conversation

rickyepoderi
Copy link
Contributor

Once the pull #975 is committed this is the second part that can be added to the DNIe. As I said in the previous issues/pulls the DNIe driver could be improved if the sc_transmit_apdu was called normally. This pull contains the following improvements:

  • Now it is possible not to force all the apdus to be SC_APDU_CASE_4_SHORT. The wrapping transforms the apdu into a CASE_4 and allocates the buffer for the response if necessary.
  • Not the dnie_free_apdu_buffers can be integrated inside dnie_sm_free_wrapped_apdu and avoid the need to call (and remember to call) this method. Now the clean part manages the response if created (if a response buffer was allocated in the previous point this part frees it).
  • The dnie_free_apdu_buffers now is not necessary (common get_sm_apdu and free_sm_apdu now handle everything safely).
  • The previous calls that were modified to be CASE_4 have been transformed back to CASE_3 (the get_sm_apdu method do the transformation now).
  • Finally the cwa_hexdump (which generates warnings in valgrind) has been changed to sc_hex_dump.

No memory problems detected with valgrind and my tester runs smoothly with the changes (both versions of DNIe). This modification can be seen as the second part of the previous unification to opensc secure messaging (I didn't want to do it before being sure the previous part was integrated).

With this pull the only thing I have in mind that can improve the DNIe driver is transforming the signature key in version 3.0 to always authenticate. But for the moment that part cannot be done. So I have no more pending changes.

@rickyepoderi
Copy link
Contributor Author

@miguel-cv @germanblanco Please try to check the pull if you have time. In theory this is the last big step in the DNIe in my queue.

@miguel-cv
Copy link

Tested with afirma offline, libreoffice,etc.. all working OK.
Web auth also works good.

@frankmorgner frankmorgner merged commit 741add2 into OpenSC:master Apr 20, 2017
@rickyepoderi
Copy link
Contributor Author

@frankmorgner Just an off-topic question, Is there any plan to release a new version soon?
DNIe 3.0 is working for some months and seeing it in an official release would be great.

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