Commit Graph

65 Commits

Author SHA1 Message Date
frankmorgner
4ebf93e51b using proper type for getline result
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@84 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-29 07:33:45 +00:00
frankmorgner
06375ec693 added support for changing CAN and PIN for PACE
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@83 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-28 13:14:40 +00:00
frankmorgner
576aaca098 updated instructions
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@82 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-27 20:02:31 +00:00
frankmorgner
fdc400b911 - sm will yield error when the class byte indicates a sm apdu and pace will
simply transmit the apdu without encrypting/authenticating it.
- fixed building process when compiling without pace


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@81 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-27 20:00:42 +00:00
frankmorgner
6e81cb30cd added option to select card driver. beautified usage dialog.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@80 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-19 18:12:26 +00:00
frankmorgner
835484a8c2 improved build process
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@79 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-16 20:37:34 +00:00
frankmorgner
3db1a59a19 improved option parsing
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@78 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-16 18:18:29 +00:00
frankmorgner
b40ec45e5a added option to scan for available readers
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@77 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-16 14:08:13 +00:00
frankmorgner
5b6496a6c6 added header file for pace library functions
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@76 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-15 20:03:09 +00:00
frankmorgner
7e0b4c1594 - added information about opensc
- using sc_transmit_apdu instead of my_transmit_apdu. fixing the opensc error
  is the better solution than implementing it twice (see
  http://www.opensc-project.org/opensc/ticket/209)


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@75 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-15 18:37:03 +00:00
frankmorgner
f0730c3626 updated information
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@74 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-15 07:41:15 +00:00
frankmorgner
35f75abe1d - Fixed error when testing pace without card
- Testing pace allows now to choose the type of the secret (mrz, pin, can, puk).
  The secret can be given as commandline option or interactively.
- Cleaned prompt for getting the password
- Fixed error when inserting an empty password
- When PACE is successfully finished, APDUs for testing can be given
  interactively


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@73 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-15 07:37:32 +00:00
frankmorgner
b798a6e3a2 - completed mac verification. sm with pace is now fully functional.
- made pace_test more fault tolerant.


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@72 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-13 21:06:17 +00:00
frankmorgner
985590c3a8 - decryption of sm apdu now working. verification of mac still missing.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@71 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 21:22:39 +00:00
frankmorgner
535a2ea9f1 fixed various memory leaks and potential segfaults
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@70 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 19:54:43 +00:00
frankmorgner
d8ababbf96 - protocol nid in pace_sm_ctx is not needed any longer due to the changes of OpenPACE
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@69 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 14:26:23 +00:00
frankmorgner
f84d7f1752 bugfixes:
- sm.c: fixed mac data padding, when sending sm apdu without data.
- pace.c: for iv calculation ecb is used instead of cbc
- pace.c: fixed ssc incrementation


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@68 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 14:04:08 +00:00
frankmorgner
835fa61102 - trying new apdu to reset retry counter in pace_test
- added pace wrapper for sm_transmit_apdu which automatically increments the ssc


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@67 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 12:09:40 +00:00
frankmorgner
3a8bf5f09b added missing include
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@66 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 10:31:24 +00:00
frankmorgner
888c7d7ab6 added code for reading cardsecurity
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@65 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 07:34:47 +00:00
frankmorgner
e752d51396 - reverted changes from last commit
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@64 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 07:23:13 +00:00
frankmorgner
c01c85e7ec - added more debugging
- bugfix: header of sm apdu is authenticated instead of the original apdu


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@63 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-12 07:18:35 +00:00
frankmorgner
ab13c8ffb7 bugfix: fetching unhandled error in update_iv
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@62 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-11 21:06:28 +00:00
frankmorgner
b3b9ad6aea made bin_log more verbose
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@61 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-11 20:49:48 +00:00
frankmorgner
90efc82314 Bugfixes:
- ssc is a BIGNUM, since its size can be up to 16 bytes (not 16 bits as before)
- protected le is now encoded as octet string (not as unsigned integer anymore)
- sc_format_asn1_entry was fet with wrong pointers (lebuf instead of *lebuf
  and formatted_data instead of *formatted_data

Added some debug output.


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@60 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-11 20:31:28 +00:00
frankmorgner
c8cd403ee9 made sm code independant from openssl
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@59 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-10 20:39:32 +00:00
frankmorgner
495149f265 - pace.c: removed unused variable ssc
- pace.c: bugfix: don't increment ssc when resetting it.
- sm.c/.h: wrote wrapper sm_transmit_apdu
- sm.c: removed sm error handling, should be done by sc_check_sw
- sm.c/ccid.c/pace.c: added qualifier "static" to local functions


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@58 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-10 18:16:09 +00:00
frankmorgner
8905bdec72 added sw checking for sm
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@57 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-10 17:00:00 +00:00
frankmorgner
6d0cc5e908 added missing return buffer for select of CardSecurity
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@56 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-10 15:12:37 +00:00
frankmorgner
cbc4dda0ed - sm.c (sm_encrypt) fixed header of sm apdu
- pace.c (EstablishPACEChannel) Fixed initialisation of authentication_ctx.
  (pace_test) Fixed usage of SC_TEST_RET and initialisation of select apdu for
  EF.CardSecurity.


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@55 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-10 14:53:45 +00:00
frankmorgner
62e48e2a7c - Work in progress: Almost finished (hopefully) flexible sm implementation
(untested).  struct sm_ctx needs external cipher and authentication
  implementations.  Here only routines for encryption/decryption/authentication
  with PACE are given.


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@54 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-09 20:36:32 +00:00
frankmorgner
9d573d0398 integrated SM into pace
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@53 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-04-01 05:52:37 +00:00
frankmorgner
ae3e7ae862 - added untested function to decrypt sm
- function cipher now always disables automatic padding


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@52 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-31 21:58:49 +00:00
frankmorgner
2a1afd8fd2 - Added an untested SM implementation, currently only with encryption
- Added utils from OpenPACE


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@51 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-29 19:53:11 +00:00
frankmorgner
7090788945 adapted latest changes of OpenPACE
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@50 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-22 14:42:43 +00:00
frankmorgner
faae949895 bugfix: corrected types of fields from ASN1_INTEGER to ASN1_OCTET_STRING
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@49 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-15 18:34:47 +00:00
frankmorgner
561cdfd694 - adopted the latest changes of OpenPACE
- bugfix: created receive buffer before sending general authenticate apdus
- added more debug output


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@48 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-15 15:01:01 +00:00
frankmorgner
e80c647b22 bugfix
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@47 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-10 09:14:38 +00:00
frankmorgner
2bc8c9b512 using specifications from TR-03110 2.01 as default (as done by test
cards)


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@46 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-09 19:30:29 +00:00
frankmorgner
a8887b1f03 bugfix: building with apdu.c apdu.h
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@45 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-09 07:01:19 +00:00
frankmorgner
e13b92b003 - bugfix: general authenticate response data is now encapsulated in a
dynamic data object
- added more debug messages
- bugfix: get_ef_card_access didn't fetch the whole file
- bugfix: set mse set at apdu type to case 3
- bugfix: only send the plain value (without tag/length) of the
  PACE_MSE_SET_AT object
- bugfix: fixed general authenticate cla byte and set apdu type to
  case 4
- sanity checks in sc_transmit_apdu forbid the required apdu format of
  general authenticate so it had to be reimplemented in
  my_transmit_apdu. apdu.c/apdu.h are mainly copied from opensc.



git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@44 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-08 22:16:47 +00:00
frankmorgner
0aab9bb184 - fixed includes
- fixed return value from pace_test if NO_PACE is defined


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@43 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-05 22:35:40 +00:00
frankmorgner
d91b45c47a - pace-testing is not done in threads anymore, program exits when test is finished
- bugfix in debug_ossl
- more generic aproach to select EF.CardAccess
- EF.CardAccess is read sequencially, to get a correct send sequence counter


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@42 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-05 09:53:44 +00:00
frankmorgner
69b8e3fc65 - bugfix: moved ASN.1 declaration of PACE-APDUs to pace.c
- added commandline-option to test PACE currently with hard coded secret etc.


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@41 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-03-01 16:22:41 +00:00
frankmorgner
4900d205ce Added support for Password Authenticated Connection Establishment (PACE) using
OpenPACE (http://sourceforge.net/projects/openpace/). Since it is currently
untested, it is disabled by default.


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@40 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-02-28 18:58:35 +00:00
frankmorgner
638e5301d0 - implemented option parsing with getopt_long
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@37 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-31 15:57:38 +00:00
frankmorgner
c4b69cd4cb - Some minor code improvements: catch and fix some rare errors, taking more
usage of opensc debugging methods, removed not needed variables and code
  fragments


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@36 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-31 01:47:52 +00:00
frankmorgner
ae067f8d07 - fixed segmentation fault, ccid running stable now again
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@34 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-30 11:52:25 +00:00
frankmorgner
e4424f7316 - switched to opensc's debugging function in log.h
- a segmentation fault of unknown origin crashes ccid after too many
  operations. last stable version is revision 29.


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@33 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-30 02:43:14 +00:00
frankmorgner
8372d0a7db - created detect_card_presence to avoid limitations of sc_detect_card_presence
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@32 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-30 00:04:10 +00:00