Commit Graph

97 Commits

Author SHA1 Message Date
nils 8e77e87551 sc_mutex_destroy should have a return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2832 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-05 19:35:55 +00:00
nils 5c3aed1189 - remove dependence on a specific threading library
- add two new structures: sc_thread_context_t which let
  the user specify the mutex functions to use and
  sc_context_param_t to specify parameters for the sc_context_t
  creation (including mutex functions) using sc_create_context()
- add new function sc_context_create()  
- remove timestamp code from libopensc


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2829 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-01 22:59:42 +00:00
nils de4b5c280f - implement thread-safe path printing function sc_path_print() and use
it src/libopensc/ and src/pkcs15init/
- use size_t for the certlen parameter of sc_pkcs15init_update_certificate()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2811 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-11 23:41:17 +00:00
nils f18b38fe7f summary: -add more general path concatenation function
sc_concatenate_path() and let sc_append_path use it.
         -add function sc_compare_path_prefix to check whether
          a path starts with a certain sub-path (prefix).
         -add some doxygen docu to some path handling functions


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2801 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-01 23:11:00 +00:00
aj 138dfad842 simply code / remove dead code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2711 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:36:55 +00:00
nils fa65fbf285 summary: - add new function sc_format_oid to libopensc
- cleanup libopensc api


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2670 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 18:05:30 +00:00
nils d858b4f84c fix build with openssl 0.9.8:
move "#include <openssl/crypto.h> up and remove unnecessary 
include for asn1.h 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2642 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-09 22:15:35 +00:00
nils 6abeaf1f1c add a new function
void sc_mem_clear(void *ptr, size_t len);
to clear a memory buffer. If OpenSSL is used this function
is a wrapper for OPENSSL_cleanse, otherwise memset is currenlty used.

Use this function to clear memory buffers with sensitive content.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2601 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-17 10:44:45 +00:00
nils f317e2966a sc_file_dup(): copy attributes as well, use explicit assignement and check return values
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2498 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-19 06:39:16 +00:00
nils 7ff54c7e2e use calloc instead of malloc + memset
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2497 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-18 22:43:01 +00:00
nils eab657fb52 change sc_bin_to_hex separator parameter from char to int as character constants are integers in c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2461 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-03 18:43:40 +00:00
sth d0f267468e Added function sc_compare_oid()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2456 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-03 09:00:00 +00:00
sth e992e1ddfb Prevent doubles in the ACL entries
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2282 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-26 19:48:28 +00:00
bert 2d97002824 API fixup: use defined type instead of struct for exposed structs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2232 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-08 20:59:35 +00:00
aet 69d2e9014d - Optimize a few cpu cycles from _sc_match_atr_hex
- Replace struct sc_atr_table / _sc_match_atr with
  recently introduced _hex variants
- Rewrote _add_atr
- Introduce int type variable to sc_card_t, so that
  every other card driver won't have to glue around
  with this
- Card driver cleanups, optimize the number of
  sc_match_atr called per card driver. Also
  always try direct match with _sc_match_atr
  first, before relying on eg. historical bytes
  information on some card drivers
- Fixed a memory leak from the miocos driver


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2145 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 19:40:40 +00:00
nils 2c0781335c fix signed vs. unsigned mismatch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1934 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-17 16:20:46 +00:00
nils f044157553 fix incorrect use of realloc (x = realloc(x, y) doesn't free
the x in case of a failure)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1775 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-21 18:10:58 +00:00
okir 624e345a58 - in sc_format_path, initialize path->count = -1
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1623 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-20 15:40:01 +00:00
okir bf7e801fac - new path functions: sc_append_file_id, sc_compare_path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1503 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 14:34:18 +00:00
aet 5616dba08e - Stop using unflexible automake conditionals when
building PC/SC, OpenCT or USBToken support,
  use ifdef's directly in source.
- Because of above, add HAVE_PCSCLITE for winconfig.h
- Remove unnecessary includes for log.h, opensc.h and
  errors.h in libopensc sources, they're already taken
  care by internal.h.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1406 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 09:28:55 +00:00
