Commit Graph

1356 Commits

Author SHA1 Message Date
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
0a06537cee moved operations for opening sockets into separate functions
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@39 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-02-02 14:29:12 +00:00
oepen
5e9a299eaa - Object orientated refactoring of CardGenerator
- PassportOS class in VirtualSmartcard.py is no longer needed, because all the functionallity is now in CardGenerator
- Removed hard coded image
- Added version number and type to file format


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@38 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-02-01 16:40:27 +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
oepen
e500aa3382 Refactoring and Bugfixing:
- CryptoUtils:
    - removing hard coded keylength from append_padding in CryptoUtils
    - rewrote append_padding, slightly modified strip_padding in CryptoUtils
    - added get_cipher_keylen and get_cipher_blocklen to CryptoUtils
    - Updated UnitTest in CryptoUtils. Note: PBKDF2.self_test() fails!!!
    - added new function protect_string to encrypt and authenticate a string
    - Removed hard coded padding pattern
- VirtualICC:
    - Added and integrated functions to load and save VirtualICC objects
    - Added exception handling for opening of the socket
- SmartcardSAM:
    - Removed all object persistance functionaliy from SmartcardSAM
    - Changed the constructors of the *SAM classes

- Moved all the functionality to create cards (especially the pre-initialized filesystems for each card type) to the new file GenerateCards.py
- Added minimal command line based interface to GenerateCards.py to generate customized cards and store them in a file
- Removed default sam and mf files (testconfig.mf and testconfig.sam)


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@35 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-30 18:51:00 +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
frankmorgner
7b5be6ccd9 - added functions for simplified debugging
- changed functions to pass pointers instead of structs and using realloc
  instead of malloc to reduce memory overhead/usage
- changed functions to return opensc-errors to pass printout-debugging to the
  top level
- included functionality of get_RDR_to_PC_Parameters in
  perform_PC_to_RDR_GetParamters


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@31 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-29 18:04:30 +00:00
oepen
5f92f876fb Small Makefile fix: Added default target to virtualsmartcard/Makefile
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@30 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-25 17:18:20 +00:00
frankmorgner
431354dac3 added support for bNumberMessage
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@29 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-24 07:13:29 +00:00
frankmorgner
ffb210f0a5 added support for flags in bConfirmPIN
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@28 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-23 22:45:25 +00:00
frankmorgner
1c3a426434 added support for pin modification
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@27 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-23 22:10:00 +00:00
frankmorgner
afeea72f23 - added defines for pin modification
- debugging apdu and rapdu there where they are created
- splitted pin block operations into several functions


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@26 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-23 21:37:52 +00:00
oepen
ca8e202b53 PassportSAM: MRZ for key derivation is now read from MF instead of hard-encoding it in the code
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@25 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-23 15:59:22 +00:00
oepen
6fb50633e6 Changed Passport testdata
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@24 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-23 15:06:40 +00:00
frankmorgner
05861588ed - switched from libpcsc to libopensc. This brings some new features:
- Support for 4 slots per reader
  - abstraction of user interface
  - interactive pin verification
  - BCD encoding of PIN
  - Support for new readers (OpenCT)
  - automatically skip to a reader with a card
- added defines
- changed interface of ccid_initialize


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@23 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-21 21:48:01 +00:00
frankmorgner
1a53223f64 changed naming
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@22 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-14 22:29:11 +00:00
frankmorgner
76d4c08f4a removed not needed iso-identifier
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@21 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-14 20:28:24 +00:00
frankmorgner
450e6a81ab code split into multiple files, added include guards
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@20 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-14 19:20:36 +00:00
frankmorgner
c9485af8e6 bugfix
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@19 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-13 21:58:28 +00:00
frankmorgner
b0f3ce24e5 - added functions for a smartcard reset
- changed communication protocol via socket, length is coded in network byteorder
- splitted vpcd.[h|c] into more files, added include-guards


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@18 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-13 21:33:13 +00:00
frankmorgner
b4862e9be6 perform_PC_to_RDR_Secure works, read actual PIN is still missing
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@17 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-12 10:06:19 +00:00
frankmorgner
8d5b7f8744 added support for pinpad. doesn't work atm, somehow abPINApdu is wrong.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@16 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-10 23:09:11 +00:00
frankmorgner
e30640e43d bugfix
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@15 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-10 22:53:34 +00:00
frankmorgner
c535710e13 added serial number to cryptoflex. opensc can read it.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@14 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-08 14:33:52 +00:00
frankmorgner
9dd84e5962 bugfix
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@13 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-08 00:07:56 +00:00
frankmorgner
bc9f334d04 bugfix
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@12 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-07 22:57:18 +00:00
frankmorgner
a4ec33c83e changed vendorid/productid, added new structures for future PIN support.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@11 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-05 18:44:22 +00:00
frankmorgner
a29dc882ea Added target clean
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@10 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-05 14:17:58 +00:00
frankmorgner
01b3dad1bf Fixed Makefile, removed warning.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@9 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-05 14:04:04 +00:00
frankmorgner
08157f4e09 Cleaned up warnings.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@8 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-04 20:38:23 +00:00
frankmorgner
54e468fa29 Added picc_to_pcsc.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@7 96b47cad-a561-4643-ad3b-153ac7d7599c
2010-01-04 19:56:05 +00:00