Commit Graph

5572 Commits

Author SHA1 Message Date
Frank Morgner 46b0bed93f fixed PUK handling
Note that
`SC_PKCS15_PIN_AUTH_TYPE_PIN` is used for `sc_pkcs15_auth_info_t.auth_type`
`SC_PKCS15_TYPE_AUTH_PIN`     is used for `sc_pkcs15_object_t.type`
2014-04-21 20:43:41 +02:00
Nikos Mavrogiannopoulos 218d198bdc Call dlclose() only when having a valid handle.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2014-04-21 20:23:11 +02:00
Henrik Andersson fc5714a4c9 Set missing default create_slots_flags.
Without this pkcs11 cant be used without a configuration file
or a configfile without pkcs11 block due to the missing initialization
of default flag.
2014-04-21 13:53:57 +02:00
Martin Paljak 332ced5be7 Remove the bogus javacard "driver".
I had some ideas on how to improve the experience for JavaCards
but that path did not get implemented further and my approach now
is very different.

While it would be nice if OpenSC (command line) detected
somehow blank JavaCard-s and informed the user that steps a-b-c
should be taken to make use of it, it doesn't really fit in.
2014-04-21 13:44:27 +02:00
Nikos Mavrogiannopoulos 7796d2c95c Mention that create_slots_for_pins can be used to get opensc-onepin behavior. 2014-04-21 13:40:26 +02:00
Raul Metsma e7cda857f0 Fix memory leak, sc_pkcs15_cert_t *cert is never freed 2014-04-21 13:31:06 +02:00
Ludovic Rousseau cdc379fa25 pkcs11-tool: check for buffer overflows
Check the subject, issuer and serialNumber will encode in the allocated
space before copying the data.

Thanks to Umberto Rustichelli for the bug report
https://sourceforge.net/p/opensc/mailman/message/32210626/
2014-04-10 16:40:12 +02:00
Martin Paljak 8b4125e79d Merge pull request #213 from martinpaljak/default-driver
Default driver: do not send possibly arbitrary APDU-s to an unknown card...
2014-03-16 16:35:38 +00:00
viktorTarasov a399905d23 Merge pull request #211 from viktorTarasov/fix-206
Fix #206
2014-02-21 13:09:57 +01:00
Viktor Tarasov 8871e61596 pkcs15: change names of internal SPKI procedures
sc_pkcs15_pubkey_from_spki_sequence() takes the ASN1 'subjectPublicKeyInfo' data
sc_pkcs15_pubkey_from_spki_fields() takes the ASN1 'subjectPublicKeyInfo' data without outter SEQUENCE tag
2014-02-16 22:35:52 +01:00
Viktor Tarasov 53eae613d4 pkcs15: remove not used internal procedures
sc_pkcs15_copy_pubkey_from_spki_object() not used
2014-02-16 22:11:39 +01:00
Martin Paljak 3acb3d8e60 Default driver: do not send possibly arbitrary APDU-s to an unknown card. 2014-02-14 11:53:10 +00:00
Viktor Tarasov 72bf7a8593 pkcs15init: NULL 'store-key' hahdle
Card driver can not define 'store-key' init handle
2014-02-09 18:49:58 +01:00
Viktor Tarasov 345d4b905c PIV: encode SPKI public key data 2014-02-09 18:49:58 +01:00
Viktor Tarasov 12d362fc73 PIV: fix segfault and valgrind issue
prototype of 'get-guid' has been changed;

valgrind issue:
Conditional jump or move depends on uninitialised value(s)
   at 0x5A0159B: vfprintf (vfprintf.c:1629)
   by 0x5AC04BF: __vsnprintf_chk (vsnprintf_chk.c:65)
   by 0x522A665: sc_do_log_va.part.0 (stdio2.h:78)
   by 0x522A819: sc_do_log (log.c:52)
   by 0x529462F: piv_card_ctl (card-piv.c:1794)
   by 0x5232E2F: sc_card_ctl (card.c:772)
   by 0x52E561D: sc_pkcs15emu_piv_init (pkcs15-piv.c:626)
2014-02-09 18:49:58 +01:00
Viktor Tarasov 8000564239 pkcs15: fix encoding of 'SubjectPublicKeyInfo' 2014-02-09 18:49:58 +01:00
Viktor Tarasov dd5115bc02 pkcs15: use 'direct' public key value
pkcs15: in pubkey-info data
 * introduced new 'direct' 'raw' and 'spki' members
 * removed 'encoded der data' member
 * in 'read-public-key' try firstly SPKI direct value

pkcs11:
'direct' data used when getting CKA_VALUE attribute of public key

pkcs15init:
 * initialize 'raw' and 'spki' direct public key value