okir dc42cd3fa7 - added sc_print_path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1400 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-29 12:55:30 +00:00
aet 763fc16704 Rename libopensc specific error/debug to sc_error/sc_debug
We should have done this ages ago.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1392 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-25 14:21:18 +00:00
aj 1091548eda seperator is written to an u8, so it should be a char or u8 anyway.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1324 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-01 07:03:16 +00:00
okir 21fe5ef918 - Patch from Stef to implement sc_wait_for_event, slightly enhanced by
yours truly.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@825 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-03 16:32:06 +00:00
okir 34d45b2210 - minor signedness issue
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@801 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-19 21:17:06 +00:00
jey 9a8c3b2b20 - Added support for separator characters in sc_bin_to_hex()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@767 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-10 14:44:42 +00:00
jey 3bced8aeae - Changed sc_bin_to_hex() prototype a bit and removed the ':' characters
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@760 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-10 13:26:31 +00:00
okir 868d1d7a20 - added sc_bin_to_hex
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@757 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-06 12:49:19 +00:00
okir 59ca2a4b0f - sc_parse_atr: initialize slot->atr_info.hist_bytes even if the ATR is bad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@756 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-05 09:34:24 +00:00
okir c83fa88ca8 - Parsing pkcs11 IDs and paths with an odd number of bytes would scan past
the end of the string. Made sc_hex_to_bin more robust and change various
  place to use it rather than doing it on their own with scanf(%02x)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@754 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-04 15:36:33 +00:00
aet 1d2c9e4c48 Cleanups for initial win32 port, untested.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@696 c6295689-39f2-0310-b995-f0e70906c6a9
2002-10-19 14:04:52 +00:00
fabled 7635468ed9 - Initial support for win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@654 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-14 12:52:56 +00:00
aet 3dccd63989 - C++ support. Compiles with gcc/g++ for Linux, otherwise
completely untested.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@574 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-19 14:23:31 +00:00
okir 5d8b1000ca - eToken patches from Markus Friedl
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@546 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-17 13:36:35 +00:00
jey 6e0b7dea2c - Divided errors into different groups, added new ones
and renamed some
- Moved sc_strerror() to errors.c
- Added a 'sensitive' flag to struct sc_apdu


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@479 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-06 12:02:28 +00:00
jey 22636c2df9 - Added SC_ERROR_FILE_ALREADY_EXISTS
- Changed call convention for reader finish()
- CT-API driver now frees its resources correctly
- Added year 2002 to some of the copyright statements
- sc_pkcs15_decipher() and sc_pkcs15_compute_signature()
  now select only the parent DF of the private key file


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@463 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 14:46:44 +00:00
aet d81d10ba90 Upgrade sources to use new headers, part #1
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@458 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 10:44:51 +00:00
okir 0683b3463f - added two new error codes for pkcs15init
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@426 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-03 11:51:07 +00:00
aet 2fbf01e87d Remove #include "config.h", sc-internal.h already does that
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@409 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-31 16:32:07 +00:00
jey 7ddcb3d692 - sec_attr and prop_attr are now dynamically allocated in
struct sc_file


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@404 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-28 14:13:36 +00:00
jey 59d4e9b7be - Added support for CT-API
- Improved config file loading
- Implemented ATR parsing


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@396 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-26 11:38:40 +00:00
jey cd4e3650a4 - Moved functions from sc.c to ctx.c
- Card and reader drivers are now configurable


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@387 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-24 22:47:35 +00:00
aet 7d27225e0c Oops, scconf_parse was called twice. Fixed.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@382 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-24 17:09:47 +00:00
aet 21aae9c4d0 - Fix a potential segfault for the new sc_establish_context
- Keep the variable names in opensc.conf the same as they
  are in code structs.

Always try to parse app default { } first, then upgrade
the settings with the application specific configuration block.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@381 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-24 16:57:39 +00:00
jey f21926af00 - Started to add configuration file support to
libopensc
- Added typedefs for some basic structs (e.g.
  struct sc_card --> sc_card_t)
- Added a second argument to sc_establish_context()
  to identify the calling application
- Renamed sc_destroy_context() to sc_release_context()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@378 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-24 14:12:38 +00:00
jey 23e956cf9b - Fixed PKCS #15 structure generation on Cryptoflex cards
and implemented a default profile
- Cryptoflex now reports its supported PK algorithms
  correctly
- Various pkcs15-init fixes


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@295 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-12 13:00:57 +00:00
jey 6b07ff64f6 - Reworked PKCS #15 structure a bit (MANY THINGS
WILL BREAK)
- Added support for public key DFs (not tested yet)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@251 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-03 00:32:28 +00:00
jey 4fa7283ae2 - added some missing files
- renamed card-setec.c to card-setcos.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@243 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-26 11:27:49 +00:00
jey 04dfc47d92 - added a driver for MioCOS cards by Miotec
- implemented EF(DIR) updating


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@242 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-26 11:23:25 +00:00
jey 3fa1b27736 - implemented reader abstraction layer; now it's easier to
add support for e.g. CT-API
- renamed ops_data field to drv_data in struct sc_card
- copied coding style document from Linux kernel


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@221 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-24 19:32:14 +00:00