Commit Graph

59 Commits

Author SHA1 Message Date
Jakub Jelen f726d4f201 Improve logging mostly in opengpg 2021-03-01 14:35:50 +01:00
Frank Morgner d06f23e89b avoid debugging PIN commands
use a higher debug level to see it anyway
2020-03-05 22:17:09 +01:00
Frank Morgner 24b50a4277 replace sc_debug with sc_log 2018-12-06 09:26:42 +01:00
Frank Morgner cf55cdc637 replace SC_FUNC_CALLED with LOG_FUNC_CALLED 2018-12-06 09:26:42 +01:00
Hannu Honkanen aa814fd8e8 Implemented C_Wrap into PKCS#11 interface. Added support for wrapping and unwrapping with secret keys into framework-pkcs15.c and all the way to the card driver level. 2018-10-31 10:24:19 +02:00
Hannu Honkanen 5f51d5d315 Added implementation of C_UnwrapKey all the way from PKCS#11 interface to the card driver level.
Not yet complete, but can be run with CKA_TOKEN=FALSE set in the target object. Currently unwrapping emulated
with a decrypt operation in card-myeid.c. To be improved.
2018-10-31 10:22:16 +02:00
Peter Marschall 5abe99d228 fix typos
Mass-typo fixing, almost exclusively in comments and text strings.