2014-02-09 18:49:58 +01:00
Viktor Tarasov 343a627c78 pkcs15init: set EC pubkey key params using init arguments 2014-02-09 18:49:58 +01:00
Viktor Tarasov 122c58de85 pkcs15init: do not use 'der-data' of pubkey data 2014-02-09 18:49:58 +01:00
Viktor Tarasov efa6e852c2 myeid: support of EC key is broken,
waiting for specification and card from Aventra (VTA)
2014-02-09 18:49:58 +01:00
Viktor Tarasov 2f8fc498ae sc-hsm: emu: initialize EC key params
;fix EC parameters for the emulated public keys
;add 'sc-context' argument in some function prototypes
2014-02-09 18:49:58 +01:00
Viktor Tarasov 1775198ed7 pkcs11-tool: format object info output 2014-02-09 18:49:58 +01:00
Viktor Tarasov 46303a640a build: new 'disable-optimization' configure option 2014-02-09 18:49:58 +01:00
Viktor Tarasov 032a3ece20 pkcs15init: ignore if no TokenInfo file to update 2014-02-09 11:59:26 +01:00
Doug Engert c5c49e3fd4 sc_pkcs15_encode_pubkey_as_spki depends on DER encoded RAW key
Make sure the sc_pkcs15_pubkey structure contains the DER endoding
of the RAW public key before trying to produce the SPKI version.
2014-01-19 19:30:04 +01:00
Viktor Tarasov 46c86fcb66 coding style: use short form of debug macros 2014-01-19 19:19:17 +01:00
Viktor Tarasov 3f023d3342 pkcs15: PIN value not validated in pkcs15-verify
In pkcs15-verify the value of PIN is not more validated for conformity with PIN policy,
value is only checked for maximal allowed length.

So that, no more need of 'ignore-pin-length' configuration option - now it's default behavior of common framework.
2014-01-19 19:19:17 +01:00
Viktor Tarasov 0efe1ec05e coding style: remove trailing spaces 2014-01-19 19:19:17 +01:00
Viktor Tarasov 085f971f95 pkcs15init: iasecc: fix uncomplete merge
prototype of sc_pkcs15_get_object_guid has been changed
2014-01-19 19:19:17 +01:00
Martin Paljak 9f90cfae7d macosx: inlude all files needed to build the installer from distribution.
There was a typo in the makefile...
2014-01-14 16:35:12 +00:00
Viktor Tarasov 5437f87d4b pkcs15: encode public key algorithm (issue 202)
coding style: use linux style line break
2014-01-13 13:02:08 +01:00
Viktor Tarasov 3d3592ab28 pkcs15-tool: remove unused 'pubkey_pem_encode()'
used instead the sc_pkcs15_encode_pubkey_as_spki()
2014-01-13 12:48:16 +01:00
viktorTarasov 3dba84714f Merge pull request #204 from CardContact/master
SmartCard-HSM improved token, PIN and EC key support
2014-01-12 12:32:57 -08:00
Andreas Schwier 67dc60f707 sc-hsm: Added support for persistent EC public keys generated from certificate signing requests 2014-01-09 21:41:12 +01:00
Andreas Schwier 9e54756e1b sc-hsm: Added support to unblock PIN using C_InitPIN() 2014-01-08 19:32:53 +01:00
Andreas Schwier d1ba6164ad sc-hsm: Added support for token label to be set via C_InitToken or sc-hsm-tool 2014-01-08 16:07:13 +01:00
Ludovic Rousseau abb48c8ba7 reader-pcsc: fix compiler warning
Add a missing "const" for a constant C-string

reader-pcsc.c: In function `detect_reader_features':
reader-pcsc.c:926:20: warning: initialization discards `const' qualifier from pointer target type [enabled by default]
2014-01-06 15:36:50 +01:00
Ludovic Rousseau c6d3b3b086 reader-pcsc: fix verify/modify pinpad commands
The PC/SC v2 part 10 commands for PIN verify and modify were wrong after
a change in pcsc-lite.
See a similar change in http://lists.alioth.debian.org/pipermail/pcsclite-cvs-commit/2013-December/006364.html

Should fix issue #199
2014-01-06 15:28:22 +01:00
Martin Paljak 4ebc506897 macosx: Ignore the configure-changed distribution.xml file in git. 2014-01-04 16:44:13 +00:00
Martin Paljak 4c31128bef macosx: add "graphical uninstaller" to distribution DMG.
This allows to uninstall the software by people who don't use Terminal.
2014-01-04 16:43:36 +00:00
Jonathan Süssemilch Poulain ab814380cf Adds support for a Swedish eID card 2014-01-01 20:22:17 +01:00
Viktor Tarasov 034cff91d8 pkcs15: unify error codes of 'internal' and 'syntetic' binds
if no valid PKCS#15 file system found
  'internal' bind procedure returns 'non-supported-card' error
  the same as 'syntetic' bind procedure.
  this return code is used by pkcs11 framework to accept non-binded cards

some codding style issues
2014-01-01 18:21:06 +01:00
Viktor Tarasov 3ab84b3b35 log: no format for the short arrays in 'hex-dump' 2014-01-01 18:21:05 +01:00
Viktor Tarasov 0fa475ee5f build: define in configure.ac.in the common fields of version-info 2013-12-30 10:31:21 +01:00
Viktor Tarasov b3baf9e75d build: delete 'configure.ac', bootstrap creates it from 'configure.ac.in'
'configure.ac' has to be with the context related information,
as 'fix number', 'release number', fields of MSDN version-info, ...

Using supplied (or not) options,
bootstrap will create the working 'configure.ac' as a modified version of 'configure.ac.in'.
2013-12-30 10:30:03 +01:00
Viktor Tarasov aec6f99ff4 win32: build: add 'VarFileInfo' block to version-info 2013-12-29 22:00:29 +01:00
Viktor Tarasov 53ed5dc502 win32: build: 'version-info' resource for each target 2013-12-29 22:00:29 +01:00
Viktor Tarasov b928e814e5 build: bootstrap can be used with options
'branch', 'revision' and 'suffix'
2013-12-29 22:00:29 +01:00
Viktor Tarasov 1d45eea907 md: implement 'CardChangeAuthenticator' 2013-12-29 22:00:29 +01:00
Viktor Tarasov f72c6fe625 md: implement CardUnblockPin 2013-12-29 22:00:28 +01:00