While at it also fixed a few (very few) grammar errors.
2018-04-15 09:34:45 +02:00
Frank Morgner 04a7075290 fixed compiler warnings 2017-11-09 12:42:29 +01:00
Frank Morgner e54684b9db fixed documentation of GLP encoded PIN 2017-10-27 19:48:22 +02:00
Frank Morgner 4f189a5174 check for digits in case of BCD encoded PIN 2017-10-27 19:48:22 +02:00
Frank Morgner e7915ec198 replace assert with error handling 2017-04-04 09:11:35 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Viktor Tarasov 41861e42b0 no 'pace' in common part
'PACE' is extremely card specific protocol and has not to be ostensibly
present in the common part of OpenSC:
 * currently in OpenSC there is no card driver that supports or uses this protocol;
 * amazing content of the common 'sc_perform_pace' -- beside the verbose logs
   the only substantial action is to call the card/reader specific handler.
   According to the current sources and the pull request 83
   this 'common' procedure is called by the card driver or
   card specific tool/operation.
 * currently the 'PACE' can be thouroghly tested only by one person (Frank Morgner),
   and only using the OpenSSL patched with the PACE specific patch.
   So, at least a dedicated configuration option could be introduced when comiting PACE to the common part.
 * common 'sc_perfom_pace' has the same role as the 'initialize-SM' handler of the existing SM framework
   and can be implemented as card specific SM, as the others cards do.
   This confirmed by Frank Morgner, the author of PACE commits and nPA card driver, himself.
   (https://github.com/OpenSC/OpenSC/pull/83)
2012-08-30 18:51:42 +02:00
Frank Morgner 1141ae5202 Add support for PACE-enabled readers
Implements PC/SC interface to PACE-enabled readers defined in PC/SC
pt. 10 AMD 1 and BSI TR-03119.

PACE can be started using `sc_perform_pace`. This function currently
calls the new `perform_pace` from `struct sc_reader_operations`, if the
reader has the needed capabilities. `sc_perform_pace` could also be
extended with a stand-alone implementation of PACE (code could be
imported from here http://vsmartcard.sourceforge.net/npa/README.html).

Note that the reader's PACE capabilities are correctly determined by
calling GetReaderPACECapabilities.

OpenSC's new PACE capabilities can be tested using the `npa-tool` from
the Virtual Smart Card Architecture (see link above).
2012-02-21 14:10:47 +01:00
aj 6545b42c02 cleanup of the debug code:
* reduce to a few, supported functions.
* change all functions to take the debug level as parameter.
* use symbolic names for the debug levels.
* fix tools to pass "verbose"/"opt_debug" as ctx->debug.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4118 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 12:17:13 +00:00
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +00:00
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
aj b3ad2f9dd2 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3084 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:31:17 +00:00
nils 88bae5c923 remove iso logout function, remove dummy logout functions and remove logout call from sc_unlock()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2971 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-17 12:24:04 +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
nils 8a0fc5bdcf fix indent, patch supplied by Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2082 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 16:17:32 +00:00
nils 95440fb15b cleanup pin handling (set and use sc_pin_cmd_pin->pad_length + use pkcs15 puk object if existing)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2079 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-18 21:42:00 +00:00
nils bfee7bb9b3 of course we should not do it
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2078 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-17 09:10:53 +00:00
nils 548cf72735 fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1942 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-17 20:40:58 +00:00
nils 86345157b4 fix compiler warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1839 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-19 16:12:43 +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
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
sth c3c68e86f0 Global Platform PIN Encoding: 1. Fix for pin changes: use the real length instead of the max length -- 2. Check for valid pin chars
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1356 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-14 07:13:44 +00:00
sth 901a2d90e3 Added 'Global Platform' PIN encoding
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1257 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-14 13:20:49 +00:00
sth fc31b65a88 added sc_logout() functionality
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1153 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-20 08:30:46 +00:00
aet 037dbdfa13 Fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@845 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-06 23:46:24 +00:00
okir 9acca0e724 - Implemented new PIN verify/change/unblock framework. All PIN operations
are routed through sc_pin_cmd(), which builds the APDU and either passes
  it to the card directly, or to the card reader along with a request to
  read the PIN(s) from the reader's keypad.

  Currently, entering PIN in the standard way (i.e. via the application)
  should still work - I have verified GPK and eToken; Cryptoflex verify
  should work as well. Anything else needs additional testing, and support
  for keypad input in particular (I cannot test this at the moment for
  lack of a suitable reader).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@811 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-23 18:47:27 +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
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 6ca0cb108c - moved sc_decipher implementation to iso7816.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@326 c6295689-39f2-0310-b995-f0e70906c6a9
2002-03-15 09:42:07 +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
jey 262e5c2083 - added error reporting for several new SWs
- added check_sw function to sc_card_operations


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@211 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-15 23:17:58 +00:00
jey b4063302bf - added partial support for GPK 4000
- made line parsing in opensc-explorer saner
- moved change_reference_data and reset_retry_counter to
  iso7816.c, where they belong
- added partial libreadline support to opensc-explorer


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@206 c6295689-39f2-0310-b995-f0e70906c6a9
2002-02-10 18:04:03 +00:00
jey d9792242cc - fixed a bug with file permissions in flex_create_file()
- added RSA signature generation with Cryptoflex cards
- improved security environment handling
- implemented cryptoflex-tool


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@177 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-20 21:20:09 +00:00
jey 54e5d23e93 - improved PKCS #15 generation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@170 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-17 11:44:27 +00:00
jey 20adb4b39c - continued to improve PKCS #15 generation
- fixed a few problems in sc_set_security_env
- started to implement Better (tm) object handling for
  PKCS #15 objects


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@167 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-16 23:59:18 +00:00
jey 4e2192b0f4 - better ISO 7816-8 compatibility with various cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@162 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-16 20:20:40 +00:00
jey 5c993e1136 - added PIN verification, file creation and file deletion to
opensc-explorer
- documented the core API a bit using doxygen


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@158 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-10 23:02:48 +00:00
jey 9dc7054919 - added preliminary ASN.1 encoding support
- modified ASN.1 decoding to make it easier to
  port decoder structures to the encoder
- fixed a recently introduced bug in card driver handling
- opensc-explorer will now allow only DF's to be cd'd into


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@156 c6295689-39f2-0310-b995-f0e70906c6a9
2002-01-10 12:33:56 +00:00
jey daf877fadd - fixed resplen values in sc_decipher and sc_compute_signature
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@112 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-29 11:57:34 +00:00
jey 2b99f2df14 - added default driver for unidentified cards
- added select_file operation in Multiflex driver
- added 'list-drivers' command to opensc-tool
- moved stuff from opensc.h to sc-internal.h
- improved locking behaviour


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@106 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-25 20:45:48 +00:00
jey 0bba170d91 - LINT fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@88 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-22 13:38:25 +00:00
jey c17ff3ebdf - continued improving ASN.1 decoding
- improved debug levels
- added some PC/SC Lite workarounds


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@87 c6295689-39f2-0310-b995-f0e70906c6a9
2001-12-21 23:34:47 +00:00